Skip to content

Conversation

@wking
Copy link
Contributor

@wking wking commented Nov 6, 2016

We probably need to keep application/vnd.oci.image.config.v1+json untouched, since #145 and other maintainer activity suggest a goal of bit-for-bit compatibility with the current Docker schemas (excepting media types). However, requiring Docker support doesn't mean we can't also require support for configuration formats that are easier for image authors to use.

Of course, with the (greatly) increased flexibility comes a lot more risk. Image consumers in general, and runtime-spec-based-image consumers in particular, should use a sanitization tool like the one I've floated in opencontainers/runtime-tools#219.

The runtime-spec config also lacks support for diffIDs, but local image tooling is still welcome to record the digests of uncompressed layers and use that for local optimizations. You have to fetch the compressed layer at least once to perform the uncompression, but you'd have to do that to verify the old diffID anyway.

This PR requires opencontainers/runtime-spec#611 for typing the runtime-spec config.

wking added 2 commits November 8, 2016 10:05
…ed config

The image-tools framework has attempted this since d3ffc1c
(oci-image-tool: implement create-runtime-bundle, 2016-06-02, opencontainers#114),
but we didn't specify whether the translation was required or what the
output of the translation should be.  That means downstream consumers
of an unpacked image couldn't be sure if they'd find a config.json or
(if they found one) which runtime-spec versions it would be compatible
with.  With this commit, the config output becomes specified, so
consumers can post-process their config.json and/or invoke a
runtime-spec 1.0.0-rc2-compatible runtime on it without worrying about
the presence or version of the unpacked config.json.

I've picked 1.0.0-rc2 as the most recent runtime-spec commit.  As the
runtime-spec moves forward with more RCs, I expect we'll want to bump
this to keep up.  Once runtime-spec hits 1.0, we can probably freeze
the target, since post 1.0 releases in runtime-spec's 1.x line are
unlikely to make translation from the config format easier, and any
1.x-compatible runtime will be able to handle 1.0 configs.

Signed-off-by: W. Trevor King <[email protected]>
We probably need to keep application/vnd.oci.image.config.v1+json
untouched, since e94aa35 (schema: add a docker v2.2 backwards compat
test, 2016-06-15, opencontainers#145) and other maintainer activity suggest a goal
of bit-for-bit compatibility with the current Docker schemas
(excepting media types).  However, requiring Docker support doesn't
mean we can't *also* require support for configuration formats that
are easier for image authors to use.

Of course, with the (greatly) increased flexibility comes a lot more
risk.  Image consumers in general, and runtime-spec-based-image
consumers in particular, should use a sanitization tool like [1].

The runtime-spec config also lacks support for diffIDs, but local
image tooling is still welcome to record the digests of uncompressed
layers and use that for local optimizations.  You have to fetch the
compressed layer at least once to perform the uncompression, but you'd
have to do that to verify the old diffID anyway.

[1]: opencontainers/runtime-tools#219

Signed-off-by: W. Trevor King <[email protected]>
@wking wking force-pushed the runtime-spec-config branch from 2a75b50 to 0a46871 Compare November 8, 2016 18:08
@wking
Copy link
Contributor Author

wking commented Nov 8, 2016 via email

@stevvooe
Copy link
Contributor

Rejected

This places unnecessary portability requirements on the runtime-spec and unnecessary cross-platform requirements on the image-spec. Doing this will result in an over-coupled system, that is inflexible and complex to upgrade.

Docker spent several versions decoupling these and it would be unfortunate if OCI went in the opposite direction.

I would be much in favor of making a version of the config that is driven based on the actual requirements of an image, rather than a misplaced notion of DRY or NIH.

@wking
Copy link
Contributor Author

wking commented Nov 22, 2016

On Mon, Nov 21, 2016 at 12:21:38PM -0800, Stephen Day wrote:

This places unnecessary portability requirements on the runtime-spec
and unnecessary cross-platform requirements on the image-spec. Doing
this will result in an over-coupled system, that is inflexible and
complex to upgrade.

Docker spent several versions decoupling these and it would be
unfortunate if OCI went in the opposite direction.

This PR is asking for:

configDigest := manifest.Config.digest
configReader, err := casEngine.Get(configDigest)
configWriter, err := os.OpenFile("config.json", os.O_WRONLY | os.O_CREAT, 0666)
defer configWriter.close()
_, err := ioutil.Copy(configWriter, configReader)

With the current spec, most unpackers would presumably error out with
something like:

“I have no idea how to create a runtime config from an
application/vnd.oci.runtime.config.v1+json blob.”

The only implementation I can think of that's more decoupled is “the
image-spec has no provision for sharing runtime configurations; handle
that out of band”.

@stevvooe
Copy link
Contributor

@wking There are a lot of implications to doing this. Per @philips during the weekly meeting, we should have some implementation directive that explains why this is such a problematic concept.

@philips
Copy link
Contributor

philips commented Nov 30, 2016

I 100% agree, we shouldn't do this. The config.json is explicitly not portable between hosts and we should add language to the runtime-spec to say that these configs are designed not to be transported or largely even moved between hosts.

@philips
Copy link
Contributor

philips commented Nov 30, 2016

closing xref #479

@philips philips closed this Nov 30, 2016
@wking
Copy link
Contributor Author

wking commented Dec 1, 2016 via email

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.

3 participants