Skip to content

Add ORAS CLI integration for multi-platform manifest management#363

Merged
ianpittwood merged 9 commits intomainfrom
oras-oci-management
Mar 3, 2026
Merged

Add ORAS CLI integration for multi-platform manifest management#363
ianpittwood merged 9 commits intomainfrom
oras-oci-management

Conversation

@ianpittwood
Copy link
Contributor

@ianpittwood ianpittwood commented Feb 19, 2026

Stacks on #364

Summary

  • Implements an oras-based alternative to docker buildx imagetools create for merging multi-platform images
  • Avoids authentication issues that affect Docker's imagetools when performing cross-registry operations
  • Adds OrasMergeWorkflow orchestrator that creates temporary manifest indexes, copies to target registries, and cleans up

Changes

  • posit_bakery/image/oras/oras.py: Main implementation with command classes and workflow orchestrator
  • posit_bakery/image/oras/__init__.py: Module exports
  • test/image/oras/test_oras.py: 37 unit tests covering all components

Test plan

  • Unit tests pass (just test -k oras)
  • Integration test with actual oras binary against test registry
  • Verify multi-platform manifest is created correctly
  • Verify tags are applied to all target registries
  • Verify temporary artifacts are cleaned up

🤖 Generated with Claude Code

@github-actions
Copy link

github-actions bot commented Feb 19, 2026

Test Results

1 177 tests   1 177 ✅  12m 57s ⏱️
    1 suites      0 💤
    1 files        0 ❌

Results for commit 7235a74.

♻️ This comment has been updated with latest results.

@ianpittwood ianpittwood changed the base branch from main to multi-metadata-attachments February 23, 2026 15:56
@ianpittwood ianpittwood changed the base branch from multi-metadata-attachments to image-target-sub-objects February 24, 2026 22:01
@ianpittwood ianpittwood force-pushed the image-target-sub-objects branch from 1dbf3ea to 6ec926d Compare February 25, 2026 22:25
ianpittwood and others added 6 commits February 26, 2026 07:46
Implements an oras-based alternative to `docker buildx imagetools create`
for merging multi-platform images. This avoids authentication issues that
affect Docker's imagetools when performing cross-registry operations.

The workflow:
1. Creates a temporary manifest index from platform-specific sources
2. Copies the index to all target registries/tags
3. Deletes the temporary index

Key components:
- find_oras_bin() for binary discovery using existing find_bin() pattern
- OrasManifestIndexCreate, OrasCopy, OrasManifestDelete command classes
- OrasMergeWorkflow orchestrator with from_image_target() factory method
- Source validation ensuring all sources are from the same repository

Includes 37 unit tests covering command construction, execution,
validation, workflow orchestration, and ImageTarget integration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix validate_sources validator to use image_target._get_merge_sources()
- Add sources property to expose merge sources from image target
- Fix from_image_target to pass target.labels instead of target.labels.items()
- Fix log statement to use self.sources instead of self.image_target.sources
- Add destination property to Tag model for grouping by registry/repository
- Group copy operations by destination for more efficient tag pushing
- Update tests to use mock ImageTarget fixtures

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ianpittwood ianpittwood marked this pull request as ready for review March 2, 2026 15:26
@ianpittwood ianpittwood requested a review from bschwedler as a code owner March 2, 2026 15:26
Base automatically changed from image-target-sub-objects to main March 2, 2026 22:10

:param ref: The image reference to parse (e.g., "registry.io/repo/image@sha256:digest").
:return: A tuple of (registry, repository, tag_or_digest).
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to put this logic co-located with the Tag model, or is this purely for string translation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did this as part of #365 since doing it here would cause a circular dependency.

Comment on lines +99 to +100
"ghcr.io/posit/test/tmp@sha256:amd64digest",
"ghcr.io/posit/test/tmp@sha256:arm64digest",
Copy link
Contributor

@bschwedler bschwedler Mar 2, 2026

Choose a reason for hiding this comment

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

nit: Our registries are under ghcr.io/posit-dev. I know these are just tests, but I don't want there to confusion for humans or LLMs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, they've been renamed.

@ianpittwood ianpittwood merged commit 7469db2 into main Mar 3, 2026
14 checks passed
@ianpittwood ianpittwood deleted the oras-oci-management branch March 3, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants