Skip to content

feat(ingest): add --no-pull-images option to docker quickstart #6017

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Sep 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions metadata-ingestion/src/datahub/cli/docker_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,13 @@ def _restore(
default=False,
help="Attempt to build the containers locally before starting",
)
@click.option(
"--pull-images/--no-pull-images",
type=bool,
is_flag=True,
default=True,
help="Attempt to pull the containers from Docker Hub before starting",
)
@click.option(
"-f",
"--quickstart-compose-file",
Expand Down Expand Up @@ -516,6 +523,7 @@ def _restore(
def quickstart(
version: str,
build_locally: bool,
pull_images: bool,
quickstart_compose_file: List[pathlib.Path],
dump_logs_on_failure: bool,
graph_service_impl: Optional[str],
Expand Down Expand Up @@ -657,13 +665,14 @@ def quickstart(

# Pull and possibly build the latest containers.
try:
click.echo("Pulling docker images...")
subprocess.run(
[*base_command, "pull", "-q"],
check=True,
env=_docker_subprocess_env(),
)
click.secho("Finished pulling docker images!")
if pull_images:
click.echo("Pulling docker images...")
subprocess.run(
[*base_command, "pull", "-q"],
check=True,
env=_docker_subprocess_env(),
)
click.secho("Finished pulling docker images!")
except subprocess.CalledProcessError:
click.secho(
"Error while pulling images. Going to attempt to move on to docker compose up assuming the images have "
Expand Down