This repository has been archived by the owner on Jun 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 177
Relocation the right way #765
Merged
silvin-lubecki
merged 5 commits into
docker:master
from
eunomie:relocation-the-right-way
Nov 28, 2019
Merged
Relocation the right way #765
silvin-lubecki
merged 5 commits into
docker:master
from
eunomie:relocation-the-right-way
Nov 28, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eunomie
force-pushed
the
relocation-the-right-way
branch
from
November 25, 2019 17:14
2ac0888
to
d25fab9
Compare
Codecov Report
@@ Coverage Diff @@
## master #765 +/- ##
=========================================
Coverage ? 69.68%
=========================================
Files ? 64
Lines ? 3612
Branches ? 0
=========================================
Hits ? 2517
Misses ? 766
Partials ? 329
Continue to review full report at Codecov.
|
eunomie
force-pushed
the
relocation-the-right-way
branch
2 times, most recently
from
November 26, 2019 14:48
cc10716
to
e80d4cb
Compare
silvin-lubecki
approved these changes
Nov 27, 2019
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.
LGTM with function renamed
eunomie
force-pushed
the
relocation-the-right-way
branch
from
November 27, 2019 10:12
e80d4cb
to
9ad7667
Compare
Signed-off-by: Yves Brissaud <yves.brissaud@docker.com>
`cnab-go` adds two files to the invocation image: - `/cnab/bundle.json`: containing the whole `bundle.json` - `/cnab/app/image-map.json`: containing `Images` section of the bundle As this second file is only an extract of the Bundle it can safely be removed. The full removal needs to be done in `cnab-go`, here we only ignore it. Signed-off-by: Yves Brissaud <yves.brissaud@docker.com>
Bundle definition -with service image definitions- is mounted under `/cnab/bundle.json` in the invocation image. If a `/cnab/app/relocation-mapping.json` exists read it and apply it on top of image definitions. See https://github.com/cnabio/cnab-spec/blob/master/103-bundle-runtime.md#image-relocation Signed-off-by: Yves Brissaud <yves.brissaud@docker.com>
Embed the relocation map inside `/cnab/app/relocation-mapping.json` and do not touch the bundle definition. Signed-off-by: Yves Brissaud <yves.brissaud@docker.com>
Invocation image can be relocated. The relocation map about services is now applied at runtime by `cnab-run`, when running inside the invocation image. This change updates the invocation image definition in the `driver.Operation` using the relocation map if exists. So that the image can be pulled and run. Signed-off-by: Yves Brissaud <yves.brissaud@docker.com>
eunomie
force-pushed
the
relocation-the-right-way
branch
from
November 27, 2019 14:51
9ad7667
to
39c87cb
Compare
ndeloof
approved these changes
Nov 28, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- What I did
Copy the relocation map in a dedicated file and apply it at runtime in the invocation image instead of modifying the service definition in the
Installation
object.See https://github.com/cnabio/cnab-spec/blob/master/103-bundle-runtime.md#image-relocation
- How I did it
The relocation map is now stored under
/cnab/app/relocation-mapping.json
when we run commands.Then the
cnab-run
binary will read it, apply it on top of the service image definition.Note: the
/cnab/app/image-map.json
is not read anymore, all data already exist in/cnab/bundle.json
- How to verify it
Without this version
When you run a pulled App, read the installation file (under
~/.docker/app/installation/.../appname.json
). The image definition should contains relocated images (everything likeregistry/repo:tag@sha256...
)With this version
When you run a pulled App (must be build using this version to have the right
cnab-run
binary) and look at the installation file, the service images must not be the relocated ones but the one in thebundle.json
.But if you inspect the App Image, you should see the relocated images.
- Description for the changelog