-
Notifications
You must be signed in to change notification settings - Fork 377
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
docker-archive: read+write #998
Commits on Aug 7, 2020
-
We do support the legacy format nowadays. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 80c2a00 - Browse repository at this point
Copy the full SHA 80c2a00View commit details -
Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for a372946 - Browse repository at this point
Copy the full SHA a372946View commit details -
Move docker/tarfile.Destination to docker/internal/tarfile.Destination
... so that we can add more functionality to it without making it public API. Keep the original docker/tarfile.Destination as a compatibility shim. ManifestItem is moved to the private package to avoid an import cycle, but remains visible. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for b5d6158 - Browse repository at this point
Copy the full SHA b5d6158View commit details -
Use the docker/internal/tarfile.Destination from docker/daemon and do…
…cker/archive ... instead of the forwarding shims. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for e1e5452 - Browse repository at this point
Copy the full SHA e1e5452View commit details -
Remove deprecated non-SystemContext functions from docker/internal.ta…
…rfile his is a private API now, so we can just drop it; rename the ...With[System]Context varianteto use the shorter name, and update all callers. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 5a6886c - Browse repository at this point
Copy the full SHA 5a6886cView commit details -
Introduce Destination.configPath and Destination.physicalLayerPath
We will be splitting uses of these paths across two objects, so make them a private API instead of a copy&pasted convention. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 9680473 - Browse repository at this point
Copy the full SHA 9680473View commit details -
Split docker/internal.tarfile.Writer from Destination
... to eventually allow creating multiple Destinations from a single Writer. NOTE: This only splits the implementation into two, mostly at function boundary; it does NOTHING to support writing multiple images; top-level metadata is written independently on each Destination.PutManifest . This will be fixed soon. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for a9938d1 - Browse repository at this point
Copy the full SHA a9938d1View commit details -
Move createRepositoriesFile to a bit better place
... to follow the PutManifest flow. Should not change behavior, nothing about the code was changed. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 1214e24 - Browse repository at this point
Copy the full SHA 1214e24View commit details -
Split Writer.createManifest from Destination.PutManifest
This still only supports one image, but we will fix that momentarily. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for f4d4799 - Browse repository at this point
Copy the full SHA f4d4799View commit details -
Reorganize docker/internal/tarfile.Writer.createManifest a bit
... only to make future commits easier to review. This introduces a bit of inefficiency (creating an on-stack ManifestItem only to copy it into a single-element array), but that will be gone momentarily. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for e5c7ed8 - Browse repository at this point
Copy the full SHA e5c7ed8View commit details -
Move the computation of layerPaths in docker-archive
... from writeLegacyLayerMetadata to the non-legacy createManifest. Now that we have a dedicated function for computing the path consistently, introducing another reference to it does not hurt maintainability, and the small efficiency gain of computing the path only once is not really worth coupling the legacy/non-legacy code, especially when the legacy code is going to get more complex. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for efab506 - Browse repository at this point
Copy the full SHA efab506View commit details -
Implement writing multiple images in the modern format.
NOTE: This is not sufficient to create correct multi-image archives yet, the legacy format is still invalid. This will eventually allow creating multiple Destinations from a single Writer. Should not change behavior for current callers, except that possible JSON failures are now reported later. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for bfe71f6 - Browse repository at this point
Copy the full SHA bfe71f6View commit details -
Split createSingleLegacyLayer from writeLegacyLayerMetadata
... so that we can later only do this for layers that haven't been created yet. Should not change behavior, apart from timing of some reported errors. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 4f13a6b - Browse repository at this point
Copy the full SHA 4f13a6bView commit details -
Move legacy layer ID computation to a bit later
... because it will soon depend on the rest of layerConfig. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 29ddfdd - Browse repository at this point
Copy the full SHA 29ddfddView commit details -
Merge writeLegacyMetadata and createRepositoriesFile
... so that the caller does not have to care about lastLayerID and empty images. This preserves the current behavior of silently ignoring tags intended for empty images. That's probably not quite right, but also not a subject of this PR. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 3bef56d - Browse repository at this point
Copy the full SHA 3bef56dView commit details -
Implement writing multiple images in the legacy format
Now that both the legacy and non-legacy format can incrementally add images to a single archive, this will allow creating multiple Destinations from a writer Writer. Image IDs are now generated differently; that may be observable by very old Docker versions. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 075bc06 - Browse repository at this point
Copy the full SHA 075bc06View commit details -
Separate tarfile.Writer creation from Destination creation
At least docker/archive will need to deal with the two optionally separately, so such a separate constructor must exist; and the other callers are not much more complex if they separate it as well. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for c81a536 - Browse repository at this point
Copy the full SHA c81a536View commit details -
Lock docker/internal/tarfile.Writer to support concurrent uses
This does not really allow _concurrency_ because we are streaming the data to a single io.Writer, but it gives us safety against concurrent callers (hypothetically when copying multiple images, at least). Note that we do not currently set HasThreadSafePutBlob, although we could, because the benefit is probably fairly small (basically it would parallelize creating on-disk copies of streamed inputs with unknown size or digest); that might be a wrong guess. Also adds a sanity check against using the Writer after Finish(). Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 28fea18 - Browse repository at this point
Copy the full SHA 28fea18View commit details -
Split openArchiveForWriting from docker/archive/newImageDestination
We will add another caller in the next commit. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for dbc2073 - Browse repository at this point
Copy the full SHA dbc2073View commit details -
Finally, introduce docker/archive.Writer
... which allows creating ImageReferece objects that all write to a shared tarfile.Writer. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 611759b - Browse repository at this point
Copy the full SHA 611759bView commit details -
Fix an error message on docker-archive:path:name@sha256:$digest
It's a possible user error, not a supposedly-unreachable internal error. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 3c9322d - Browse repository at this point
Copy the full SHA 3c9322dView commit details -
Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 0d0ea66 - Browse repository at this point
Copy the full SHA 0d0ea66View commit details -
Move docker/tarfile.Source to docker/internal/tarfile.Source
... so that we can add more functionality to it without making it public API. Keep the original docker/tarfile.Source as a compatibility shim. ManifestItem is moved to the private package to avoid an import cycle, but remains visible. docker/tarfile/src_test.go should logically be moved as well, but we can't do that yet due to the import cycle. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for f358587 - Browse repository at this point
Copy the full SHA f358587View commit details -
Use the docker/internal/tarfile.Source from docker/daemon and docker/…
…archive ... instead of the forwarding shims. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for d0f56fb - Browse repository at this point
Copy the full SHA d0f56fbView commit details -
Remove deprecated non-SystemContext functions from docker/internal/ta…
…rfile This is a private API now, so we can just drop it; rename the ...With[System]Context variants to use the shorter names, and update all callers. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 4859364 - Browse repository at this point
Copy the full SHA 4859364View commit details -
Split docker/internal/tarfile.Reader from Source
... to eventually allow creating multiple Sources from a single Reader (= a temporary file containing a seekable/uncompressed copy of the archive). Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for de0ae52 - Browse repository at this point
Copy the full SHA de0ae52View commit details -
Separate tarfile.Reader creation from Source creation
At least docker/archive will need to deal with the two optionally separately, so such a separate constructor must exist; and the other callers are not much more complex if they separate it as well. This will also allow us to add reference lookup without having to duplicate the API. As a concession to the simpler callers, add a closeArchive parameter (currently always true) that allows them not to worry about the lifetime of the tarfile.Reader. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for a9767e7 - Browse repository at this point
Copy the full SHA a9767e7View commit details -
Read the tarfile manifest already when initializing tarfile.Reader
Every caller will need that data; this way it can be shared across several consumers, and we don't need to synchronize access/creation of the parsed data structure. Should not change behavior, except that errors are now reported earlier. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for ca4e06a - Browse repository at this point
Copy the full SHA ca4e06aView commit details -
Turn tarfile.Source.LoadTarManifest into a TarManifest
We can drop the unused error return value now. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for dbd4761 - Browse repository at this point
Copy the full SHA dbd4761View commit details -
Allow choosing an image from tarfile.Reader by reference
We already accept the syntax for docker-archive: references, now implement the lookup instead of warning and ignoring the value. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 7029860 - Browse repository at this point
Copy the full SHA 7029860View commit details -
Introduce docker-archive:path:@Index syntax for reading untagged images
Configuration menu - View commit details
-
Copy full SHA for 756bef7 - Browse repository at this point
Copy the full SHA 756bef7View commit details -
Introduce docker/archive.Reader
with only two operations: Close(), and List() which returns a set of ImageReference objects that allow accessing the individual images. For now, use of every reference triggers creation of a new tarfile.Reader; that will be fixed momentarily. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 4176316 - Browse repository at this point
Copy the full SHA 4176316View commit details -
Finally, share a tarfile.Reader across archiveSource objects
In archive.Reader, embed a reference to tarfile.Reader to the created ImageReference objects, and use them in NewImageSource. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for be68ec7 - Browse repository at this point
Copy the full SHA be68ec7View commit details -
Configuration menu - View commit details
-
Copy full SHA for eca6f25 - Browse repository at this point
Copy the full SHA eca6f25View commit details -
Configuration menu - View commit details
-
Copy full SHA for e21dc22 - Browse repository at this point
Copy the full SHA e21dc22View commit details -
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 820918a - Browse repository at this point
Copy the full SHA 820918aView commit details -
Move docker/tarfile/src_test.go to docker/internal/tarfile
, closer to the implementation being tested. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for d7c80f4 - Browse repository at this point
Copy the full SHA d7c80f4View commit details