Skip to content
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

cmd/oci-image-tool: add manuals #180

Merged
merged 1 commit into from
Jul 27, 2016
Merged

Conversation

runcom
Copy link
Member

@runcom runcom commented Jul 22, 2016

Signed-off-by: Antonio Murdaca runcom@redhat.com

@runcom
Copy link
Member Author

runcom commented Jul 22, 2016

/cc @s-urbaniak

@wking
Copy link
Contributor

wking commented Jul 22, 2016

If we're getting more formal about documenting oci-image-tool, I
recommend following ocitools and putting most of the docs in something
that can turn into a man page 1.

@runcom
Copy link
Member Author

runcom commented Jul 22, 2016

If we're getting more formal about documenting oci-image-tool, I
recommend following ocitools and putting most of the docs in something
that can turn into a man page [1].

if maintainers are ok with that, I'll do that - right now I don't think it's necessary, ocitools otoh is already used a lot more and more mature (it's also already packaged in some distros).

@wking
Copy link
Contributor

wking commented Jul 22, 2016

On Fri, Jul 22, 2016 at 07:49:41AM -0700, Antonio Murdaca wrote:

If we're getting more formal about documenting oci-image-tool, I
recommend following ocitools and putting most of the docs in something
that can turn into a man page [1].

if maintainers are with that, I'll do that - right now I don't think
it's necessary, ocitools otoh is already used a lot and more
mature.

Hopefully oci-image-tool will be mature and well-used soon ;).
Starting with a man page saves us from having to identify that point
and transition the README to a man page later.

@runcom
Copy link
Member Author

runcom commented Jul 22, 2016

and transition the README to a man page later.

I'd still have a README - why not?

@wking
Copy link
Contributor

wking commented Jul 22, 2016

On Fri, Jul 22, 2016 at 07:58:11AM -0700, Antonio Murdaca wrote:

and transition the README to a man page later.

I'd still have a README - why not?

A README should defer to the man-page (opencontainers/runtime-tools#47) to
stay DRY.

@runcom
Copy link
Member Author

runcom commented Jul 22, 2016

A README should defer to the man-page (opencontainers/runtime-tools#47) to
stay DRY.

but we don't have a man page yet and what I've added is dry enough for now - I can remove the Usage to be referenced in future man pages but examples are good there and ocitools have them as well

@wking
Copy link
Contributor

wking commented Jul 22, 2016

On Fri, Jul 22, 2016 at 08:07:10AM -0700, Antonio Murdaca wrote:

A README should defer to the man-page (opencontainers/runtime-tools#47) to
stay DRY.

but we don't have a man page yet and what I've added is dry enough
for now…

I'm just saying that if the decision is “we don't want a man page yet
because $REASONS”, we want to be clear on those reasons so we know
when to re-evaluate. If the issue is “because I don't want to put in
the time to set that up”, I'm happy to file a man-page conversion
against this branch later today.

@runcom
Copy link
Member Author

runcom commented Jul 22, 2016

If the issue is “because I don't want to put in
the time to set that up”, I'm happy to file a man-page conversion
against this branch later today.

that's not the issue - I'm only saying a README.md with examples can go in w/o waiting to have man pages and that can come as a follow on (by me as well of course). Anyhow, I'll work on man pages asap

@wking
Copy link
Contributor

wking commented Jul 22, 2016

What examples would you put in a README that wouldn't go in the man page?

@runcom
Copy link
Member Author

runcom commented Jul 22, 2016

What examples would you put in a README that wouldn't go in the man page?

I'm not saying they should not go in the man page - I'm saying this is adding some example the same as the https://github.com/opencontainers/ocitools README is doing (https://github.com/opencontainers/ocitools/blob/master/man/ocitools-validate.1.md doesn't have examples in it but the README does, so take this PR as the README side of what ocitools already contain). I'm sure either of the two isn't following the other...

as said, I'll add some man pages stub

@wking
Copy link
Contributor

wking commented Jul 22, 2016

On Fri, Jul 22, 2016 at 08:31:32AM -0700, Antonio Murdaca wrote:

What examples would you put in a README that wouldn't go in the
man page?

I'm not saying they should not go in the man page - I'm saying this
is adding some example the same as the
https://github.com/opencontainers/ocitools README is doing
(https://github.com/opencontainers/ocitools/blob/master/man/ocitools-validate.1.md
doesn't have examples in it but the README does…

Ah, I think that should be fixed in ocitools. Filed as
opencontainers/runtime-tools#142.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
@runcom runcom changed the title cmd/oci-image-tool: add README.md cmd/oci-image-tool: add manuals Jul 22, 2016
@runcom
Copy link
Member Author

runcom commented Jul 22, 2016

man pages added...

**oci-image-tool unpack** [src] [dest] [flags]

# DESCRIPTION
`oci-image-tool unpack` unpacks a given OCI image into a directory suitable to be used with `runc`.
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably worth drawing a clear distinction between unpack and create-runtime-bundle here. That distinction is mostly around rootfs-or-not and config translation.

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, any suggestion on the language?

Copy link
Contributor

Choose a reason for hiding this comment

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

On Fri, Jul 22, 2016 at 10:25:35AM -0700, Antonio Murdaca wrote:

+# DESCRIPTION
+oci-image-tool unpack unpacks a given OCI image into a directory suitable to be used with runc.

sure, any suggestion on the language?

For unpack, something like:

Validates an application/vnd.oci.image.manifest.v1+json and unpacks
its layered filesystem to DEST.

For create-runtime-bundle, something like:

Validates an application/vnd.oci.image.manifest.v1+json and unpacks
its layered filesystem to DEST/rootfs, although the target directory
is configurable with --rootfs. See oci-image-tool-unpack(1) for
more details on this process.

Also translates the referenced config from
application/vnd.oci.image.serialization.config.v1+json to a
runtime-spec's config.json.

Copy link
Contributor

Choose a reason for hiding this comment

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

On Fri, Jul 22, 2016 at 10:35:50AM -0700, W. Trevor King wrote:

Also translates the referenced config from
application/vnd.oci.image.serialization.config.v1+json to a
runtime-spec's config.json.

Probably worth working in DEST/config.json there somewhow. Maybe:

Also translates the referenced config from
application/vnd.oci.image.serialization.config.v1+json to a
runtime-spec-compatible DEST/config.json.

@wking
Copy link
Contributor

wking commented Jul 22, 2016

On Fri, Jul 22, 2016 at 10:13:40AM -0700, Antonio Murdaca wrote:

man pages added...

They look pretty good to me. Do we expect additional command-line
tools in image-spec? If so, Makefiles for building the man pages will
be simpler if we use man/ instead of cmd/oci-image-tool/man/.

@runcom
Copy link
Member Author

runcom commented Jul 22, 2016

If so, Makefiles for building the man pages will
be simpler if we use man/ instead of cmd/oci-image-tool/man/.

I put them there just in case we'll have a dedicated repo for oci-image-tool and generally to keep them there not to clutter the repo root

@wking
Copy link
Contributor

wking commented Jul 22, 2016

On Fri, Jul 22, 2016 at 10:31:26AM -0700, Antonio Murdaca wrote:

If so, Makefiles for building the man pages will
be simpler if we use man/ instead of cmd/oci-image-tool/man/.

I put them there just in case we'll have a dedicated repo for
oci-image-tool…

+1 to that 1 ;).

@vbatts
Copy link
Member

vbatts commented Jul 25, 2016

LGTM

Approved with PullApprove

@philips
Copy link
Contributor

philips commented Jul 27, 2016

Is this generated somehow? Ideally the help text and the docs stay in sync.

In any case:
LGTM

Approved with PullApprove

@vbatts vbatts merged commit 64513b0 into opencontainers:master Jul 27, 2016
@runcom runcom deleted the add-readme branch July 27, 2016 23:51
@wking
Copy link
Contributor

wking commented Jul 27, 2016

@runcom, would you like to file a follow-up with the details on unpack
vs. create-runtime-bundle 1 or shall I?

@runcom
Copy link
Member Author

runcom commented Jul 28, 2016

I will @wking

wking added a commit to wking/image-spec that referenced this pull request Aug 31, 2016
Generated with:

  $ sed -i 's/oci-image-tools/oci-image-tool/g' $(git grep -l oci-image-tools)

Typos are from e60ff1d (cmd/oci-image-tool: add manuals, 2016-07-22,
opencontainers#180).

Signed-off-by: W. Trevor King <wking@tremily.us>
@wking
Copy link
Contributor

wking commented Aug 31, 2016

On Wed, Jul 27, 2016 at 05:30:08PM -0700, Antonio Murdaca wrote:

I will @wking

Any progress on this? I'm happy to turn 1 into a PR if you're too
busy.

@philips
Copy link
Contributor

philips commented Aug 31, 2016

@runcom @wking can you file a new issue so we don't lose this?

@wking
Copy link
Contributor

wking commented Aug 31, 2016

On Wed, Aug 31, 2016 at 10:53:18AM -0700, Brandon Philips wrote:

@runcom @wking can you file a new issue so we don't lose this?

I'll give @runcom 24 hours to get back, otherwise I'll just file a PR
;).

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.

4 participants