Skip to content

feat: add regionless image resolver to envhub SDK#1173

Open
jake11-oho wants to merge 3 commits into
alibaba:masterfrom
jake11-oho:feat/regionless-resolver
Open

feat: add regionless image resolver to envhub SDK#1173
jake11-oho wants to merge 3 commits into
alibaba:masterfrom
jake11-oho:feat/regionless-resolver

Conversation

@jake11-oho

Copy link
Copy Markdown
Collaborator

Summary

  • Migrate RockRegistryResolver from harbor to rock.sdk.envhub.regionless as SDK standard capability
  • Add compose file support: resolve_compose rewrites image: fields, compose_pull wraps resolve + docker compose pull
  • 43 unit tests covering resolver (35) and compose (8) — caching, multi-registry fallthrough, timeout fallback, digest-pinned skip, Dockerfile rewrite, compose dedup, pull failure propagation

Fixes #1172

Test plan

  • uv run pytest tests/unit/envhub/regionless/ -v — 43/43 passed
  • uv run ruff check + uv run ruff format --check — clean
  • Full fast test suite (uv run pytest -m "not need_ray and not need_admin and not need_admin_and_network") — 1622 passed, 1 pre-existing failure (unrelated test_disk_statistics)

🤖 Generated with Claude Code

@jake11-oho jake11-oho force-pushed the feat/regionless-resolver branch from 76bce36 to 033e52d Compare June 30, 2026 12:24
Comment thread rock/sdk/envhub/regionless/compose.py Outdated
_default_resolver = RockRegistryResolver()


async def resolve_compose(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

封装到类,尽量别写这种无头函数。

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@jake11-oho jake11-oho force-pushed the feat/regionless-resolver branch from 81d4daa to 649fbad Compare July 6, 2026 06:15
jake11-oho and others added 3 commits July 6, 2026 08:10
Add RockRegistryResolver that rewrites container image references to ROCK
mirror registries. Supports multi-registry fallback, original-namespace-first
probe strategy, Bearer token auth, and in-process caching.

DockerClient unifies regionless resolution with Docker CLI operations
(pull, build, push, login, mirror) behind a single async entry point.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move buildx_build/push_image_tag to DockerUtil, removing DockerClient's
  dependency on rock.sdk.builder.provider.docker.DockerCommand
- Privatize RockRegistryResolver helper methods (parse_registries,
  split_tag_or_digest, build_candidate, build_candidate_with_original_namespace)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…y.py

Admin and SDK both implemented nearly identical Docker Registry v2
manifest probe code (Bearer auth, image parsing, candidate building,
caching). Extract the shared logic into rock/utils/registry.py to
eliminate ~170 lines of duplication while preserving each side's
specific behavior (admin: HttpPoolManager + allowlist + credentials,
SDK: env-var config + resolve-level cache + Dockerfile rewriting).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jake11-oho jake11-oho force-pushed the feat/regionless-resolver branch from 649fbad to c039fcb Compare July 6, 2026 08:39
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.

feat: add regionless image resolver to envhub SDK

2 participants