From 6d8f8912f69a8d278252a8e0522907c0310eea7b Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Thu, 29 Dec 2022 18:22:57 +0000 Subject: [PATCH 1/2] fix(cli): Make datahub quickstart work with latest docker compose in M1 --- metadata-ingestion/src/datahub/cli/docker_cli.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/metadata-ingestion/src/datahub/cli/docker_cli.py b/metadata-ingestion/src/datahub/cli/docker_cli.py index cb9d8a89d03f7..e4d939a5c570c 100644 --- a/metadata-ingestion/src/datahub/cli/docker_cli.py +++ b/metadata-ingestion/src/datahub/cli/docker_cli.py @@ -71,15 +71,8 @@ class Architectures(Enum): @functools.lru_cache() def _docker_subprocess_env() -> Dict[str, str]: - try: - DOCKER_COMPOSE_PLATFORM: Optional[str] = ( - subprocess.run(["uname", "-m"], stdout=subprocess.PIPE) - .stdout.decode("utf-8") - .rstrip() - ) - except FileNotFoundError: - # On Windows, uname is not available. - DOCKER_COMPOSE_PLATFORM = None + # platform.machine() saves a subprocess here and works on windows, too + DOCKER_COMPOSE_PLATFORM: str = "linux/" + platform.machine() env = { **os.environ, From ecb672385f7ae226891beb6a9f477718517bcb06 Mon Sep 17 00:00:00 2001 From: Harshal Sheth Date: Thu, 29 Dec 2022 13:45:36 -0500 Subject: [PATCH 2/2] Update metadata-ingestion/src/datahub/cli/docker_cli.py --- metadata-ingestion/src/datahub/cli/docker_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata-ingestion/src/datahub/cli/docker_cli.py b/metadata-ingestion/src/datahub/cli/docker_cli.py index e4d939a5c570c..7bbd7577b5880 100644 --- a/metadata-ingestion/src/datahub/cli/docker_cli.py +++ b/metadata-ingestion/src/datahub/cli/docker_cli.py @@ -71,7 +71,7 @@ class Architectures(Enum): @functools.lru_cache() def _docker_subprocess_env() -> Dict[str, str]: - # platform.machine() saves a subprocess here and works on windows, too + # platform.machine() is equivalent to `uname -m`, as per https://stackoverflow.com/a/45124927/5004662 DOCKER_COMPOSE_PLATFORM: str = "linux/" + platform.machine() env = {