{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/36378873","id":36378873,"diff_hunk":"@@ -0,0 +1,152 @@\n+# Image Promotion\n+\n+## Abstract\n+\n+This proposal describes the best practices and defines patterns for promoting Docker\n+images between different stages (eg. from \"development\" to \"production\").\n+This proposal also describes priciples a way how to configure OpenShift to serve as\n+a Continuous Delivery tool.\n+\n+## Constraints and Assumptions\n+\n+This document describes the following ways to promote images\n+\n+* Based on human intervention\n+* Driven purely by OpenShift\n+* Based on external Continuous Delivery tool (Jenkins, go.cd, Snap, ...)\n+\n+Docker images can be promoted (and the use-cases are valid for):\n+\n+* Within a single Project\n+* Between multiple Projects\n+* Between multiple Clusters\n+\n+The Docker image promotion can be done using the Docker image tags and LABELs.\n+You can also use other metadata that OpenShift adds to the Image resource,\n+such as annotations or labels, to allow conditional promotion, but this document\n+does not describe these advanced scenarios.\n+\n+Another constraint is that in some cases the image promotion might not be enough,\n+and you want to promote a set of images or entire deployment as one single unit\n+of promotion.\n+\n+## Use Cases\n+\n+### Automatic promotion based on running tests in Jenkins\n+\n+As a developer of a Rails application, when I update the source code and push it\n+to a remote source code repository, I want Jenkins to detect this change and perform a S2I\n+build of my application in OpenShift. Depending of the build result, I want Jenkins to\n+promote the newly built Docker image by tagging it as \"qa-ready\" and use OpenShift\n+deployments to promote it as \"production-ready\".\n+\n+#### Example\n+\n+As a user I create two DeploymentConfig's:\n+\n+* \"frontend-test\"\n+* \"frontend-production\"\n+\n+The \"frontend-test\" DeploymentConfig has the ImageChangeTrigger set to watch changes\n+in the \"qa-ready\" ImageStreamTag. This DeploymentConfig also defines the \"post\" lifecycle\n+hook that executes a script in the container deployed and performs additional verification\n+and tests.\n+\n+Example of DeploymentConfig post-lifecycle hook:\n+```json\n+\"strategy\": {\n+  \"type\": \"Rolling\",\n+  \"rollingParams\": {\n+    \"pre\": {\n+      \"failurePolicy\": \"Abort\",\n+      \"execNewPod\": {\n+        \"containerName\": \"test-container\",\n+        \"command\": [\n+          \"/opt/app-root/bin/verify-deployment\"\n+        ],\n+      }\n+    }\n+  }\n+}\n+```\n+\n+Based on the result of the `verify-deployment` command, that runs in the application\n+image, the command will promote the image by tagging it as `production-ready` (eg. using\n+the `oc tag` command). The command might also notify me about the verification failure.\n+\n+The \"frontend-production\" DeploymentConfig has the ImageChangeTrigger set to watch changes\n+in the \"prod-ready\" ImageStreamTag. When a new Docker image with this tag is available,\n+it can automatically rolls out a new production deployment. In case you don't want to roll out\n+the \"frontend-production\" automatically, you can avoid specifying the ImageChangeTrigger and\n+roll out the new deployment by hand.\n+\n+### Manual promotion using external Docker registry\n+\n+As a developer of a Rails application, when I update the source code and OpenShift\n+build my image I want to promote the image by passing it throught QA and devops team.\n+\n+#### Example\n+\n+* The image is passed to a remote QA team by pushing the image to a shared Docker registry\n+* Remote QA team pull the image and drive the testing and verification\n+* Remote QA team push the verified image back to the shared Docker registry, tagged as \"verified\" and with additional sign-off LABEL(s).\n+* Remote devops team pull the image from shared Docker registry and make it available in \"stage\" cluster.\n+* Remote devops team promotes the image from \"stage\" to \"production\"\n+\n+### Manual promotion of builder image using external Docker registry\n+\n+As a platform operator, I want to be able to promote the S2I builder image(s) when a new\n+version is available in Red Hat Docker registry. I want to perform additional verifications\n+(iow. deploy to \"stage\" first) before rolling a new image out to production which causes rebuild\n+of thousand applications.\n+\n+#### Example\n+\n+* OpenShift engineering push the `openshift/ruby-22-rhel7` image to internal CI registry.\n+* OpenShift QA team pull the image from the internal CI registry and run tests.\n+* OpenShift QA team sign-off the Docker image when tests pass and push it to \"integration\" registry.\n+* OpenShift operations team pulls the image from \"integration\" registry and promote it to \"stage\" environment.\n+* OpenShift operations team manually promote the image to production.\n+\n+### Semi-automatic promotion and testing of builder images\n+\n+As a OpenShift S2I image developer, I want to have the image rebuilt, tested and pushed to\n+the Docker Hub or to internal registry and tag it as \"qa-ready\" and notify the QA team about\n+availability of a new Docker Image.\n+\n+#### Example of pull request tester\n+\n+* OpenShift engineering propose a change to `openshift/ruby-22-rhel7` image.\n+* CI starts OpenShift server and execute the extended tests cases related to this image.\n+* CI send notification to original pull request.\n+\n+#### Example of push_images job\n+\n+* OpenShift engineering merge change to `openshift/ruby-22-rhel7` repository.\n+* OpenShift server detect the change and execute test suite for given image.\n+* If the image is 'base' image, OpenShift server launch multiple tests for all dependent images.\n+* OpenShift server push the image to internal registry and Docker Hub (see: \"Manual promotion of builder image\")\n+\n+## Areas of improvement\n+\n+The first use-case describes a typical Continuos Delivery example, where the developer uses\n+both the Jenkins server and the OpenShift to deliver updates to the application.\n+\n+### Jenkins\n+\n+* There is no support for enabling the Jenkins when creating a new application.\n+* There is no official \"jenkins\" plugin for OpenShift available.\n+* Users have to manually tweak the Jenkins job parameters.\n+* The Jenkins job definition is written in shell and it is complex.","path":"docs/proposals/image-promotion.md","position":140,"original_position":140,"commit_id":"2f0b078aec5d3fba146e6c466a08809e907a7fac","original_commit_id":"2f0b078aec5d3fba146e6c466a08809e907a7fac","user":{"login":"bparees","id":4974046,"avatar_url":"https://avatars.githubusercontent.com/u/4974046?v=3","gravatar_id":"","url":"https://api.github.com/users/bparees","html_url":"https://github.com/bparees","followers_url":"https://api.github.com/users/bparees/followers","following_url":"https://api.github.com/users/bparees/following{/other_user}","gists_url":"https://api.github.com/users/bparees/gists{/gist_id}","starred_url":"https://api.github.com/users/bparees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparees/subscriptions","organizations_url":"https://api.github.com/users/bparees/orgs","repos_url":"https://api.github.com/users/bparees/repos","events_url":"https://api.github.com/users/bparees/events{/privacy}","received_events_url":"https://api.github.com/users/bparees/received_events","type":"User","site_admin":false},"body":"no first class way to give jenkins openshift credentials needed to perform tagging/builds/etc.\r\n","created_at":"2015-08-06T03:38:28Z","updated_at":"2015-08-06T03:38:28Z","html_url":"https://github.com/openshift/origin/pull/4016#discussion_r36378873","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/4016","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/36378873"},"html":{"href":"https://github.com/openshift/origin/pull/4016#discussion_r36378873"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/4016"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/4016","id":41703131,"html_url":"https://github.com/openshift/origin/pull/4016","diff_url":"https://github.com/openshift/origin/pull/4016.diff","patch_url":"https://github.com/openshift/origin/pull/4016.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/4016","number":4016,"state":"open","locked":false,"title":"WIP: Image promotion proposal","user":{"login":"mfojtik","id":44136,"avatar_url":"https://avatars.githubusercontent.com/u/44136?v=3","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-05T17:15:29Z","updated_at":"2015-08-06T03:38:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e7ff6e13db5fb8675c9062de671afdf48b01b0d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin/pulls/4016/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/4016/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/4016/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/2f0b078aec5d3fba146e6c466a08809e907a7fac","head":{"label":"mfojtik:image-promotion","ref":"image-promotion","sha":"2f0b078aec5d3fba146e6c466a08809e907a7fac","user":{"login":"mfojtik","id":44136,"avatar_url":"https://avatars.githubusercontent.com/u/44136?v=3","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},"repo":{"id":22954249,"name":"origin","full_name":"mfojtik/origin","owner":{"login":"mfojtik","id":44136,"avatar_url":"https://avatars.githubusercontent.com/u/44136?v=3","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mfojtik/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":true,"url":"https://api.github.com/repos/mfojtik/origin","forks_url":"https://api.github.com/repos/mfojtik/origin/forks","keys_url":"https://api.github.com/repos/mfojtik/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mfojtik/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mfojtik/origin/teams","hooks_url":"https://api.github.com/repos/mfojtik/origin/hooks","issue_events_url":"https://api.github.com/repos/mfojtik/origin/issues/events{/number}","events_url":"https://api.github.com/repos/mfojtik/origin/events","assignees_url":"https://api.github.com/repos/mfojtik/origin/assignees{/user}","branches_url":"https://api.github.com/repos/mfojtik/origin/branches{/branch}","tags_url":"https://api.github.com/repos/mfojtik/origin/tags","blobs_url":"https://api.github.com/repos/mfojtik/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mfojtik/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mfojtik/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/mfojtik/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mfojtik/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/mfojtik/origin/languages","stargazers_url":"https://api.github.com/repos/mfojtik/origin/stargazers","contributors_url":"https://api.github.com/repos/mfojtik/origin/contributors","subscribers_url":"https://api.github.com/repos/mfojtik/origin/subscribers","subscription_url":"https://api.github.com/repos/mfojtik/origin/subscription","commits_url":"https://api.github.com/repos/mfojtik/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/mfojtik/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/mfojtik/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/mfojtik/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/mfojtik/origin/contents/{+path}","compare_url":"https://api.github.com/repos/mfojtik/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mfojtik/origin/merges","archive_url":"https://api.github.com/repos/mfojtik/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mfojtik/origin/downloads","issues_url":"https://api.github.com/repos/mfojtik/origin/issues{/number}","pulls_url":"https://api.github.com/repos/mfojtik/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/mfojtik/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/mfojtik/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mfojtik/origin/labels{/name}","releases_url":"https://api.github.com/repos/mfojtik/origin/releases{/id}","created_at":"2014-08-14T13:11:47Z","updated_at":"2015-05-07T09:05:06Z","pushed_at":"2015-08-05T18:44:01Z","git_url":"git://github.com/mfojtik/origin.git","ssh_url":"git@github.com:mfojtik/origin.git","clone_url":"https://github.com/mfojtik/origin.git","svn_url":"https://github.com/mfojtik/origin","homepage":"https://openshift.github.io","size":124738,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"786896fe77232f1db9f460abadb740a7a3323b66","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":22442668,"name":"origin","full_name":"openshift/origin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":false,"url":"https://api.github.com/repos/openshift/origin","forks_url":"https://api.github.com/repos/openshift/origin/forks","keys_url":"https://api.github.com/repos/openshift/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin/teams","hooks_url":"https://api.github.com/repos/openshift/origin/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin/events","assignees_url":"https://api.github.com/repos/openshift/origin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin/tags","blobs_url":"https://api.github.com/repos/openshift/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin/languages","stargazers_url":"https://api.github.com/repos/openshift/origin/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin/subscription","commits_url":"https://api.github.com/repos/openshift/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin/merges","archive_url":"https://api.github.com/repos/openshift/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin/downloads","issues_url":"https://api.github.com/repos/openshift/origin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin/releases{/id}","created_at":"2014-07-30T20:04:05Z","updated_at":"2015-08-05T15:43:44Z","pushed_at":"2015-08-06T03:29:14Z","git_url":"git://github.com/openshift/origin.git","ssh_url":"git@github.com:openshift/origin.git","clone_url":"https://github.com/openshift/origin.git","svn_url":"https://github.com/openshift/origin","homepage":"http://www.openshift.org","size":198207,"stargazers_count":601,"watchers_count":601,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":339,"mirror_url":null,"open_issues_count":476,"forks":339,"open_issues":476,"watchers":601,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/4016"},"html":{"href":"https://github.com/openshift/origin/pull/4016"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/4016"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/4016/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/4016/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/4016/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/2f0b078aec5d3fba146e6c466a08809e907a7fac"}}}}