From 3bb4d87c94b2f005d01941ba32504cf146f57655 Mon Sep 17 00:00:00 2001 From: Dima Pristupa Date: Tue, 8 Oct 2024 15:35:31 +0300 Subject: [PATCH 1/3] Images, kamu-base-with-data-mt: add "kamu" to predefined users --- images/kamu-base-with-data-mt/extra/.kamuconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/images/kamu-base-with-data-mt/extra/.kamuconfig b/images/kamu-base-with-data-mt/extra/.kamuconfig index 046242971..68000e8f8 100644 --- a/images/kamu-base-with-data-mt/extra/.kamuconfig +++ b/images/kamu-base-with-data-mt/extra/.kamuconfig @@ -3,6 +3,9 @@ version: 1 content: users: predefined: + - accountName: kamu + isAdmin: true + avatarUrl: https://avatars.githubusercontent.com/u/50896974?s=200&v=4 - accountName: sh101-bowen avatarUrl: https://cdn-icons-png.flaticon.com/512/3118/3118054.png - accountName: sh102-gambier From 81ceb097483cac314734c262eb24c27a3b6f98fc Mon Sep 17 00:00:00 2001 From: Dima Pristupa Date: Tue, 8 Oct 2024 15:40:56 +0300 Subject: [PATCH 2/3] Images, kamu-base-with-data-mt: init-workspace.py use .kamuconfig --- .../kamu-base-with-data-mt/init-workspace.py | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/images/kamu-base-with-data-mt/init-workspace.py b/images/kamu-base-with-data-mt/init-workspace.py index 1d2b50a36..286c24ce4 100755 --- a/images/kamu-base-with-data-mt/init-workspace.py +++ b/images/kamu-base-with-data-mt/init-workspace.py @@ -1,48 +1,55 @@ #!/usr/bin/env python -import os -import sys +import shutil import subprocess +from pathlib import Path ############################################################################### +CURRENT_PATH = Path(__file__).resolve().parent S3_REPO_URL = "s3://datasets.kamu.dev/odf/v2/example-mt/" + ############################################################################### def s3_listdir(url): return [ line.strip().split(' ')[1] for line in subprocess.run( - f"aws s3 ls {url}", - shell=True, + f"aws s3 ls {url}", + shell=True, text=True, check=True, capture_output=True, ).stdout.splitlines() ] + def s3_cat(url): return subprocess.run( - f"aws s3 cp {url} -", - shell=True, + f"aws s3 cp {url} -", + shell=True, text=True, check=True, capture_output=True, ).stdout.strip() + ############################################################################### subprocess.run( - "kamu init --multi-tenant --exists-ok", + "kamu init --multi-tenant --exists-ok", shell=True, check=True, ) +shutil.copy(CURRENT_PATH / "extra/.kamuconfig", ".kamuconfig") + for did in s3_listdir(S3_REPO_URL): url = S3_REPO_URL + did alias = s3_cat(f"{S3_REPO_URL}{did}info/alias") account, name = alias.split('/', 1) + subprocess.run( f"kamu --account {account} pull --no-alias {url} --as {name}", shell=True, From dbb98eed492e634e9ca9ad91939d3d203f1a8e74 Mon Sep 17 00:00:00 2001 From: Dima Pristupa Date: Tue, 8 Oct 2024 15:54:45 +0300 Subject: [PATCH 3/3] CHANGELOG.md: update --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16c741342..4fd5d8503 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ Recommendation: for ease of reading, use the following order: - Updated our crate dependencies so they can be built in isolation ### Fixed - `--yes / -y` flag: fixed when working from a TTY +- CI: Fixes `kamu-base-with-data-mt` image builds ## [0.204.4] - 2024-09-30 ### Changed