Repository navigation
Support osc new-app from stored template - #1716
Conversation
49d347a to
ad9ff65
Compare
There was a problem hiding this comment.
@smarterclayton I wasn't sure about the correct strategy here:
- Break down the template and handle each of its objects as one individual pipeline here in
buildPipelines. I think this is the right approach, but I will need to figure out how to handle Services, Routes, etc. - Break down the template before, maybe in
validateand make each separate object aComponentInput(I think it's wrong). - Handle the Template as one single pipeline element returned by
buildPipelinesand break it down later.
Thoughts?
There was a problem hiding this comment.
Can you describe a scenario where it would make sense for a reasonably complex template to be paired with the input of other components?
I.e.:
# mysql-cluster is a template
$ osc new-app php~somegitrepo mysql-cluster
# no overlap between components
# mysql-cluster is a template, mysql is an image
$ osc new-app mysql-cluster mysql
# doesn't seem like the two should overlap, but they might conflict on their service name
The only case I can think of is when you have a template and a git repo:
# eap is a template with a build config
$ osc new-app <gitrepo> eap
In this case, the "eap" template would have to define a build config (or at least an input image) and we'd need to know to link those up. So EAP's pipeline might be mutated to take the git repo as input... but that seems like a special case.
If the user specifies a single template, I don't think we should be breaking out the pipelines. In the case above, it seems almost like a special case. I would say that it's possible that templates should be given a chance to absorb arguments prior to execution, but then are added after the pipelines are joined. Templates should probably be kept together as long as possible, but we should identify conflicts with the other arguments as soon as possible.
Honestly, at this point it might be better to disallow any mixing, and simply focus on getting the validation and checking behavior right.
----- Original Message -----
if ref.Input().ExpectToBuild { %q", ref, ref.Input().Uses)glog.V(2).Infof("will use %q as the base image for a source build ofinput, err := app.InputImageFromMatch(ref.Input().Match)if err != nil {return nil, fmt.Errorf("can't build %q: %v", ref.Input(), err)} app.StrategyAndSourceForRepository(ref.Input().Uses)strategy, source, err :=if err != nil {return nil, fmt.Errorf("can't build %q: %v", ref.Input(), err)} strategy, source); err != nil {if pipeline, err = app.NewBuildPipeline(ref.Input().String(), input,return nil, fmt.Errorf("can't build %q: %v", ref.Input(), err)// TODO template and other individual matches are mutually exclusive,// need to investigate the side-effects of having them togetherif ref.Input().Match.Template != nil {glog.V(2).Infof("will include objects from template %q", ref)@smarterclayton I wasn't sure about the correct strategy here:
- Break down the template and handle each of its objects as one individual
pipeline here inbuildPipelines. I think this is the right approach, but I
will need to figure out how to handle Services, Routes, etc.- Break down the template before, maybe in
validateand make each separate
object aComponentInput(I think it's wrong).- Handle the Template as one single pipeline element returned by
buildPipelinesand break it down later.Thoughts?
Reply to this email directly or view it on GitHub:
https://github.com/openshift/origin/pull/1716/files#r28283935
f70ea91 to
4f27b8f
Compare
4f27b8f to
435a450
Compare
|
This pull request adds the ability to create apps based on stored templates using Provided that you first run Create based in the ruby-helloworld-sample template (currently 8 objects and 5 parameters). Same, overriding 2 of the 8 parameters specified by the template: Different kinds of inputs can be mixed (templates, images, source code, etc); but at the moment the command does not accept templates with source code explicitly attached to it (e.g. |
|
@smarterclayton How does it sound (comment above)? We still could make it more restrictive (e.g. simply not allow templates and source to be provided together), but since it doesn't break in most scenarios other than eventual naming conflicts, I'm allowing multiple kinds of inputs to be provided together as long as they are not explicitly attached to templates through the use of |
|
[test] |
435a450 to
aa559f7
Compare
osc new-app from stored templateosc new-app from stored template
aa559f7 to
eb33d18
Compare
|
@csrwng please review |
0af79b8 to
1eaa3f0
Compare
|
@csrwng All comments addressed. I ended up not using the same flag name |
1eaa3f0 to
72479c5
Compare
|
Hold on merge of this until I have a chance to review tomorrow
|
72479c5 to
fde82d1
Compare
|
@smarterclayton ok, thanks. already accepted by QE. |
There was a problem hiding this comment.
you should not use my repo ;-) I managed to break people several times as I used it for my testing or testing features in STI :D
There was a problem hiding this comment.
It's a negative test (command will fail in validations), so the repo is there just for your own fame and profit. :)
There was a problem hiding this comment.
Actually we use it in osc help. We need a good ootb example we can use in the docs - what's a good one?
On Apr 17, 2015, at 10:52 AM, Michal Fojtik [email protected] wrote:
In hack/test-cmd.sh:
@@ -343,6 +343,16 @@ echo "imageRepositoryMappings: ok"
the local image repository takes precedence over the Docker Hub "mysql" image
[ "$(osc new-app mysql -o yaml | grep mysql-55-centos7)" ]
osc new-app php mysql
+# check if we can create from a stored template
+osc create -f examples/sample-app/application-template-stibuild.json
+osc get template ruby-helloworld-sample
+[ "$(osc new-app ruby-helloworld-sample -o yaml | grep MYSQL_USER)" ]
+[ "$(osc new-app ruby-helloworld-sample -o yaml | grep MYSQL_PASSWORD)" ]
+[ "$(osc new-app ruby-helloworld-sample -o yaml | grep ADMIN_USERNAME)" ]
+[ "$(osc new-app ruby-helloworld-sample -o yaml | grep ADMIN_PASSWORD)" ]
+# create from template with code explicitly set is not supported
+[ ! "$(osc new-app ruby-helloworld-sample~[email protected]/mfojtik/sinatra-app-example)" ]—
Reply to this email directly or view it on GitHub.
fde82d1 to
79770ff
Compare
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_openshift3/1872/) |
There was a problem hiding this comment.
You need the Oxford comma (a, b, and c)
There was a problem hiding this comment.
These names are too long. --template should be used (and the output version should be renamed --output-template for this command, or for now, just dropped).
--stored-template-parameters is about 20 characters too long. I think this should be --param and -p
There was a problem hiding this comment.
Also "TemplateParameters", not "TemplatesParameters"
476bcd1 to
f816e47
Compare
|
@smarterclayton all comments addressed. |
|
One comment, then squash and I'll merge |
f816e47 to
887afed
Compare
887afed to
90451df
Compare
|
@smarterclayton fixed and squashed. |
|
LGTM [merge] |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_openshift3/1620/) (Image: devenv-fedora_1313) |
|
Evaluated for origin up to 90451df |
Merged by openshift-bot
…service-catalog/' changes from b69b4a6c80..b758460ba7 b758460ba7 origin build: modify hard coded path 871582f73a origin build: add origin tooling 9fa4e70 chart changes for v0.1.8 (openshift#1741) cada49c handle instance deletion that occurs during async provisioning or async update (openshift#1587) (openshift#1708) 3032f01 phony output binaries (openshift#1729) 0c98a72 remove last vestiges of glide (openshift#1696) 8435935 Prune vendor (openshift#1739) 0f657ec allow setting go version, clean up alignment 08af73f Disable test-dep target temporarily 41984a5 Check for existing bindings only for instances with DeprovisionStatus == ServiceInstanceDeprovisionStatusRequired. (openshift#1640) 706e555 chart changes for v0.1.7 (openshift#1721) 23644db we inconsistently rm thing with and without docker (openshift#1713) a38092d Chart changes for Release v0.1.6 (openshift#1718) 2fd4ecf Add PodPreset into settings api group (openshift#1694) bac68f4 update docs of developer's guide (openshift#1716) 3200b16 add integration test for proper async binding retry (openshift#1688) 6d809c3 Add custom columns to OpenAPI schema (openshift#1597) fcdefa6 Workaround spf13/viper stringarray bug (openshift#1700) ebbeb8c undo 6bad71d358ad3ad39eb8c003f5807cca1ec1d1e7 (openshift#1714) 1ee9659 Load all client auth plugins in the cli (openshift#1695) b9ad10d must run tests (openshift#1698) c621cdc add stages to Travis REVERT: b69b4a6c80 origin build: modify hard coded path REVERT: 527fac4d02 origin build: add origin tooling git-subtree-dir: cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog git-subtree-split: b758460ba7a45d370da9d5d634e71c16e9eb282a
No description provided.