-
Notifications
You must be signed in to change notification settings - Fork 202
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
Don't use Docker adjective if we don't have to #820
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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 not a big fan of introducing a new term (i.e., compat). Those images are in the docker
format and I would find it very confusing. Users browsing through docs, man pages, blogs and pretty much all existing resources will be trained to distinguish between docker
and oci
images.
@@ -56,13 +56,13 @@ func (r *Runtime) Save(ctx context.Context, names []string, format, path string, | |||
|
|||
// Dispatch the save operations. | |||
switch format { | |||
case "oci-archive", "oci-dir", "docker-dir": | |||
case "oci-archive", "oci-dir", "docker-dir", "dir": |
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.
Why dir
? That is not supported by podman save
.
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 have a WIP PR to support it. We refer to the "dir" transport in containers-transports, we should use the same terminology here.
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.
Could we then make OCI
the default for dir
? Currently, it's docker
.
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.
That is a change in transports though? Would you want this to conflict?
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.
The c/image dir:
transport is “raw unmodified accept-anything”, it’s not tied to a manifest format like Docker/OCI, and it’s specified by neither.
I completely support not naming that destination docker-dir
.
Making ”OCI” (the manifest format?) default for dir:
(the transport) would defeat the original “debugging destination” purpose in c/image; I suppose Podman could set up saves to use the dir:
format and force a conversion, but that seems worse in every way than just using the oci:
(oci/layout) transport and including an OCI-native index blob and the like.
WRT whether podman save
should default to dir:
, oci:
(a directory), or docker-archive:
/ oci-archive:
, I don’t have a strong preference (I’d weakly say that the dir:
debugging format is probably not the right default) — anyway that seems like a topic for a different PR.
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 am not interested in changing the default. Just in removing the "docker" adjective from our man pages when possible, especially when it adds little value. 10 instances of Docker in the podman save man page, none of which add any value to the user IMHO.
man podman save | grep docker
podman save saves an image to either docker-archive, oci-archive, oci-
dir (directory with oci manifest type), or docker-dir (directory with
v2s2 manifest type) on the local machine, default is docker-archive.
dir transport i.e --format=oci-dir or --format=docker-dir
Save image to docker-archive, oci-archive (see containers-trans‐
ports(5)), oci-dir (oci transport), or docker-dir (dir transport with
--format docker-archive
--format docker-dir
docker-archive. The default for this option can be modified via the
$ podman save --format docker-dir -o ubuntu-dir ubuntu
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.
If it’s just that, the man page lists the available options three times, when doing so just once in the --format
section would probably suffice.
The default value, and the conditionals for --compress
and --multi-image-archive
, can’t be eliminated that easily, to be fair.
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.
the man page lists the available options three times, when doing so just once in the
--format
section would probably suffice.
@@ -105,7 +105,7 @@ func (r *Runtime) saveSingleImage(ctx context.Context, name, format, path string | |||
destRef, err = ociTransport.NewReference(path, tag) | |||
options.ManifestMIMEType = ociv1.MediaTypeImageManifest | |||
|
|||
case "docker-dir": | |||
case "docker-dir", "dir": |
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.
Why dir
? That is not supported by podman save
.
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.
See above.
d4c1add
to
9dd504d
Compare
Start using dir instead of docker-dir for podman save. Use compat-archive rather then docker-archive. Use docker-dir and docker-archive for compatibility only. Signed-off-by: Daniel J Walsh <[email protected]>
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
@mtrmac PTAL/FYI
if len(names) > 1 { | ||
return errors.Errorf("%q does not support saving multiple images (%v)", format, names) | ||
} | ||
return r.saveSingleImage(ctx, names[0], format, path, options) | ||
|
||
case "docker-archive": | ||
case "docker-archive", "compat-archive": | ||
options.ManifestMIMEType = manifest.DockerV2Schema2MediaType |
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.
(Completely unrelated, I don’t see why this is hard-coded here. The transport already contains only that value in SupportedManifestMIMETypes
— so this maybe just silently ignores user’s explicit format value instead of failing.
Is there some non-obvious reason for doing this? If so, it might be worth a comment.)
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.
Probably just old code. I can remove 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.
I’m really after the knowledge, not after dropping the line. It came in #551 and looks fairly unlikely to be accidental, but it’s not obvious to me why it was added.
If we don’t know, let’s leave it it, at least in this PR.
I agree. It immediately begs the question “ I am also very much in favor of steering users away from both of the tar archive formats for any kind of transport, they are horribly inefficient. I don’t think naming it them “compat” doesn’t help that at all — if anything, it makes it more likely to be chosen because “that one is intended to be widely compatible”. That would be, from my point of view, a very regrettable outcome of this (lack of) branding choice. |
How about just calling archive and dir. |
@@ -105,7 +105,7 @@ func (r *Runtime) saveSingleImage(ctx context.Context, name, format, path string | |||
destRef, err = ociTransport.NewReference(path, tag) | |||
options.ManifestMIMEType = ociv1.MediaTypeImageManifest | |||
|
|||
case "docker-dir": | |||
case "docker-dir", "dir": | |||
destRef, err = dirTransport.NewReference(path) | |||
options.ManifestMIMEType = manifest.DockerV2Schema2MediaType |
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.
So actually there’s this hard-coded format setting, making docker-dir
not be the raw “preserve original format” destination that c/image dir:
is.
And the history of that is containers/podman@d2ab53a , which has originally used oci-dir
for dir:
with OCI conversion forced, and docker-dir
for dir:
with v2s2 conversion forced. I.e. the docker-
part in the name is historically very much intentional and semantically meaningful.
Only fairly recently was oci-dir
changed to use the OCI repository format ( containers/podman#6814 ), making the oci-dir
/docker-dir
less of a clear-cut pair.
Still — right now it is not a “Docker-defined directory”, but it is a “Docker-format-containing directory”. I’m not too happy about dropping the format name from the format.
I’m tempted to complicate this further, leave docker-dir
as is, and define a new dir
to have the c/image meaning (i.e. no conversion unless the user explicitly asked for one).
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’m tempted to complicate this further, leave docker-dir as is, and define a new dir to have the c/image meaning (i.e. no conversion unless the user explicitly asked for one).
Actually a podman push $source dir:…
should work for that already, so we don’t need to make this an explicit podman image save
feature without any specific user demand.
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.
Yup
man docker save
shows none of these. So there is little value in us flooding the man pages with "docker".
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.
docker save does not even support --format.
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.
Podman does support --format
, so Podman users need to know which value to use to interoperate with various tools, whether that is umoci
or Docker. (Even if the default is to use a Docker-compatible format, and users don’t need to explicitly use --format
to get that kind of output, I think the man page should document clearly enough that that’s what the command is intended to do, so that users can rely on that.)
Looking more closely, given #820 (review) , I no longer think it’s obvious. Considering that the metadata format and file names are from the c/image
WRT a generic This format doesn’t have a formal name to my knowledge, so we are free to be descriptive, like If we invent a completely new non-branded name (letters of the Greek alphabet or whatever), that just runs into the-artist-formerly-named-Prince problem, and results in even more explanatory blogs to be published. |
podman save --format omicron :^) I don't believe there are that many people changing the format of podman save. (I would bet you the number could fit into a small closet.) The old names would continue to be supported, just hidden from the user. People are moving to Containerfile, better then I thought... |
I think that’s very likely — but to me that suggests that trying to deemphasize it even further is not all that worthwhile. |
Ok, not important enough to continue slogging this out would much rather get rid of the docker:// transport. |
Start using dir instead of docker-dir for podman save.
Use compat-archive rather then docker-archive.
Use docker-dir and docker-archive for compatibility only.
Signed-off-by: Daniel J Walsh [email protected]