Jump to: navigation, search

Difference between revisions of "Solum/ApiModel"

(Overview)
Line 18: Line 18:
 
* Target Deployment Environment (how and where the application is run “dev”, “staging” & “production”)
 
* Target Deployment Environment (how and where the application is run “dev”, “staging” & “production”)
  
=== A usecase ===
+
=== Use Case 1: Commit Triggers Unit/Build/Stage/Approve/Prod ===
  
* Given a git repo, whenever there is a commit pushed to the repo:
+
Given a git repo, whenever there is a commit pushed to the repo:
run local unit tests
+
# Run unit tests
* build an image from the app (with any requirements pre-built)
+
# Build an image from the app (with any requirements pre-built)
* deploy to a “staging” environment (where manual testing is done)
+
# Deploy to a “staging” environment (where manual testing is done)
* deploy to the production environment
+
# Await an approval of successful testing
 +
# Deploy to the production environment
  
 
=== Definitions ===
 
=== Definitions ===
I see 3 main entities:
+
Three concepts are needed to instruct Solum how to handle the requested sequence:
* application (aka plan)
+
* Applications (aka plan)
 
: git url
 
: git url
 
: required runtime services
 
: required runtime services
 
: extra config:
 
: extra config:
* environments (still under discussion)
+
* Environments (still under discussion)
 
: how and where to deploy resources
 
: how and where to deploy resources
 
: e.g. credentils, endpoints, location (region & AZ), compute type (VM, container) and scaling info.
 
: e.g. credentils, endpoints, location (region & AZ), compute type (VM, container) and scaling info.
* lifecycle
+
* Lifecycle
: the jobs to get the application from a git commit to a deployed heat stack
+
: Jobs advance the application from a git commit to a deployed heat stack
  
=== Example ===
+
=== Example YAML Input ===
  
 
  applications:
 
  applications:
Line 75: Line 76:
 
     template: {get_output: [template_builder, created_template_id]}
 
     template: {get_output: [template_builder, created_template_id]}
 
     image: {get_output: [image_builder, created_image_id]}
 
     image: {get_output: [image_builder, created_image_id]}
 +
 +
Templates like this one will be be stored as artifacts in Glance, pending completion of it's Artifact Repository feature, currently in design stage.
  
 
=== REST API ===
 
=== REST API ===
All the above applications/environments/lifecycle templates could be stored in glance
+
This API extension allows Solum to facilitate test/build/stage/approve/prod automation for the development of a given application. We refer to this as a <code>Project</code>.
 +
 
 +
Syopsis
  
Then we just need the following API
+
Get a list of app projects:
+
  GET projects/
Note: I can't think of a better name than "project", any suggestions?
 
  
project/
+
Create a new project:
project/<uuid>
+
Request:
  project/<uuid>/stacks/ [return a list of links to heat stacks, normally one]
+
  POST project/ HTTP/1.1
  project/<uuid>/job_history/ [once we have mistral, this could be links to mistral jobs]
+
  Content-Type: application/json
  project/<uuid>/job_history/<uuid>
+
  Length: ...
  
POST project/
 
 
  { lifecycle: <glance_id>,
 
  { lifecycle: <glance_id>,
 
   application: <glance_id>,
 
   application: <glance_id>,
 
   need_git_trigger: true }
 
   need_git_trigger: true }
  
response:
+
Response:
  {project_uuid: bla-abl,
+
HTTP/1.1 200 OK
  git_trigger_url: http://}
+
Content Type: application/json
 +
Content-Length: ...
 +
 
 +
  { project_uuid: bla-bla,
 +
  git_trigger_url: http://github.com/MyBlaBlaApp.git }
 +
 
 +
Get/Update a specific project:
 +
GET projects/<uuid>
 +
PUT projects/<uuid>
 +
 
 +
Return a list of heat stacks for a project, normally one:
 +
GET projects/<uuid>/stacks/
 +
 
 +
Show the job history for a given project (This could be links to Mistral jobs)
 +
GET project/<uuid>/job_history/
 +
 
 +
Show the details of a specific job in the job history:
 +
GET project/<uuid>/job_history/<uuid>
  
=== Old stuff ===
 
  
For DSL, we can also look at Mistral, Taskflow, Murano.
+
 
It will be great if more than one folks participate in the DSL discussions being proposed by Mistral guys
+
 
(ref. Email on Openstack-dev list).
+
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
Section to Ignore
  
 
Builder subsystem/service:
 
Builder subsystem/service:
Line 112: Line 177:
 
Additional Issues:
 
Additional Issues:
 
* Long running workflows would need Solum to use trusts (and renew tokens periodically).
 
* Long running workflows would need Solum to use trusts (and renew tokens periodically).
 
 
 
Build jobs need to be run on disposable VM's to be secure.
 
Build jobs need to be run on disposable VM's to be secure.
  
 
[[File:Solum-nodepool.png|non-framed]]
 
[[File:Solum-nodepool.png|non-framed]]

Revision as of 22:35, 28 April 2014

Overview

The design of Solum's API in release 2014.1.1 focuses primarily on resources to enable Application Lifecycle Management. It is suitable for expressing how to deploy an application, but it's not as useful for modeling a custom build/test/deploy pipeline for a given application taking into account everything needed in order to produce a CI/CD environment. This proposed design addresses that concern by detailing how the default behavior of Solum can be customized to accommodate a variety of different CI workflows.

From https://wiki.openstack.org/wiki/Solum: “An OpenStack Related Stackforge project designed to make cloud services easier to consume and integrate into your application development process. “

Solum currently allows integration with simple development process using Git, and a pre-defined workflow. We plan to add components that will allow customization of events that happen before the application's deployment, such as testing, image building, and advancing between various environments.

Proposal

Empower the Application Developer to use his/her source tree (git repo) as a tool for building images, running tests and deploying into a variety of environments.

Allow the following inputs: from the Application Developer:

  • Application source code
  • Application Requirements (both build and runtime)
  • Desired Pipeline Steps (eg. build, test, deploy)
  • Target Deployment Environment (how and where the application is run “dev”, “staging” & “production”)

Use Case 1: Commit Triggers Unit/Build/Stage/Approve/Prod

Given a git repo, whenever there is a commit pushed to the repo:

  1. Run unit tests
  2. Build an image from the app (with any requirements pre-built)
  3. Deploy to a “staging” environment (where manual testing is done)
  4. Await an approval of successful testing
  5. Deploy to the production environment

Definitions

Three concepts are needed to instruct Solum how to handle the requested sequence:

  • Applications (aka plan)
git url
required runtime services
extra config:
  • Environments (still under discussion)
how and where to deploy resources
e.g. credentils, endpoints, location (region & AZ), compute type (VM, container) and scaling info.
  • Lifecycle
Jobs advance the application from a git commit to a deployed heat stack

Example YAML Input

applications:
 thingy:
   git_url: git://x.me/a.git 
   services: 
     - trove
       remote_logging
   config:
     custom_env: foo
environments:
 default:
   compute: docker
   trust_token: bla-bla
   region: SYD
   flavor: m1.small
 production:
   trust_token: foo-fee
   region: US1
   flavor: m1.large
lifecycle:
 check:
   type: task
   cmd: tox
 template_builder:
   type: build_template
   depends_on: check
   target_environment: {find_in_catalog: {name: production, type: environment}}
 image_builder:
   type: task
   depends_on: check
   cmd: “solum-build-app .”
 deploy:
   type: deploy_stack
   environment: {find_in_catalog: {name: production, type: environment}}
   template: {get_output: [template_builder, created_template_id]}
   image: {get_output: [image_builder, created_image_id]}

Templates like this one will be be stored as artifacts in Glance, pending completion of it's Artifact Repository feature, currently in design stage.

REST API

This API extension allows Solum to facilitate test/build/stage/approve/prod automation for the development of a given application. We refer to this as a Project.

Syopsis

Get a list of app projects:

GET projects/

Create a new project: Request:

POST project/ HTTP/1.1
Content-Type: application/json
Length: ...
{ lifecycle: <glance_id>,
  application: <glance_id>,
  need_git_trigger: true }

Response:

HTTP/1.1 200 OK
Content Type: application/json
Content-Length: ...
{ project_uuid: bla-bla,
  git_trigger_url: http://github.com/MyBlaBlaApp.git }

Get/Update a specific project:

GET projects/<uuid>
PUT projects/<uuid>

Return a list of heat stacks for a project, normally one:

GET projects/<uuid>/stacks/ 

Show the job history for a given project (This could be links to Mistral jobs)

GET project/<uuid>/job_history/

Show the details of a specific job in the job history:

GET project/<uuid>/job_history/<uuid>


























Section to Ignore

Builder subsystem/service:

  • Investigate Jenkins
  • Investigate Mistral

non-framed

Additional Issues:

  • Long running workflows would need Solum to use trusts (and renew tokens periodically).

Build jobs need to be run on disposable VM's to be secure.

non-framed