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

oci/*: major split ups #90

Merged
merged 7 commits into from
Feb 27, 2017
Merged

oci/*: major split ups #90

merged 7 commits into from
Feb 27, 2017

Conversation

cyphar
Copy link
Member

@cyphar cyphar commented Feb 18, 2017

In preparation for migrating most of oci/* to image-tools or some such
repo, we need to split up several packages so that they are less of a
conglomeration and more of a useful set of packages that implement the minimal
functionality so other packages can build on top of them.

This changeset also includes quite a few refactorings to make certain
interfaces more generic, in anticipation for the requirements that
image-tools needs to fulfill using these libraries.

Things that need to be done:

  • Split conversion (image -> runtime) from generation (image).
  • Refactor GC by implementing a generic Walk utility.
  • Split out gc and walk from oci/cas.

Possibilities:

  • Instead of implementing all of the wrappers around cas.Engine as functions that take it as an argument, implement some wrapping structure that provides extra methods (but still provides the old ones) -- like a derived type.

  • Split oci/cas/dir.go into some sort of "drivers"-style code so that multiple drivers can more easily be added later. To be honest, this isn't something we need right now -- and the code is already separate enough that you could split it by just moving the file (even the tests would continue to work).

Signed-off-by: Aleksa Sarai asarai@suse.de

@wking
Copy link
Contributor

wking commented Feb 18, 2017 via email

@wking
Copy link
Contributor

wking commented Feb 18, 2017 via email

@cyphar cyphar force-pushed the oci-split-up branch 2 times, most recently from 341fa9e to 22c6b39 Compare February 19, 2017 21:03
@cyphar
Copy link
Member Author

cyphar commented Feb 19, 2017

@wking I already have a full copy of the license in COPYING. Not to mention that the header itself tells you where you can get a copy of the license. This is really not the point of this PR. It'd be great if you didn't derail a PR like this with license discussion.

@cyphar cyphar force-pushed the oci-split-up branch 3 times, most recently from 5aa61e1 to 7beb7d9 Compare February 19, 2017 22:32
@wking
Copy link
Contributor

wking commented Feb 20, 2017 via email

@cyphar cyphar force-pushed the oci-split-up branch 2 times, most recently from 317368c to e9a0db2 Compare February 20, 2017 21:23
This is something that will almost certainly bite us in the future.
Ultimately while it doesn't _really_ matter at the moment (and
especially not for casual uses of umoci) it could cause issues for
reproducible builds of images (something that will certainly become more
important in the future).

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Another cleanliness improvement, to get oci/ more usable as a series of
composable libraries. Generation of specifications and mutation of an
image will at some point both live within oci/spec [or there will be
some splitting of the two parts].

Signed-off-by: Aleksa Sarai <asarai@suse.de>
The conversion code in oci/generate really belonged in a separate
package because it does not use any aspect of the image configuration
_generation_. Not to mention that conversion is actually going to be
defined in the spec, so it should be as self-contained as possible.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
GC implements a lot of really cool recursive descent functionality, but
it wasn't really exposed. Split out the core parts into Walk() -- which
is meant to mirror "path/filepath".Walk. GC will be reimplemented to use
the new functionality.

In addition, implement Reachable and Paths which return information
about the set of descriptors and digests which can be reached. This
change also includes replacing gc.mark with Reachable.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Garbage collection, blob auto-detection and walking are all built on top
of the CAS abstraction and don't belong in the same place as the
implementation or Engine interface.

In addition, Instead of making cas.Engine an argument to every extension
function, use the embedded struct method of adding extensions to an
interface.  This also provides a template for how other extensions
(third-party or otherwise) could be written.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
@cyphar cyphar force-pushed the oci-split-up branch 7 times, most recently from bc6519f to 4d3eb0c Compare February 27, 2017 22:17
This is a much nicer model for enabling alternative CAS implementations,
using a URI-based system for determining whether a particular CAS driver
implementation supports the URI.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Signed-off-by: Aleksa Sarai <asarai@suse.de>
@cyphar cyphar added this to the 0.1.1 milestone Feb 27, 2017
@cyphar
Copy link
Member Author

cyphar commented Feb 27, 2017

LGTM

@cyphar cyphar merged commit 52d70dd into master Feb 27, 2017
cyphar referenced this pull request Feb 27, 2017
Closes openSUSE/umoci#90
LGTMs: @cyphar
@cyphar cyphar deleted the oci-split-up branch February 27, 2017 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants