-
Notifications
You must be signed in to change notification settings - Fork 592
[CLI] feat: add image selection and fix tests #5024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,8 +20,15 @@ | |
| import docker | ||
|
|
||
| # TODO: Make this configurable. | ||
| DOCKER_IMAGE = ("gcr.io/clusterfuzz-images/chromium/base/immutable/dev:" | ||
| "20251008165901-utc-893e97e-640142509185-compute-d609115-prod") | ||
| DOCKER_IMAGES = { | ||
| 'dev': ("gcr.io/clusterfuzz-images/chromium/base/immutable/dev:" | ||
| "20251008165901-utc-893e97e-640142509185-compute-d609115-prod"), | ||
| 'internal': ( | ||
| "gcr.io/clusterfuzz-images/chromium/base/immutable/internal:" | ||
| "20251110132749-utc-363160d-640142509185-compute-c7f2f8c-prod"), | ||
| 'external': ("gcr.io/clusterfuzz-images/base/immutable/external:" | ||
| "20251111191918-utc-b5863ff-640142509185-compute-c5c296c-prod") | ||
| } | ||
|
|
||
|
|
||
| def check_docker_setup() -> docker.client.DockerClient | None: | ||
|
|
@@ -52,16 +59,17 @@ def check_docker_setup() -> docker.client.DockerClient | None: | |
| return None | ||
|
|
||
|
|
||
| def pull_image() -> bool: | ||
| def pull_image(image: str = 'internal') -> bool: | ||
|
||
| """Pulls the docker image.""" | ||
| client = check_docker_setup() | ||
| if not client: | ||
| return False | ||
|
|
||
| try: | ||
| click.echo(f'Pulling Docker image: {DOCKER_IMAGE}...') | ||
| client.images.pull(DOCKER_IMAGE) | ||
| click.echo(f'Pulling Docker image: {DOCKER_IMAGES[image]}...') | ||
| client.images.pull(DOCKER_IMAGES[image]) | ||
| return True | ||
| except docker.errors.DockerException: | ||
| click.secho(f'Error: Docker image {DOCKER_IMAGE} not found.', fg='red') | ||
| click.secho( | ||
| f'Error: Docker image {DOCKER_IMAGES[image]} not found.', fg='red') | ||
| return False | ||
Uh oh!
There was an error while loading. Please reload this page.