Skip to content

allow setting compression level on export#2350

Closed
tonistiigi wants to merge 2 commits into
moby:masterfrom
tonistiigi:compression-level
Closed

allow setting compression level on export#2350
tonistiigi wants to merge 2 commits into
moby:masterfrom
tonistiigi:compression-level

Conversation

@tonistiigi
Copy link
Copy Markdown
Member

-o compression-level=n to configure the compressor.

Second commit tries to fix the multi-blob inline cache that I think was broken already (even before zstd PR). I think it is still broken with this PR as well and to fully fix it I need to change LoadRemote signature to LoadRemotes([]compression) []Remotes. @ktock

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Comment thread exporter/exporter.go

type ExporterInstance interface {
Name() string
Config() Config
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't very nice but didn't have any other ideas for the cache export to see the compressor. For other exports compressor should be set directly but for inline, it needs to use the same as what is used for the image.

Comment thread exporter/oci/export.go
VariantDocker = "docker"
ociTypes = "oci-mediatypes"
keyForceCompression = "force-compression"
keyCompressionLevel = "compression-level"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change force to compression-force in follow-up and deprecate old field?

@ktock
Copy link
Copy Markdown
Collaborator

ktock commented Oct 5, 2021

@tonistiigi During thinking about this, I've noticed LoadRemtoe and Load have a very similar logic, except Load calls Worker.FromRemote but LoadRemote doesn't.
The current logic of FromRemote does lazy-pulling so Load doesn't perform pull until the blob is really needed. Now that what is the difference between Load and LoadRemote? Why does solver.*exporter.ExportTo() treat LoadRemote as a special case?

cc @sipsma

@tonistiigi
Copy link
Copy Markdown
Member Author

@ktock LoadRemote is allowed to return nil

return nil, nil // ignore error. loadRemote is best effort
(it calls createBlobsIfNeeded=false). So it can be used to get fast access to remote but ignore it if fast access can't be achieved. In that case, some records will be skipped over and some will perform the slow Load+Diff to get the remote, depending on the cache mode.

@ktock
Copy link
Copy Markdown
Collaborator

ktock commented Oct 7, 2021

Thank you for the clarification. Opened #2405 to try to move this forward.

@tonistiigi tonistiigi added this to the v0.10.0 milestone Jan 18, 2022
@tonistiigi
Copy link
Copy Markdown
Member Author

replaced by #2591

@tonistiigi tonistiigi closed this Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants