-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pack build
command to export to OCI layout format on disk
#1596
pack build
command to export to OCI layout format on disk
#1596
Conversation
52af388
to
86618f2
Compare
c1c247a
to
1f61446
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1596 +/- ##
==========================================
- Coverage 79.72% 79.25% -0.47%
==========================================
Files 165 147 -18
Lines 10885 9076 -1809
==========================================
- Hits 8677 7192 -1485
+ Misses 1683 1463 -220
+ Partials 525 421 -104
Flags with carried forward coverage won't be shown. Click here to find out more. |
31b8178
to
f0666c1
Compare
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
…, app image destination and previous image) is mounting independently Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
3fa4b03
to
256b0dc
Compare
Signed-off-by: Juan Bustamante <[email protected]>
…format Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
if cfg.Experimental { | ||
cfg.LayoutRepositoryDir = filepath.Join(filepath.Dir(cfgPath), "layout-repo") | ||
} else { | ||
cfg.LayoutRepositoryDir = "" | ||
} |
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.
This feels a little odd to me. Are we sure we want the default layout dir in the config dir?
Also, it looks like this isn't actually configurable right? It's either the default or nothing.
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.
Yeah, for now, because the feature is experimental, I didn't want to do a lot of work giving the user a configuration option. basically, the idea is:
- We need a place to save the
run-image
on disk, maybe the user doesn't care, that's why I am saving them in the pack home directory - I am planning to document this behavior in the docs so users can be aware of it.
The other alternative is, I could work on the user experience for configuring and customizing this kind of thing, but, I was planing to do it after shipping at least something the users can play with
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.
Actually, I can see pack already save some data in the same folder, for example.
➜ > tree ~/.pack -L 1
/Users/jbustamante/.pack
├── completion.zsh
├── config.toml
├── download-cache
├── layout-repo
├── registry-a932275bd19c2d9e1b88fa06698fd2f5427a363d25bf87fa500691c373089381
├── registry2908354347
└── registry57772754
6 directories, 2 files
Those registry-*
folders are already saving data there
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.
Is it just metadata that goes in this dir? Or does it actually store large files?
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.
it will save the run-image
in OCI layout format, it could have all the blobs depending on whether the user set the sparse
flag or not. But it could have large files, for sure
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
Signed-off-by: Juan Bustamante <[email protected]>
0ac038e
to
12c370a
Compare
Signed-off-by: Juan Bustamante <[email protected]>
Summary
This PR expose the functionality to end users to being able to export the application image to disk in OCI layout format. The final application image can be configured to contain all the blobs from the
run-image
(default behavior) or using the-sparse
flag the blobs from therun-image
will be omitted.Output
full image saved on disk
Let's suppose the application was built using the following command
We can see the application was saved on disk in OCI layout format at folder
my-java-app
image saved on disk avoiding run-image blobs
On the other hand, if we used the
--sparse
flag to export the imageThe output do not contain the
run-image
blobsBefore
The feature doesn't exist in previous version of pack
After
With this new PR, pack will have the following new behavior:
pack config experimental true
oci:<image-path>
whenpack build
is invokedrun-image
blobs to be written on disk, they can passthrough the flag--sparse
/$HOME/.pack/layout-repo
to save therun-image
in OCI layout, this path will be mounted during lifecycle build execution.Documentation
Related
Resolves #1548