Skip to content

generic-packs: support oci:// references via install-oci-pack#4164

Merged
itzg merged 2 commits into
itzg:masterfrom
ChipWolf:oci-generic-packs
Jul 16, 2026
Merged

generic-packs: support oci:// references via install-oci-pack#4164
itzg merged 2 commits into
itzg:masterfrom
ChipWolf:oci-generic-packs

Conversation

@ChipWolf

@ChipWolf ChipWolf commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Adds OCI registry support to GENERIC_PACKS. An entry that resolves to oci://… (tag or @sha256: digest) is pulled with mc-image-helper install-oci-pack; everything else keeps the existing isURL→local behaviour. Purely additive — oci:// is required, so a bare ghcr.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, and sha1sum checksum pipeline is unchanged.

Design notes

  • Single list, not a new GENERIC_PACKS_OCI var: nothing new to document, preserves cross-scheme ordering, and reuses PREFIX/SUFFIX/DISABLE_MODS and the update/checksum machinery.
  • One new var: GENERIC_PACKS_OCI_AUTH_FILE--auth-file (passed only when set; otherwise the helper's ~/.config/containers/auth.json~/.docker/config.json fallback, else anonymous).
  • Validation is left to the helper: called without --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/oci with --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 pins MC_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-oci pulls two demo packs that share a base layer (gated behind EXTENDED_TESTS, since it needs anonymous ghcr.io egress).

Refs #4038

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.
@ChipWolf

Copy link
Copy Markdown
Contributor Author

@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

@ChipWolf
ChipWolf marked this pull request as draft July 14, 2026 10:30
@itzg

itzg commented Jul 14, 2026

Copy link
Copy Markdown
Owner

@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.

@itzg

itzg commented Jul 14, 2026

Copy link
Copy Markdown
Owner

The design looks great. I'll try to get to the code review ASAP.

@ChipWolf

Copy link
Copy Markdown
Contributor Author

@itzg

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

@itzg

itzg commented Jul 15, 2026

Copy link
Copy Markdown
Owner

@ChipWolf , I really like the styling of this diagram. What did you use to create it? Actually all the diagrams.

@ChipWolf

Copy link
Copy Markdown
Contributor Author

@ChipWolf , I really like the styling of this diagram. What did you use to create it?

Fable 5

@itzg

itzg commented Jul 15, 2026

Copy link
Copy Markdown
Owner

It's forked https://github.com/itzg/oci-modpack-template ...or did you think a clone-and-push was better?

@itzg

itzg commented Jul 15, 2026

Copy link
Copy Markdown
Owner

BTW I'm very impressed by how thorough you were with the template repo!

@itzg itzg left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Mark it ready when you're ready...and ping me please since apparently Github doesn't notify when a PR goes to ready.

@ChipWolf

ChipWolf commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

It's forked https://github.com/itzg/oci-modpack-template ...or did you think a clone-and-push was better?

Fork is fine, are actions enabled & has it released the artifacts? I'll need them available in your ghcr for the test suite here (see step 5 in the readme also)

@itzg

itzg commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Ah, I didn't follow all of your setup instructions 😉 With actions enabled it does indeed push the artifacts.

@ChipWolf
ChipWolf marked this pull request as ready for review July 16, 2026 20:07
@ChipWolf
ChipWolf requested a review from itzg July 16, 2026 20:07
@ChipWolf

Copy link
Copy Markdown
Contributor Author

pinging as requested @itzg tyvm

@itzg itzg left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic!

@itzg itzg linked an issue Jul 16, 2026 that may be closed by this pull request
@itzg
itzg merged commit 591f37b into itzg:master Jul 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support OCI generic packs

2 participants