feat: add container_registry_auth_id to create_pod#506
Conversation
|
Promptless prepared a documentation update related to this change. Triggered by runpod/runpod-python PR #506 Added a new "Use a private container registry" section documenting the |
There was a problem hiding this comment.
Pull request overview
Adds support for deploying GPU pods that can pull private container images by exposing a container_registry_auth_id option on the public create_pod API and threading it through to the podFindAndDeployOnDemand GraphQL mutation as containerRegistryAuthId.
Changes:
- Add
container_registry_auth_idoptional parameter torunpod.create_pod(...). - Extend
generate_pod_deployment_mutation(...)to includecontainerRegistryAuthIdfor GPU pods when provided. - Add a unit test case asserting the new mutation field is present when requested and absent otherwise.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/test_api/test_mutations_pods.py | Adds coverage for the new containerRegistryAuthId mutation field. |
| runpod/api/mutations/pods.py | Threads container_registry_auth_id into the GPU pod deployment mutation input. |
| runpod/api/ctl_commands.py | Exposes container_registry_auth_id on the public create_pod API and passes it into the mutation generator. |
Comments suppressed due to low confidence (1)
tests/test_api/test_mutations_pods.py:50
- Same issue as above for the CPU mutation test:
cloud_type="cloud"is not a supported value per the public API validation/documentation, and the mutation generator emits it as a GraphQL enum (unquoted). Update the test to use a valid enum value.
# Test CPU pod deployment
cpu_result = pods.generate_pod_deployment_mutation(
name="test-cpu",
image_name="test_image",
cloud_type="cloud",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| image_name="test_image", | ||
| gpu_type_id="1", | ||
| cloud_type="cloud", |
| if container_registry_auth_id is not None: | ||
| input_fields.append(f'containerRegistryAuthId: "{container_registry_auth_id}"') | ||
|
|
| min_download, | ||
| min_upload, | ||
| instance_id, | ||
| container_registry_auth_id, |
container_registry_auth_idas an optional parameter tocreate_pod.containerRegistryAuthIdin thepodFindAndDeployOnDemandGraphQL mutation, enabling pods to pull images from private container registries.run_graphql_querydirectly.UV_PYTHON=3.12 make setup && UV_PYTHON=3.12 make test