-
Notifications
You must be signed in to change notification settings - Fork 177
Introduce CNAB core commands #443
Introduce CNAB core commands #443
Conversation
In future commits, the docker-app binary will be mutated as a frontend, and all the installation logic will be moved to the run binary. run comes with the 4 CNAB core commands: install/uninstall/status/upgrade. Adds github.com/deislabs/duffle as vendoring Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
c88673c
to
2340e2d
Compare
From CI:
|
[[override]] | ||
name = "github.com/deislabs/duffle" | ||
branch = "dockercon-version" | ||
source = "github.com/silvin-lubecki/duffle" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is missing from the duffle upstream exactly ? Can we list that and make appropriate PRs ?
4740985
to
c10d616
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really went quickly but question: what is cmd/run
package ? (doesn't seem to get imported) — or is in the invocation image ? (if yes, the name.. well.. I don't like it — cnap-run
or cnab-invoke
or …)
README.md
Outdated
merge Merge a multi-file application into a single file | ||
push Push the application to a registry | ||
render Render the Compose file for the application | ||
split Split a single-file application into multiple files | ||
status Get an application status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between inspect
and status
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inspect
is run on an at rest bundle, status
gives information about an installed application.
If this isn't clear, we should make sure the help makes it so.
if err := bndl.Validate(); err != nil { | ||
return err | ||
} | ||
h := duffleHome() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is room for extracting some code here in testable function 👼
880cb56
to
717b21b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just done to the end of the README thus far
Jenkinsfile.baguette
Outdated
echo "Releasing $TAG_NAME" | ||
dir('bin') { | ||
release('docker/app') | ||
parallel { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to parallelise the release? Might add complexity for cleaning up if things go wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jenkinsfile.baguette
Outdated
dir('src/github.com/docker/app') { | ||
checkout scm | ||
sh 'make -f docker.Makefile load-invocation-image' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must be sure to clean up the invocation image after each run.
@@ -6,7 +6,7 @@ An *experimental* utility to help make Compose files more reusable and sharable. | |||
|
|||
You can find some preview binaries of `docker-app` with CNAB support [here](https://github.com/docker/app/releases/tag/cnab-dockercon-preview). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must remember to remove this when we next release.
swarm * swarm context unix:///var/run/docker.sock swarm | ||
``` | ||
|
||
Here is an example installing an application package, querying a status and then uninstalling it: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@garethr How do we want to ensure that people aren't confused by CNAB vs app package? Should we call it an application bundle or even just application?
README.md
Outdated
merge Merge a multi-file application into a single file | ||
push Push the application to a registry | ||
render Render the Compose file for the application | ||
split Split a single-file application into multiple files | ||
status Get an application status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inspect
is run on an at rest bundle, status
gives information about an installed application.
If this isn't clear, we should make sure the help makes it so.
@vdemeester |
The lines
Are repeated multiple times, maybe we could refactor it at some time |
Fixed @rumpl PTAL |
@vdemeester cmd/run renamed to cmd/cnab-run. PTAL 🐱 |
6d2620c
to
156d992
Compare
81b003a
to
56f56fb
Compare
4984c03
to
b069ba8
Compare
Codecov Report
@@ Coverage Diff @@
## master #443 +/- ##
=======================================
Coverage 58.46% 58.46%
=======================================
Files 57 57
Lines 2889 2889
=======================================
Hits 1689 1689
Misses 981 981
Partials 219 219 Continue to review full report at Codecov.
|
* Fix tag generation by truncating the git sha. * Fix saving cnab base image to a global tmp directory and put it in a local git ignored directory (_build). * Remove the cnab base image from the CI local daemon * Load invocation image directly instead of using a make target. Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
a616ac8
to
1caad68
Compare
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Install command also detects if the argument is a Docker Application Package. It will then bundle it and run the CNAB action Install. It is now a CNAB installer, and all the docker-app deployment logic is moved to the docker-app backend binary run in cmd/run/install.go. The installation is added in the duffle claim store. * Rename deploy command to install (with still alias to deploy) Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
It will run the Uninstall CNAB action in the cmd/run/uninstall.go to remove a Docker Application Package deployment. Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
For a Docker Application Package, it will run a "docker stack services" on the deployed stack. Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
1caad68
to
dd9d707
Compare
*Fix running docker-app validate only on application package examples and skip CNAB examples. Signed-off-by: Christopher Crone <christopher.crone@docker.com>
dd9d707
to
05f3dbd
Compare
…xt has not been specified. Factorize credentialset and target-context flags. Extract all helper functions to their own go file. Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
05f3dbd
to
196387f
Compare
I squashed the as much commits as I could, it's ready to be merged as I think every comments has been tackled. |
@simonferquel @vdemeester can you update your review? 🐱 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM 😉
🎉 |
- What I did
docker-app
is now a CNAB client. It can install any CNAB bundle.I added then the 4 core CNAB commands:
But also a new command
bundle
to build a CNAB bundle from a Docker Application Package.This PR introduces a new binary
run
which is the new docker-app CNAB "backend". It is executed inside the invocation image and answers to the 4 CNAB actions.Note This PR purpose is to clean the cnab-preview branch and introduce the CNAB commands to docker-app. Some things still needs to be done in multiple follow-ups (and to avoid a mega PR, this one is big enough):
inspect
command as a CNAB custom action- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)