{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/source-to-image/pulls/comments/66623938","id":66623938,"diff_hunk":"@@ -196,6 +205,15 @@ func (builder *STI) Prepare(config *api.Config) error {\n \t\tWorkingDir: config.WorkingDir,\n \t}\n \n+\tif len(config.RuntimeImage) > 0 {\n+\t\t// For pulling RuntimeImage currently we're using the same PullPolicy as for BuilderImage\n+\t\t_, err := dockerpkg.PullImage(config.RuntimeImage, builder.docker, config.BuilderPullPolicy, false)","path":"pkg/build/strategies/sti/sti.go","position":69,"original_position":24,"commit_id":"de53cfe2b155ff3b78b1c167bc317b1239015193","original_commit_id":"dff56585e81f0c823d2ce4efa38882e9c6060c6a","user":{"login":"php-coder","id":87088,"avatar_url":"https://avatars.githubusercontent.com/u/87088?v=3","gravatar_id":"","url":"https://api.github.com/users/php-coder","html_url":"https://github.com/php-coder","followers_url":"https://api.github.com/users/php-coder/followers","following_url":"https://api.github.com/users/php-coder/following{/other_user}","gists_url":"https://api.github.com/users/php-coder/gists{/gist_id}","starred_url":"https://api.github.com/users/php-coder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-coder/subscriptions","organizations_url":"https://api.github.com/users/php-coder/orgs","repos_url":"https://api.github.com/users/php-coder/repos","events_url":"https://api.github.com/users/php-coder/events{/privacy}","received_events_url":"https://api.github.com/users/php-coder/received_events","type":"User","site_admin":false},"body":"@wanghaoran1988 @bparees It's interesting idea but\r\n1) I like the fail-fast approach\r\n2) it looks very logical (at lest for me) to pull the image in `Prepare()` method\r\n3) anyway you still have to pull the image. I wouldn't add async pull because it makes code less obvious but it will cover only this rare case (IMHO)\r\n\r\n> i'll leave it up to @php-coder whether he thinks it would be too complicated to add that flow right now, it's definitely not a requirement\r\n\r\nWe can postpone it and implement later on demand.","created_at":"2016-06-10T14:37:15Z","updated_at":"2016-06-10T14:37:15Z","html_url":"https://github.com/openshift/source-to-image/pull/505#discussion_r66623938","pull_request_url":"https://api.github.com/repos/openshift/source-to-image/pulls/505","_links":{"self":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/comments/66623938"},"html":{"href":"https://github.com/openshift/source-to-image/pull/505#discussion_r66623938"},"pull_request":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/505"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/source-to-image/pulls/505","id":70877764,"html_url":"https://github.com/openshift/source-to-image/pull/505","diff_url":"https://github.com/openshift/source-to-image/pull/505.diff","patch_url":"https://github.com/openshift/source-to-image/pull/505.patch","issue_url":"https://api.github.com/repos/openshift/source-to-image/issues/505","number":505,"state":"open","locked":false,"title":"[WIP] Extended build","user":{"login":"php-coder","id":87088,"avatar_url":"https://avatars.githubusercontent.com/u/87088?v=3","gravatar_id":"","url":"https://api.github.com/users/php-coder","html_url":"https://github.com/php-coder","followers_url":"https://api.github.com/users/php-coder/followers","following_url":"https://api.github.com/users/php-coder/following{/other_user}","gists_url":"https://api.github.com/users/php-coder/gists{/gist_id}","starred_url":"https://api.github.com/users/php-coder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-coder/subscriptions","organizations_url":"https://api.github.com/users/php-coder/orgs","repos_url":"https://api.github.com/users/php-coder/repos","events_url":"https://api.github.com/users/php-coder/events{/privacy}","received_events_url":"https://api.github.com/users/php-coder/received_events","type":"User","site_admin":false},"body":"This is a second **working draft** for the extended build.\r\n\r\nWhen we're specifying the `--runtime-image` and `--runtime-artifact` options, s2i:\r\n- runs builder container and does a build as usual\r\n- commits builder container (only when it's also increment build)\r\n- downloads artifacts (that were specified by `--runtime-artifact`) from the builder container and places them to a directory\r\n- runs another container with runtime image\r\n- uploads directory with artifacts into runtime image\r\n- commits container with runtime image\r\n\r\nExample:\r\n```console\r\n$ cat .s2i/bin/assemble \r\n#!/bin/bash\r\nset -eu\r\necho \"It works!\" >/tmp/i-am-runtime-artifact1.txt\r\nchmod 666 /tmp/i-am-runtime-artifact1.txt\r\necho \"It works!\" >/tmp/.i-am-runtime-artifact3.txt\r\nchmod 600 /tmp/.i-am-runtime-artifact3.txt\r\ncd /tmp\r\nln -s i-am-runtime-artifact1.txt i-am-runtime-artifact2\r\nprintf '#!/bin/bash\\necho \"I am $0!\"\\n' >/tmp/run-me\r\nchmod 755 /tmp/run-me\r\nmkdir -p /tmp/data-dir/2\r\ntouch /tmp/data-dir/1\r\ntouch /tmp/data-dir/2/3\r\n\r\n$ cat .s2i/bin/run \r\n#!/bin/bash\r\nset -eu\r\n/opt/jboss/run-me\r\n\r\n$ s2i build . openshift/wildfly-100-centos7 my-app --runtime-image jboss/base-jdk:8 --copy --assemble-user=1000 -a /tmp/i-am-runtime-artifact1.txt:app -a /tmp/i-am-runtime-artifact2:app -a /tmp/.i-am-runtime-artifact3.txt:app -a /tmp/run-me -a /tmp/data-dir \r\nI0609 16:32:54.265880 07786 install.go:251] Using \"assemble\" installed from \"<source-dir>/.s2i/bin/assemble\"\r\nI0609 16:32:54.267026 07786 install.go:251] Using \"run\" installed from \"<source-dir>/.s2i/bin/run\"\r\nI0609 16:32:54.267412 07786 install.go:251] Using \"save-artifacts\" installed from \"image:///usr/libexec/s2i/save-artifacts\"\r\n\r\n$ docker images | head -2\r\nREPOSITORY                                           TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\r\nmy-app                                               latest              6ee5b5f789a7        10 seconds ago      464 MB\r\n\r\n$ docker run my-app\r\nI am /opt/jboss/run-me!\r\n\r\n$ docker run my-app find -ls\r\n16786700    0 drwxr-xr-x   4 jboss    jboss         114 Jun  9 16:32 .\r\n16826729    0 drwxr-xr-x   2 root     root          105 Jun  9 16:32 ./app\r\n16826730    4 -rw-r--r--   1 root     root           10 Jun  9 16:32 ./app/.i-am-runtime-artifact3.txt\r\n16826731    4 -rw-r--r--   1 root     root           10 Jun  9 16:32 ./app/i-am-runtime-artifact1.txt\r\n16826732    0 lrwxrwxrwx   1 root     root           26 Jun  9 16:32 ./app/i-am-runtime-artifact2 -> i-am-runtime-artifact1.txt\r\n33577783    0 drwxr-xr-x   3 root     root           24 Jun  9 16:32 ./data-dir\r\n33577784    0 -rw-r--r--   1 root     root            0 Jun  9 16:32 ./data-dir/1\r\n50342331    0 drwxr-xr-x   2 root     root           15 Jun  9 16:32 ./data-dir/2\r\n50342332    0 -rw-r--r--   1 root     root            0 Jun  9 16:32 ./data-dir/2/3\r\n16826733    4 -rwxr-xr-x   1 root     root           38 Jun  9 16:32 ./run\r\n16826734    4 -rwxr-xr-x   1 root     root           28 Jun  9 16:32 ./run-me\r\n\r\n$ docker inspect my-app\r\n...\r\n    \"Config\": {\r\n        \"Hostname\": \"\",\r\n        \"Domainname\": \"\",\r\n        \"User\": \"jboss\",\r\n        \"AttachStdin\": false,\r\n        \"AttachStdout\": false,\r\n        \"AttachStderr\": false,\r\n        \"Tty\": false,\r\n        \"OpenStdin\": false,\r\n        \"StdinOnce\": false,\r\n        \"Env\": [\r\n            \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\r\n            \"JAVA_HOME=/usr/lib/jvm/java\"\r\n        ],\r\n        \"Cmd\": [\r\n            \"/opt/jboss/run\"\r\n        ],\r\n        \"Image\": \"\",\r\n        \"Volumes\": null,\r\n        \"WorkingDir\": \"/opt/jboss\",\r\n        \"Entrypoint\": null,\r\n        \"OnBuild\": null,\r\n        \"Labels\": {\r\n            \"build-date\": \"2016-03-31\",\r\n            \"io.k8s.display-name\": \"my-app\",\r\n            \"io.openshift.s2i.build.image\": \"openshift/wildfly-100-centos7\",\r\n            \"io.openshift.s2i.build.source-location\": \"/data/src/github.com/openshift/source-to-image/mystamps\",\r\n            \"license\": \"GPLv2\",\r\n            \"name\": \"CentOS Base Image\",\r\n            \"vendor\": \"CentOS\"\r\n        }\r\n    },\r\n...\r\n```\r\n\r\nTrello card: https://trello.com/c/MWUAjl6k/237-13-extended-builds-separate-mvn-vs-jboss-evg\r\n\r\nPTAL @bparees @mfojtik \r\nCC @PI-Victor @rhcarvalho \r\n\r\nTODO:\r\n- [ ] show runtime image version in describer\r\n- [ ] add unit tests (?)\r\n- [ ] add integration tests\r\n- [ ] document (`docs/cli.md`: mention new options, `README.md: describe mechanics)\r\n- [ ] add documentation (describe mechanics, empty files with build secrets are gone, re-use auth for pulling the image, same env as for builder)\r\n","created_at":"2016-05-20T15:55:43Z","updated_at":"2016-06-10T14:37:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b53a9b76ecdd4378b94b947d68b3047ea5424aad","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/source-to-image/pulls/505/commits","review_comments_url":"https://api.github.com/repos/openshift/source-to-image/pulls/505/comments","review_comment_url":"https://api.github.com/repos/openshift/source-to-image/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/source-to-image/issues/505/comments","statuses_url":"https://api.github.com/repos/openshift/source-to-image/statuses/de53cfe2b155ff3b78b1c167bc317b1239015193","head":{"label":"php-coder:extended_build","ref":"extended_build","sha":"de53cfe2b155ff3b78b1c167bc317b1239015193","user":{"login":"php-coder","id":87088,"avatar_url":"https://avatars.githubusercontent.com/u/87088?v=3","gravatar_id":"","url":"https://api.github.com/users/php-coder","html_url":"https://github.com/php-coder","followers_url":"https://api.github.com/users/php-coder/followers","following_url":"https://api.github.com/users/php-coder/following{/other_user}","gists_url":"https://api.github.com/users/php-coder/gists{/gist_id}","starred_url":"https://api.github.com/users/php-coder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-coder/subscriptions","organizations_url":"https://api.github.com/users/php-coder/orgs","repos_url":"https://api.github.com/users/php-coder/repos","events_url":"https://api.github.com/users/php-coder/events{/privacy}","received_events_url":"https://api.github.com/users/php-coder/received_events","type":"User","site_admin":false},"repo":{"id":44105909,"name":"source-to-image","full_name":"php-coder/source-to-image","owner":{"login":"php-coder","id":87088,"avatar_url":"https://avatars.githubusercontent.com/u/87088?v=3","gravatar_id":"","url":"https://api.github.com/users/php-coder","html_url":"https://github.com/php-coder","followers_url":"https://api.github.com/users/php-coder/followers","following_url":"https://api.github.com/users/php-coder/following{/other_user}","gists_url":"https://api.github.com/users/php-coder/gists{/gist_id}","starred_url":"https://api.github.com/users/php-coder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-coder/subscriptions","organizations_url":"https://api.github.com/users/php-coder/orgs","repos_url":"https://api.github.com/users/php-coder/repos","events_url":"https://api.github.com/users/php-coder/events{/privacy}","received_events_url":"https://api.github.com/users/php-coder/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/php-coder/source-to-image","description":"A tool for building/building artifacts from source and injecting into docker images","fork":true,"url":"https://api.github.com/repos/php-coder/source-to-image","forks_url":"https://api.github.com/repos/php-coder/source-to-image/forks","keys_url":"https://api.github.com/repos/php-coder/source-to-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php-coder/source-to-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php-coder/source-to-image/teams","hooks_url":"https://api.github.com/repos/php-coder/source-to-image/hooks","issue_events_url":"https://api.github.com/repos/php-coder/source-to-image/issues/events{/number}","events_url":"https://api.github.com/repos/php-coder/source-to-image/events","assignees_url":"https://api.github.com/repos/php-coder/source-to-image/assignees{/user}","branches_url":"https://api.github.com/repos/php-coder/source-to-image/branches{/branch}","tags_url":"https://api.github.com/repos/php-coder/source-to-image/tags","blobs_url":"https://api.github.com/repos/php-coder/source-to-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php-coder/source-to-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php-coder/source-to-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/php-coder/source-to-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php-coder/source-to-image/statuses/{sha}","languages_url":"https://api.github.com/repos/php-coder/source-to-image/languages","stargazers_url":"https://api.github.com/repos/php-coder/source-to-image/stargazers","contributors_url":"https://api.github.com/repos/php-coder/source-to-image/contributors","subscribers_url":"https://api.github.com/repos/php-coder/source-to-image/subscribers","subscription_url":"https://api.github.com/repos/php-coder/source-to-image/subscription","commits_url":"https://api.github.com/repos/php-coder/source-to-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/php-coder/source-to-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/php-coder/source-to-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/php-coder/source-to-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/php-coder/source-to-image/contents/{+path}","compare_url":"https://api.github.com/repos/php-coder/source-to-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php-coder/source-to-image/merges","archive_url":"https://api.github.com/repos/php-coder/source-to-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php-coder/source-to-image/downloads","issues_url":"https://api.github.com/repos/php-coder/source-to-image/issues{/number}","pulls_url":"https://api.github.com/repos/php-coder/source-to-image/pulls{/number}","milestones_url":"https://api.github.com/repos/php-coder/source-to-image/milestones{/number}","notifications_url":"https://api.github.com/repos/php-coder/source-to-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php-coder/source-to-image/labels{/name}","releases_url":"https://api.github.com/repos/php-coder/source-to-image/releases{/id}","deployments_url":"https://api.github.com/repos/php-coder/source-to-image/deployments","created_at":"2015-10-12T12:26:17Z","updated_at":"2016-01-26T11:32:12Z","pushed_at":"2016-06-09T16:50:20Z","git_url":"git://github.com/php-coder/source-to-image.git","ssh_url":"git@github.com:php-coder/source-to-image.git","clone_url":"https://github.com/php-coder/source-to-image.git","svn_url":"https://github.com/php-coder/source-to-image","homepage":"","size":2543,"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":"41e42f9b75b27f2437e2abe9400ce980f58a9743","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":16323162,"name":"source-to-image","full_name":"openshift/source-to-image","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/source-to-image","description":"A tool for building/building artifacts from source and injecting into docker images","fork":false,"url":"https://api.github.com/repos/openshift/source-to-image","forks_url":"https://api.github.com/repos/openshift/source-to-image/forks","keys_url":"https://api.github.com/repos/openshift/source-to-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/source-to-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/source-to-image/teams","hooks_url":"https://api.github.com/repos/openshift/source-to-image/hooks","issue_events_url":"https://api.github.com/repos/openshift/source-to-image/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/source-to-image/events","assignees_url":"https://api.github.com/repos/openshift/source-to-image/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/source-to-image/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/source-to-image/tags","blobs_url":"https://api.github.com/repos/openshift/source-to-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/source-to-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/source-to-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/source-to-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/source-to-image/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/source-to-image/languages","stargazers_url":"https://api.github.com/repos/openshift/source-to-image/stargazers","contributors_url":"https://api.github.com/repos/openshift/source-to-image/contributors","subscribers_url":"https://api.github.com/repos/openshift/source-to-image/subscribers","subscription_url":"https://api.github.com/repos/openshift/source-to-image/subscription","commits_url":"https://api.github.com/repos/openshift/source-to-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/source-to-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/source-to-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/source-to-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/source-to-image/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/source-to-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/source-to-image/merges","archive_url":"https://api.github.com/repos/openshift/source-to-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/source-to-image/downloads","issues_url":"https://api.github.com/repos/openshift/source-to-image/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/source-to-image/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/source-to-image/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/source-to-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/source-to-image/labels{/name}","releases_url":"https://api.github.com/repos/openshift/source-to-image/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/source-to-image/deployments","created_at":"2014-01-28T19:32:40Z","updated_at":"2016-06-09T21:34:26Z","pushed_at":"2016-06-09T16:50:20Z","git_url":"git://github.com/openshift/source-to-image.git","ssh_url":"git@github.com:openshift/source-to-image.git","clone_url":"https://github.com/openshift/source-to-image.git","svn_url":"https://github.com/openshift/source-to-image","homepage":"","size":2566,"stargazers_count":240,"watchers_count":240,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":118,"mirror_url":null,"open_issues_count":19,"forks":118,"open_issues":19,"watchers":240,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/505"},"html":{"href":"https://github.com/openshift/source-to-image/pull/505"},"issue":{"href":"https://api.github.com/repos/openshift/source-to-image/issues/505"},"comments":{"href":"https://api.github.com/repos/openshift/source-to-image/issues/505/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/505/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/505/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/source-to-image/statuses/de53cfe2b155ff3b78b1c167bc317b1239015193"}}}}
{"actor":{"display_login":"php-coder"}}