generic-packs: support oci:// references via install-oci-pack#4164
generic-packs: support oci:// references via install-oci-pack#4164ChipWolf wants to merge 1 commit into
Conversation
Allow GENERIC_PACKS entries to point at OCI modpack artifacts in a container registry using an oci:// reference (tag or @sha256: digest). Such entries are pulled with mc-image-helper install-oci-pack and the resulting layer paths are appended to packFiles in manifest order, so the existing extract, disable-mods, manifest-diff, and checksum pipeline applies unchanged. OCI, URL, and local entries can be mixed in one list and apply in declared order. Layers are cached under /data/packs/oci by digest, so a base layer shared between packs is fetched only once. Registry auth can be supplied with GENERIC_PACKS_OCI_AUTH_FILE; artifact and layer media types are validated by the helper.
|
@itzg I suggest before merging that I create a template repo for generating these OCI artefacts and you create a repo under your GitHub account that can be used in the docs examples and the tests rather than using my oci-modpack-demo repo I'll work on that if you reckon that's a good move |
That would be fantastic. |
|
The design looks great. I'll try to get to the code review ASAP. |
Thanks! Here it is https://github.com/ChipWolf/oci-modpack-template If you're happy with that, feel free to clone, change the remote, and push to your own account |
Adds OCI registry support to
GENERIC_PACKS. An entry that resolves tooci://…(tag or@sha256:digest) is pulled withmc-image-helper install-oci-pack; everything else keeps the existingisURL→local behaviour. Purely additive —oci://is required, so a bareghcr.io/…is still treated as a local path.OCI, URL, and local entries can be mixed in one list and apply in declared order. The OCI branch appends the helper's layer paths to
packFiles[]in manifest order, so the existing extract,GENERIC_PACKS_DISABLE_MODS, manifest-diff, andsha1sumchecksum pipeline is unchanged.Design notes
GENERIC_PACKS_OCIvar: nothing new to document, preserves cross-scheme ordering, and reusesPREFIX/SUFFIX/DISABLE_MODSand the update/checksum machinery.GENERIC_PACKS_OCI_AUTH_FILE→--auth-file(passed only when set; otherwise the helper's~/.config/containers/auth.json→~/.docker/config.jsonfallback, else anonymous).--artifact-type/--layer-media-type, so it enforces the modpack artifact + layer media types and rejects non-modpack refs before anything touches/data.--output-directory /data/packs/ociwith--filename-strategy digest(fixed): content-addressed cache, so a base layer shared between packs is fetched once.Helper dependency:
install-oci-pack(helper master). The image already pinsMC_HELPER_VERSION=1.61.1, which includes it — no bump needed.Docs: new "Generic packs from an OCI registry" section in
docs/mods-and-plugins/index.md.Test:
tests/setuponlytests/generic-packs-ocipulls two demo packs that share a base layer (gated behindEXTENDED_TESTS, since it needs anonymousghcr.ioegress).Refs #4038