Skip to content

registry: update example to include AWS provider usage#329

Open
iamabhilaksh wants to merge 2 commits intosalesforce:mainfrom
iamabhilaksh:registry/update-example-for-aws
Open

registry: update example to include AWS provider usage#329
iamabhilaksh wants to merge 2 commits intosalesforce:mainfrom
iamabhilaksh:registry/update-example-for-aws

Conversation

@iamabhilaksh
Copy link
Contributor

@iamabhilaksh iamabhilaksh commented Mar 5, 2026

registry: update example to include AWS provider usage

Updates the registry Main.java example to support AWS ECR in addition to GCP.

Changes

  • Main.java — added REGION constant; replaced hardcoded GCP-specific endpoint and repository with generic placeholders; passed withRegion() to ContainerRegistryClient builder calls.
  • examples/pom.xml — added registry-aws dependency.

Note

This PR depends on the AWS registry implementation PR #324 being merged first.


Registry Demo Testing Details

Overview

Main.java in examples/src/main/java/com/salesforce/multicloudj/registry/Main.java was tested
end-to-end for AWS ECR.


AWS Test Run

Inputs

Parameter Value
DEFAULT_PROVIDER aws
REGISTRY_ENDPOINT https://654654370895.dkr.ecr.us-east-1.amazonaws.com
REPOSITORY test-registry
TAG latest
REGION us-east-1

AWS credentials were supplied via environment variables:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_SESSION_TOKEN

Command

AWS_ACCESS_KEY_ID=<redacted> \
AWS_SECRET_ACCESS_KEY=<redacted> \
AWS_SESSION_TOKEN=<redacted> \
mvn exec:java -pl examples -Dexec.mainClass="com.salesforce.multicloudj.registry.Main" -Dexec.args="aws"

Console Output

╔══════════════════════════════════════════════════════════════════════════════╗
║           🚀 MultiCloudJ Container Registry Demo 🚀                        ║
║             Cross-Cloud Container Registry Operations                       ║
╚══════════════════════════════════════════════════════════════════════════════╝
📋 Configuration:
   Provider:   aws
   Endpoint:   https://654654370895.dkr.ecr.us-east-1.amazonaws.com
   Repository: test-registry
   Tag:        latest
Press Enter to start the demo...ℹ️  Starting Registry demo with provider: aws
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 Pull Image by Tag
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Press Enter to start this section...ℹ️  Pulling image: test-registry:latest
✅ Image pulled:
ℹ️    Image ref: test-registry:latest
ℹ️    Digest:    sha256:1529d13528ed05668b2038ffab807ac8633ad6adfe6be8901adda62411f70d29
ℹ️  Accessing layers (triggers blob downloads)...
✅ Layers loaded: 1
ℹ️    Layer 1: sha256:d8ad8cd72600f46cc068e16c39046ebc76526e41051f43a8c249884b200936c0
Press Enter to continue...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 Pull Image by Digest
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Press Enter to start this section...ℹ️  First, pulling by tag to obtain digest: test-registry:latest
✅ Obtained digest: sha256:1529d13528ed05668b2038ffab807ac8633ad6adfe6be8901adda62411f70d29
ℹ️  Pulling by digest: test-registry@sha256:1529d13528ed05668b2038ffab807ac8633ad6adfe6be8901adda62411f70d29
✅ Image pulled by digest:
ℹ️    Digest: sha256:1529d13528ed05668b2038ffab807ac8633ad6adfe6be8901adda62411f70d29
✅ Digest verified — same image content guaranteed
Press Enter to continue...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 Platform Selection (Multi-Arch)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Press Enter to start this section...ℹ️  Pulling with default platform (linux/amd64)...
✅ Pulled with default platform: sha256:1529d13528ed05668b2038ffab807ac8633ad6adfe6be8901adda62411f70d29
ℹ️  Pulling with explicit linux/arm64 platform...
✅ Pulled linux/arm64 image: sha256:1529d13528ed05668b2038ffab807ac8633ad6adfe6be8901adda62411f70d29
Press Enter to continue...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 Extract Image Filesystem
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Press Enter to start this section...ℹ️  Pulling image and extracting filesystem: test-registry:latest
✅ Image pulled: sha256:1529d13528ed05668b2038ffab807ac8633ad6adfe6be8901adda62411f70d29
ℹ️  Extracting flattened filesystem as tar stream...
✅ Filesystem tar stream opened, first block read: 512 bytes
Press Enter to continue to error handling...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 Error Handling
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Press Enter to start this section...ℹ️  Pulling a non-existent tag (expect ResourceNotFoundException)...
✅ Correctly caught ResourceNotFoundException: com.salesforce.multicloudj.common.exceptions.ResourceNotFoundException: Failed to fetch manifest for...
ℹ️  Pulling with a blank image reference (expect InvalidArgumentException)...
✅ Correctly caught InvalidArgumentException: com.salesforce.multicloudj.common.exceptions.InvalidArgumentException: Image reference cannot be null or empty
ℹ️  Building client without registry endpoint (expect InvalidArgumentException)...
✅ Correctly caught InvalidArgumentException: Registry endpoint is required for AWS ECR
✅ Registry demo completed successfully!
╔══════════════════════════════════════════════════════════════════════════════╗
║                    ✅ Demo Completed Successfully! ✅                       ║
║                    Thanks for trying MultiCloudJ!                          ║
╚══════════════════════════════════════════════════════════════════════════════╝
Press Enter to exit...

Result: ✅ ALL SECTIONS PASSED

@iamabhilaksh
Copy link
Contributor Author

Build is failing because some of the code changes it requires are in a separate PR #324. Once the PR #324 is merged, will update the branch and build should succeed then :)

@iamabhilaksh iamabhilaksh force-pushed the registry/update-example-for-aws branch from 4b4e2a8 to cd863b6 Compare March 10, 2026 09:43
Add registry-aws dependency to examples/pom.xml. Update Main.java to use
generic placeholder endpoints, add REGION constant, and pass withRegion()
to the client builder to support running the example with AWS ECR.

Made-with: Cursor
@iamabhilaksh iamabhilaksh force-pushed the registry/update-example-for-aws branch from cd863b6 to 880f6d4 Compare March 10, 2026 15:48
Made-with: Cursor
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.36%. Comparing base (03f6a8c) to head (1a0133a).

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #329      +/-   ##
============================================
- Coverage     82.36%   82.36%   -0.01%     
  Complexity      625      625              
============================================
  Files           191      191              
  Lines         11503    11503              
  Branches       1525     1525              
============================================
- Hits           9475     9474       -1     
- Misses         1357     1358       +1     
  Partials        671      671              
Flag Coverage Δ
unittests 82.36% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

4 participants