{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/openshift-docs/pulls/comments/56402557","id":56402557,"diff_hunk":"@@ -846,20 +846,28 @@ source:\n \n == Binary Source\n \n-When the `*BuildConfig.spec.source.type*` is `*Binary*`, the build will expect a\n-binary as input, and an inline Dockerfile is optional.\n-\n-The binary is generally assumed to be a tar, gzipped tar, or zip file depending\n-on the strategy. For `*Docker*` builds, this is the build context and an\n-optional Dockerfile may be specified to override any Dockerfile in the build\n-context. For `*Source*` builds, this is assumed to be an archive as described\n-above. For `*Source*` and `*Docker*` builds, if `*binary.asFile*` is set the\n-build context will consist of a single file named by the value of `*binary.asFile*`. \n-The `*contextDir*` field may be used when an archive is provided. Custom builds will \n-receive this binary as input on standard input (`stdin`).\n-\n-A binary source potentially extracts content (if `*asFile*` is not set), in which case `*contextDir*`\n-allows changing to a subdirectory within the content before the build executes.\n+When the `*BuildConfig.spec.source.type*` is `*Binary*`, the source content will be sent\n+as input to the build via a binary stream and  `oc start-build` should be executed with either\n+the `--from-dir`, `--from-file`, or `--from-repo` options.\n+\n+The binary stream will be processed in one of two ways:\n+\n+1) If `*binary.asFile*` is set, then the bytes from the binary stream will be considered a single file.  The binary\n+stream will be stored in a file on the builder's file system with the name as specified as `*binary.asFile*` for the builder to use. ","path":"dev_guide/builds.adoc","position":25,"original_position":25,"commit_id":"fb6cb558ed091be7c10e28aad72807d9f922b98f","original_commit_id":"609082dc911b9d4786c253c165a3ce6388398338","user":{"login":"gabemontero","id":3594868,"avatar_url":"https://avatars.githubusercontent.com/u/3594868?v=3","gravatar_id":"","url":"https://api.github.com/users/gabemontero","html_url":"https://github.com/gabemontero","followers_url":"https://api.github.com/users/gabemontero/followers","following_url":"https://api.github.com/users/gabemontero/following{/other_user}","gists_url":"https://api.github.com/users/gabemontero/gists{/gist_id}","starred_url":"https://api.github.com/users/gabemontero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabemontero/subscriptions","organizations_url":"https://api.github.com/users/gabemontero/orgs","repos_url":"https://api.github.com/users/gabemontero/repos","events_url":"https://api.github.com/users/gabemontero/events{/privacy}","received_events_url":"https://api.github.com/users/gabemontero/received_events","type":"User","site_admin":false},"body":"OK ... I thought I would look at some of the tests to confirm the interpretation of the behavior.\r\n\r\nI found https://github.com/openshift/origin/blob/master/test/extended/builds/start.go#L85-L146\r\n\r\nTurns out, you can use --from-dir/from-file/from-repo even when you do *NOT* have a binary source type in the BC.  Circling back and going through the `oc start-build` code path, using --from* results in a BinaryBuildRequest, and by the time it lands on the receiving side, that object is translated into a BinaryBuildSource (a la the source type Binary) ... so the --from* options are a dynamic way to turn on binary builds.\r\n\r\nSo I wondered about the source.type field in general, and discovered that it is removed in https://github.com/openshift/origin/blob/master/pkg/build/api/types.go, but still exists in the older v1 version, https://github.com/openshift/origin/blob/master/pkg/build/api/v1/types.go.\r\n\r\nSo I revisited https://github.com/openshift/origin/blob/master/pkg/build/builder/source.go#L44-L101, and sure enough, it in fact checks all the different *types* (binary, git, image, dockerfile) and essentially will overlay them from binary, to git, to images, to dockerfile as part of retrieving the *source*.\r\n\r\nSo  this implies to me that post v1, you can have multiple source types in a build config (if true, and if that was well known, it has previously escaped my awareness).\r\n\r\nSo ... my updated take on the net for the doc:\r\n0) not with this PR, but if the removal of build.source.type becomes the next version (and is consumed by etcd I suppose), we have references to type that need to be removed.\r\n1) If type binary.asFile is specified in the build config, and none of the --from* options are used with start-build, then that file must exist in the builder image\r\n2) Otherwise, --from-file must be specified on the start-build, and the data comes over stdin\r\n3) a binary build type without an as-file (that field is marked omitemtpy), and without the start-build having a --from* option, means either the source is already baked in the builder image (is that at all an interesting scenario ??), or it is totally not useful.\r\n4) so there is essentially a matrix of behavior permutations with the bc source.binary obj and the `oc start-build --from-*` options ... \r\n\r\nI'll go ahead and start updating the PR based on my above interpretation, but of course will adjust as further responses occur.","created_at":"2016-03-16T19:49:56Z","updated_at":"2016-03-16T19:49:56Z","html_url":"https://github.com/openshift/openshift-docs/pull/1745#discussion_r56402557","pull_request_url":"https://api.github.com/repos/openshift/openshift-docs/pulls/1745","_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/comments/56402557"},"html":{"href":"https://github.com/openshift/openshift-docs/pull/1745#discussion_r56402557"},"pull_request":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/1745"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/openshift-docs/pulls/1745","id":62948381,"html_url":"https://github.com/openshift/openshift-docs/pull/1745","diff_url":"https://github.com/openshift/openshift-docs/pull/1745.diff","patch_url":"https://github.com/openshift/openshift-docs/pull/1745.patch","issue_url":"https://api.github.com/repos/openshift/openshift-docs/issues/1745","number":1745,"state":"open","locked":false,"title":"update binary build doc","user":{"login":"gabemontero","id":3594868,"avatar_url":"https://avatars.githubusercontent.com/u/3594868?v=3","gravatar_id":"","url":"https://api.github.com/users/gabemontero","html_url":"https://github.com/gabemontero","followers_url":"https://api.github.com/users/gabemontero/followers","following_url":"https://api.github.com/users/gabemontero/following{/other_user}","gists_url":"https://api.github.com/users/gabemontero/gists{/gist_id}","starred_url":"https://api.github.com/users/gabemontero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabemontero/subscriptions","organizations_url":"https://api.github.com/users/gabemontero/orgs","repos_url":"https://api.github.com/users/gabemontero/repos","events_url":"https://api.github.com/users/gabemontero/events{/privacy}","received_events_url":"https://api.github.com/users/gabemontero/received_events","type":"User","site_admin":false},"body":"@bparees @rhcarvalho @mfojtik @csrwng PTAL\r\n\r\nNote, I tried to cross reference the document with what I saw in the code, in particular https://github.com/openshift/origin/blob/master/pkg/build/builder/source.go#L44-L101\r\n\r\nAs such, it seemed like dockerfile's could be used even if asFile was set.  That is counter to what I at least interpreted the prior version of the documentation implying.  So let's confirm/deny that along with assessing the changes' attempt to make things clearer.","created_at":"2016-03-15T17:48:10Z","updated_at":"2016-03-16T19:49:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7f82f2eb06a6b66a1f87b9c7c53b4d2c98a988b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/openshift-docs/pulls/1745/commits","review_comments_url":"https://api.github.com/repos/openshift/openshift-docs/pulls/1745/comments","review_comment_url":"https://api.github.com/repos/openshift/openshift-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/openshift-docs/issues/1745/comments","statuses_url":"https://api.github.com/repos/openshift/openshift-docs/statuses/fb6cb558ed091be7c10e28aad72807d9f922b98f","head":{"label":"gabemontero:binBld","ref":"binBld","sha":"fb6cb558ed091be7c10e28aad72807d9f922b98f","user":{"login":"gabemontero","id":3594868,"avatar_url":"https://avatars.githubusercontent.com/u/3594868?v=3","gravatar_id":"","url":"https://api.github.com/users/gabemontero","html_url":"https://github.com/gabemontero","followers_url":"https://api.github.com/users/gabemontero/followers","following_url":"https://api.github.com/users/gabemontero/following{/other_user}","gists_url":"https://api.github.com/users/gabemontero/gists{/gist_id}","starred_url":"https://api.github.com/users/gabemontero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabemontero/subscriptions","organizations_url":"https://api.github.com/users/gabemontero/orgs","repos_url":"https://api.github.com/users/gabemontero/repos","events_url":"https://api.github.com/users/gabemontero/events{/privacy}","received_events_url":"https://api.github.com/users/gabemontero/received_events","type":"User","site_admin":false},"repo":{"id":38077544,"name":"openshift-docs","full_name":"gabemontero/openshift-docs","owner":{"login":"gabemontero","id":3594868,"avatar_url":"https://avatars.githubusercontent.com/u/3594868?v=3","gravatar_id":"","url":"https://api.github.com/users/gabemontero","html_url":"https://github.com/gabemontero","followers_url":"https://api.github.com/users/gabemontero/followers","following_url":"https://api.github.com/users/gabemontero/following{/other_user}","gists_url":"https://api.github.com/users/gabemontero/gists{/gist_id}","starred_url":"https://api.github.com/users/gabemontero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabemontero/subscriptions","organizations_url":"https://api.github.com/users/gabemontero/orgs","repos_url":"https://api.github.com/users/gabemontero/repos","events_url":"https://api.github.com/users/gabemontero/events{/privacy}","received_events_url":"https://api.github.com/users/gabemontero/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gabemontero/openshift-docs","description":"OpenShift Documentation","fork":true,"url":"https://api.github.com/repos/gabemontero/openshift-docs","forks_url":"https://api.github.com/repos/gabemontero/openshift-docs/forks","keys_url":"https://api.github.com/repos/gabemontero/openshift-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gabemontero/openshift-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gabemontero/openshift-docs/teams","hooks_url":"https://api.github.com/repos/gabemontero/openshift-docs/hooks","issue_events_url":"https://api.github.com/repos/gabemontero/openshift-docs/issues/events{/number}","events_url":"https://api.github.com/repos/gabemontero/openshift-docs/events","assignees_url":"https://api.github.com/repos/gabemontero/openshift-docs/assignees{/user}","branches_url":"https://api.github.com/repos/gabemontero/openshift-docs/branches{/branch}","tags_url":"https://api.github.com/repos/gabemontero/openshift-docs/tags","blobs_url":"https://api.github.com/repos/gabemontero/openshift-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gabemontero/openshift-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gabemontero/openshift-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/gabemontero/openshift-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gabemontero/openshift-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/gabemontero/openshift-docs/languages","stargazers_url":"https://api.github.com/repos/gabemontero/openshift-docs/stargazers","contributors_url":"https://api.github.com/repos/gabemontero/openshift-docs/contributors","subscribers_url":"https://api.github.com/repos/gabemontero/openshift-docs/subscribers","subscription_url":"https://api.github.com/repos/gabemontero/openshift-docs/subscription","commits_url":"https://api.github.com/repos/gabemontero/openshift-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/gabemontero/openshift-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/gabemontero/openshift-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/gabemontero/openshift-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/gabemontero/openshift-docs/contents/{+path}","compare_url":"https://api.github.com/repos/gabemontero/openshift-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gabemontero/openshift-docs/merges","archive_url":"https://api.github.com/repos/gabemontero/openshift-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gabemontero/openshift-docs/downloads","issues_url":"https://api.github.com/repos/gabemontero/openshift-docs/issues{/number}","pulls_url":"https://api.github.com/repos/gabemontero/openshift-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/gabemontero/openshift-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/gabemontero/openshift-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gabemontero/openshift-docs/labels{/name}","releases_url":"https://api.github.com/repos/gabemontero/openshift-docs/releases{/id}","deployments_url":"https://api.github.com/repos/gabemontero/openshift-docs/deployments","created_at":"2015-06-25T22:21:52Z","updated_at":"2016-01-15T15:32:21Z","pushed_at":"2016-03-15T19:03:08Z","git_url":"git://github.com/gabemontero/openshift-docs.git","ssh_url":"git@github.com:gabemontero/openshift-docs.git","clone_url":"https://github.com/gabemontero/openshift-docs.git","svn_url":"https://github.com/gabemontero/openshift-docs","homepage":null,"size":8023,"stargazers_count":0,"watchers_count":0,"language":"CSS","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":"438985d81f3d989e8cafa0040cb0865b236bcf19","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":21740844,"name":"openshift-docs","full_name":"openshift/openshift-docs","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/openshift-docs","description":"OpenShift Documentation","fork":false,"url":"https://api.github.com/repos/openshift/openshift-docs","forks_url":"https://api.github.com/repos/openshift/openshift-docs/forks","keys_url":"https://api.github.com/repos/openshift/openshift-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/openshift-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/openshift-docs/teams","hooks_url":"https://api.github.com/repos/openshift/openshift-docs/hooks","issue_events_url":"https://api.github.com/repos/openshift/openshift-docs/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/openshift-docs/events","assignees_url":"https://api.github.com/repos/openshift/openshift-docs/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/openshift-docs/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/openshift-docs/tags","blobs_url":"https://api.github.com/repos/openshift/openshift-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/openshift-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/openshift-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/openshift-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/openshift-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/openshift-docs/languages","stargazers_url":"https://api.github.com/repos/openshift/openshift-docs/stargazers","contributors_url":"https://api.github.com/repos/openshift/openshift-docs/contributors","subscribers_url":"https://api.github.com/repos/openshift/openshift-docs/subscribers","subscription_url":"https://api.github.com/repos/openshift/openshift-docs/subscription","commits_url":"https://api.github.com/repos/openshift/openshift-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/openshift-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/openshift-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/openshift-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/openshift-docs/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/openshift-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/openshift-docs/merges","archive_url":"https://api.github.com/repos/openshift/openshift-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/openshift-docs/downloads","issues_url":"https://api.github.com/repos/openshift/openshift-docs/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/openshift-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/openshift-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/openshift-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/openshift-docs/labels{/name}","releases_url":"https://api.github.com/repos/openshift/openshift-docs/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/openshift-docs/deployments","created_at":"2014-07-11T15:14:42Z","updated_at":"2016-03-14T14:05:03Z","pushed_at":"2016-03-16T18:57:32Z","git_url":"git://github.com/openshift/openshift-docs.git","ssh_url":"git@github.com:openshift/openshift-docs.git","clone_url":"https://github.com/openshift/openshift-docs.git","svn_url":"https://github.com/openshift/openshift-docs","homepage":"https://docs.openshift.org/latest/welcome/index.html","size":11878,"stargazers_count":43,"watchers_count":43,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":186,"mirror_url":null,"open_issues_count":127,"forks":186,"open_issues":127,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/1745"},"html":{"href":"https://github.com/openshift/openshift-docs/pull/1745"},"issue":{"href":"https://api.github.com/repos/openshift/openshift-docs/issues/1745"},"comments":{"href":"https://api.github.com/repos/openshift/openshift-docs/issues/1745/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/1745/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/1745/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/openshift-docs/statuses/fb6cb558ed091be7c10e28aad72807d9f922b98f"}}}}