Skip to content
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

CI: Fixes kamu-base-with-data-mt image builds #885

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions images/kamu-base-with-data-mt/extra/.kamuconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 14 additions & 7 deletions images/kamu-base-with-data-mt/init-workspace.py
Original file line number Diff line number Diff line change
@@ -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/"


zaychenko-sergei marked this conversation as resolved.
Show resolved Hide resolved
###############################################################################

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")
s373r marked this conversation as resolved.
Show resolved Hide resolved

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,
Expand Down