Skip to content

Commit

Permalink
feat(cli): switch default quickstart to v0.10.0 (datahub-project#7567)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored and shirshanka committed Mar 15, 2023
1 parent 18f387c commit c656ed7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 20 deletions.
49 changes: 31 additions & 18 deletions docker/quickstart/quickstart_version_mapping.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
# if --version is specified during CLI run
# the CLI will try to use the same docker-compose git ref and docker tags
# --version v0.x.y will use the v0.x.y tag for all images and the compose file from the v0.x.y git tag
# quickstart_version_map maps broken releases to fixed ones
# key is the broken release
# .composefile_git_ref: the git ref of the compose file to use
# .docker_tag: the docker tag to use
# if no version is specified the default key will be used
# This file is used by the CLI to map quickstart version "labels" to docker tags and git refs.
# It can also be used to override the defaults if master is broken, and to
# map broken releases to fixed ones.
#
# in case of --version stable the latest released version will be used (by querying the github api)
# the mapping for stable is not required, but can be used to override the latest release
# If --version is specified during CLI run:
# - If the version exists in this file, the details will be used.
# - The handling of `stable` is special. See below.
# - Otherwise, we'll assume that it represents a docker-compose git ref and docker tag.
# e.g. `--version v0.x.y` will use the v0.x.y tag for all images and the compose file from the v0.x.y git tag.
# - If no version is specified the "default" key will be used.
#
# This file can also be used to map broken releases to fixed ones.
# key is the broken release
# .composefile_git_ref: the git ref of the compose file to use
# .docker_tag: the docker tag to use
#
# In case `--version stable` is specified AND the stable key is not defined here,
# the latest released version will be used (by querying the github api)
# As such, the mapping for stable is not required, but can be used to override the latest release.
quickstart_version_map:
# default key is mandatory and is used if no version is specified
# in case of a broken release or broken master branch
# specify a working version here
# The "default" key is mandatory and is used if no version is specified.
# In case of a broken release or broken master branch, specify a working version here.
default:
composefile_git_ref: fd1bd51541a132017a648f4a2f037eec8f70ba26 # v0.10.0 + quickstart compose file fixes
docker_tag: v0.10.0

head:
composefile_git_ref: master
docker_tag: head
# v0.9.6 images contain security vulnerabilities
v0.9.6:

# v0.9.6 images contain security vulnerabilities
v0.9.6:
composefile_git_ref: v0.9.6.1
docker_tag: v0.9.6.1
# if stable is not defined the latest released version will be used
# stable:

# If stable is not defined the latest released version will be used.
# stable:
# composefile_git_ref: master
# docker_tag: head
# docker_tag: head
5 changes: 3 additions & 2 deletions metadata-ingestion/src/datahub/cli/docker_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,9 @@ def quickstart(
# Pull and possibly build the latest containers.
try:
if pull_images:
click.echo(
"Pulling docker images...This may take a while depending on your network bandwidth."
click.echo("Pulling docker images... ")
click.secho(
"This may take a while depending on your network bandwidth.", dim=True
)
with click_spinner.spinner():
subprocess.run(
Expand Down
11 changes: 11 additions & 0 deletions metadata-ingestion/src/datahub/cli/quickstart_versioning.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import logging
import os
import os.path
import re
from typing import Dict, Optional

Expand All @@ -12,6 +13,7 @@

logger = logging.getLogger(__name__)

LOCAL_QUICKSTART_MAPPING_FILE = os.environ.get("FORCE_LOCAL_QUICKSTART_MAPPING", "")
DEFAULT_LOCAL_CONFIG_PATH = "~/.datahub/quickstart/quickstart_version_mapping.yaml"
DEFAULT_REMOTE_CONFIG_PATH = "https://raw.githubusercontent.com/datahub-project/datahub/master/docker/quickstart/quickstart_version_mapping.yaml"

Expand Down Expand Up @@ -47,6 +49,15 @@ def _fetch_latest_version(cls) -> str:

@classmethod
def fetch_quickstart_config(cls) -> "QuickstartVersionMappingConfig":
if LOCAL_QUICKSTART_MAPPING_FILE:
logger.info(
"LOCAL_QUICKSTART_MAPPING_FILE is set, will try to read from local file."
)
path = os.path.expanduser(LOCAL_QUICKSTART_MAPPING_FILE)
with open(path, "r") as f:
config_raw = yaml.safe_load(f)
return cls.parse_obj(config_raw)

config_raw = None
try:
response = requests.get(DEFAULT_REMOTE_CONFIG_PATH, timeout=5)
Expand Down

0 comments on commit c656ed7

Please sign in to comment.