Skip to content

use local image#1198

Merged
alexcos20 merged 1 commit intofeature/private_registryfrom
feature/use_local_images
Feb 6, 2026
Merged

use local image#1198
alexcos20 merged 1 commit intofeature/private_registryfrom
feature/use_local_images

Conversation

@alexcos20
Copy link
Member

@alexcos20 alexcos20 commented Feb 6, 2026

Fixes #1035

Changes proposed in this PR:

  • allow local images to be used in compute jobs

@alexcos20 alexcos20 self-assigned this Feb 6, 2026
@alexcos20
Copy link
Member Author

/run-security-scan

Copy link
Member Author

@alexcos20 alexcos20 left a comment

Choose a reason for hiding this comment

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

AI automated code review (Gemini 3).

Overall risk: low

Summary:
This pull request introduces a significant optimization to the checkDockerImage function in the C2D engine. It now prioritizes checking for Docker images locally on the compute node before falling back to querying remote registries. This change can improve performance by reducing network requests and enhance reliability by leveraging pre-pulled images. The local image check also includes platform validation (architecture and OS) to ensure compatibility. Comprehensive integration tests have been added to cover local image existence, platform matching/mismatching, and the fallback mechanism.

Comments:
• [INFO][style] The normalization of amd64 to x86_64 for the architecture is a good compatibility touch. It ensures consistency when checkManifestPlatform is called, assuming it expects x86_64 for AMD64 architectures. It might be helpful to add a small comment here explaining why this normalization is done, e.g., "Normalizing architecture for checkManifestPlatform compatibility."
• [INFO][style] The localErr is typed as any. While often acceptable for caught errors, consider if a more specific type like Error or Dockerode.DockerError could be used to improve type safety and provide better context in the catch block.
• [INFO][other] It's good that cleanup of test images is considered. The current comment ((commented out to avoid breaking other tests that might use these images)) clarifies the decision. If this is a persistent concern, consider making the test images unique or ensuring tests are isolated such that cleanup here doesn't impact others. For now, acknowledging the trade-off is fine.

@alexcos20 alexcos20 linked an issue Feb 6, 2026 that may be closed by this pull request
@alexcos20 alexcos20 marked this pull request as ready for review February 6, 2026 14:00
? checkManifestPlatform(localPlatform, platform)
: true

if (isValidPlatform) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we check remote for compatible images?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is only for local images. i am not sure if you can pull images for other architecture, so my guess would be if you have the image locally, it's compatible. but better to be sure and check it.

Copy link
Member Author

Choose a reason for hiding this comment

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

actually, you can pull image for another arhitecture..

You can force Docker to pull a specific architecture:

docker pull --platform linux/arm64 myimage:tag

Copy link
Contributor

@giurgiur99 giurgiur99 left a comment

Choose a reason for hiding this comment

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

LGTM

@alexcos20 alexcos20 merged commit 241e7ac into feature/private_registry Feb 6, 2026
9 checks passed
@alexcos20 alexcos20 deleted the feature/use_local_images branch February 6, 2026 15:02
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.

C2D: Using local images

2 participants