-
Notifications
You must be signed in to change notification settings - Fork 3
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
API(s) to support modification #48
Comments
Assuming we are following the flow for Singularity detailed in sylabs/singularity#1480 we need to be able to perform 2 modification operations for minimal functionality, with an additional 'seal' operation if we wish to allow images with overlays to be finalized and / or pushed to an OCI registry as an OCI image with r/o tar layers. 1. Add EXTFS OverlayWe must be able to add an extfs overlay, of configurable size, to the SIF file. The overlay will be added to the image config as an additional layer with an extfs mediaType. The image config, manifest, and RootIndex will be updated so that all hashes are consistent at the time of insertion of the extfs overlay layer. To avoid re-writing the entirity of the SIF file, we would need to enforce that all existing image layers are located at the start of the SIF file. Large images can have many and large layers, so we don't want to re-write the whole SIF if at all possible. For an image with N layers - Before:
After the addition of an extfs overlay:
2. Update MetadataAs the EXTFS overlay layer is modified, the image config, manifest, and RootIndex will become inconsistent w.r.t. the hash for the extfs overlay layer. Due to concurrency issues, the risk of batch jobs being killed etc. in the SingularityCE use case it is probably not practical to update the image config, manifest, root index after each use of the overlay in r/w mode. However, before we share the image in a registry, we need the hashes to be correct. We must have an operation that updates the image metadata, rewriting image config, manifest, rootindex appropriately. Before metadata is updated:
After metadata is updated:
3. 'Seal' OverlayWhen a user has finished modifying an image via an overlay, we may wish to allow them be able to 'seal' the image. This will convert the EXTFS overlay layer into a SquashFS layer. Sealing an overlay - into a r/o layer - is also a prerequisite for being able to subsequently push the image in tar layer format, compatibile with other runtimes. Before image is sealed:
|
I think there are a couple of steps here. At a minimum:
This should be fairly do-able. Again, you'll need to construct an updated From there, if you call
This will again follow a similar flow I think. The tricky part here will be the EXTFS->SquashFS conversion, and I'm not sure if this belongs in this repo or in SingularityCE. I'd lean towards CE for now, as EXTFS seems fairly specific to that at the moment? Once you have a |
Add `sif.Update` which accepts updates a SIF so that its content reflects the ImageIndex passed. Any blobs in the SIF that are not present in the new ImageIndex will be removed from the SIF. Any blobs that are present in the new ImageIndex, but not in the SIF, will be added to the SIF. Blobs that are present in both the SIF and the new ImageIndex are not re-written. They will remain at their current descriptor location in the SIF. Closes sylabs#48
Add `sif.Update` which accepts updates a SIF so that its content reflects the ImageIndex passed. Any blobs in the SIF that are not present in the new ImageIndex will be removed from the SIF. Any blobs that are present in the new ImageIndex, but not in the SIF, will be added to the SIF. Blobs that are present in both the SIF and the new ImageIndex are not re-written. They will remain at their current descriptor location in the SIF. Closes sylabs#48
Add `sif.Update` which accepts updates a SIF so that its content reflects the ImageIndex passed. Any blobs in the SIF that are not present in the new ImageIndex will be removed from the SIF. Any blobs that are present in the new ImageIndex, but not in the SIF, will be added to the SIF. Blobs that are present in both the SIF and the new ImageIndex are not re-written. They will remain at their current descriptor location in the SIF. Closes sylabs#48
Add `sif.Update` which accepts updates a SIF so that its content reflects the ImageIndex passed. Any blobs in the SIF that are not present in the new ImageIndex will be removed from the SIF. Any blobs that are present in the new ImageIndex, but not in the SIF, will be added to the SIF. Blobs that are present in both the SIF and the new ImageIndex are not re-written. They will remain at their current descriptor location in the SIF. Closes sylabs#48
Add `sif.Update` which accepts updates a SIF so that its content reflects the ImageIndex passed. Any blobs in the SIF that are not present in the new ImageIndex will be removed from the SIF. Any blobs that are present in the new ImageIndex, but not in the SIF, will be added to the SIF. Blobs that are present in both the SIF and the new ImageIndex are not re-written. They will remain at their current descriptor location in the SIF. Closes sylabs#48
Add `sif.Update` which accepts updates a SIF so that its content reflects the ImageIndex passed. Any blobs in the SIF that are not present in the new ImageIndex will be removed from the SIF. Any blobs that are present in the new ImageIndex, but not in the SIF, will be added to the SIF. Blobs that are present in both the SIF and the new ImageIndex are not re-written. They will remain at their current descriptor location in the SIF. Closes sylabs#48
Add `sif.Update` which accepts updates a SIF so that its content reflects the ImageIndex passed. Any blobs in the SIF that are not present in the new ImageIndex will be removed from the SIF. Any blobs that are present in the new ImageIndex, but not in the SIF, will be added to the SIF. Blobs that are present in both the SIF and the new ImageIndex are not re-written. They will remain at their current descriptor location in the SIF. Closes sylabs#48
Spec out one or more API(s) to support the addition of an overlay, and to update the relevant image manifest/config and root index after an overlay is modified (sylabs/singularity#1480). Also see discussion in #46.
The text was updated successfully, but these errors were encountered: