feat(ST-3501): Add GAR support for DIND image pulling #797
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira: ST-3501
Before asking for review, check the following:
Note: This feature is DIND-only by design. No-DIND uses Kubernetes imagePullSecrets for registry authentication, which is a different mechanism.
In this PR I have...
Summary
Adds support for pulling component images from Google Artifact Registry (GAR) instead of AWS ECR in DIND mode. When enabled via environment variables, the
ImageFactoryroutesaws-ecrtype components to a newGoogleArtifactRegistryclass that handles URL transformation and GCP authentication.Key changes:
GoogleArtifactRegistryclass extendingImagewith GCP service account JSON key authenticationImageFactoryconditionally routes to GAR whenUSE_GAR_REGISTRY=trueand registry URLs are configuredEnvironment variables used:
USE_GAR_REGISTRY- flag to enable GAR (must be 'true')GAR_REGISTRY_URL- target GAR URL (e.g.,us-central1-docker.pkg.dev/project/ecr-cache)ECR_REGISTRY_URL- source ECR URL to replaceGOOGLE_APPLICATION_CREDENTIALS- path to GCP service account key fileUpdates since last revision
origin/mainto fix PR showing unrelated changes (the branch was originally based onorigin/masterwhich diverged frommain)main:ComponentSpecificationinstead of legacyComponentclassObjectEncryptordependency (no longer used in Image classes)Process::fromShellCommandline()patternpullImage()to use direct docker commands (matchingAWSElasticContainerRegistrypattern)getenv()returnsstring|false, so added proper type handling with?: ''fallback and explicit=== falsechecksReview & Testing Checklist for Human
getLoginParams()method reads the JSON key file content and passes it via--password=. Verify this works correctly with special characters in the key.str_replace()ingetImageId()assumes the ECR URL appears exactly once at the start. Verify this handles all ECR URL formats correctly.getenv()behavior: The code usesgetenv()directly inImageFactory. Confirm these env vars are properly propagated to the DIND runner pod.Test Plan
Notes
This is the docker-bundle portion of ST-3501. Related PRs:
Note: No unit tests are included in this PR. The existing test patterns in this codebase would need to be followed for proper test coverage.
Link to Devin run: https://app.devin.ai/sessions/554c0e412c984d4c8010abdae36e757d
Requested by: Martin Halamíček (@Halama)
Release Notes
Justification, description
Infrastructure support for GAR (Google Artifact Registry) in DIND job runner. Feature is disabled by default.
Plans for Customer Communication
N/A
Impact Analysis
No impact when disabled (default). When enabled, DIND jobs will pull component images from GAR instead of ECR.
Deployment Plan
Merge & automatic deploy. Feature requires explicit enablement via infrastructure configuration.
Rollback Plan
Revert of this PR.
Post-Release Support Plan
N/A