Skip to content

feat(admin): add image config with ACR temporary token support#1101

Open
Issac-Newton wants to merge 1 commit into
alibaba:masterfrom
Issac-Newton:feature/acr-image-config
Open

feat(admin): add image config with ACR temporary token support#1101
Issac-Newton wants to merge 1 commit into
alibaba:masterfrom
Issac-Newton:feature/acr-image-config

Conversation

@Issac-Newton

@Issac-Newton Issac-Newton commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add ImageRegistryConfig, ImageBuilderConfig, ImageConfig dataclasses to centralize image registry and builder configuration in YAML config files
  • Add get_client_config() to SandboxProxyService as a general backend config aggregator for SDK clients, with _gen_image_config() as the first config section using Alibaba Cloud ACR GetAuthorizationToken API for temporary credentials (15-min TTL)
  • Expose via GET /client_config endpoint — returns a dict of config sections (currently image), extensible for future sections

refs #1102

Test plan

  • TestGetClientConfig — 3 unit tests: success with credentials, ACR failure omits image section, no client omits image section
  • uv run pytest tests/unit/sandbox/test_sandbox_proxy.py::TestGetClientConfig -v

🤖 Generated with Claude Code

Issac-Newton added a commit to Issac-Newton/ROCK that referenced this pull request Jun 12, 2026
…vars

Remove ROCK_IMAGE_REGISTRY/NAMESPACE/USERNAME/PASSWORD/BUILDER_IMAGE env vars
from SDK defaults. ImageRegistry and BuilderConfig fields now default to None.
Sandbox._resolve_image() fetches /image_config from admin to fill registry URL,
namespace, credentials (temporary ACR tokens), and builder settings. Explicit
user-provided values still take precedence over admin defaults.

Depends on: alibaba#1101 (ACR image config infrastructure)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Issac-Newton Issac-Newton force-pushed the feature/acr-image-config branch from 423985d to 8acab08 Compare June 12, 2026 09:01
@Issac-Newton Issac-Newton force-pushed the feature/acr-image-config branch 5 times, most recently from e398eab to edd681b Compare June 12, 2026 12:12
Add AcrConfig (registry + builder_image) dataclasses, GET /acr_config
API returning temporary ACR credentials via GetAuthorizationToken, and
aliyun-python-sdk-cr as an explicit admin dependency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Issac-Newton Issac-Newton force-pushed the feature/acr-image-config branch from edd681b to e2b6cca Compare June 15, 2026 07:24
return RockResponse(result=result)


@sandbox_proxy_router.get("/acr_config")

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.

改成restful风格的api

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