Skip to content

Commit 90d5b6f

Browse files
committed
refactor: align aspects folder structure
(cherry picked from commit 3e26d3c)
1 parent f1e79fe commit 90d5b6f

File tree

9 files changed

+26
-14
lines changed

9 files changed

+26
-14
lines changed

tutoraspects/patches/k8s-jobs

+7-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ spec:
1919
allowPrivilegeEscalation: false
2020
runAsUser: 0
2121
volumeMounts:
22-
- mountPath: /app/aspects/scripts
23-
name: scripts
22+
- mountPath: /app/aspects/dbt
23+
name: dbt
24+
- mountPath: /app/aspects/scripts
25+
name: scripts
2426
volumes:
2527
- name: scripts
2628
configMap:
2729
name: aspects-scripts
30+
- name: dbt
31+
configMap:
32+
name: aspects-dbt
2833
---
2934
apiVersion: batch/v1
3035
kind: Job

tutoraspects/patches/kustomization-configmapgenerator

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
- name: aspects-scripts
2-
files:{% for file in "aspects/apps/scripts"|walk_templates %}
2+
files:{% for file in "aspects/apps/aspects/scripts"|walk_templates %}
33
- plugins/{{ file }}{% endfor %}
44
options:
55
labels:
66
app.kubernetes.io/name: aspects
7+
- name: aspects-dbt
8+
files:{% for file in "aspects/apps/aspects/dbt"|walk_templates %}
9+
- plugins/{{ file }}{% endfor %}
10+
options:
11+
labels:
12+
app.kubernetes.io/name: aspects
13+
714
{% if RUN_CLICKHOUSE %}
815
- name: clickhouse-settings
916
files:

tutoraspects/patches/local-docker-compose-jobs-services

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ aspects-job:
22
user: root
33
image: {{ DOCKER_IMAGE_ASPECTS }}
44
volumes:
5-
- ../../env/plugins/aspects/apps:/app/aspects
5+
- ../../env/plugins/aspects/apps/aspects:/app/aspects
66
depends_on:
77
- superset {% if RUN_CLICKHOUSE%}
88
- clickhouse{% endif %}

tutoraspects/plugin.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,9 @@ def load_xapi_test_data(num_batches: int, batch_size: int) -> list[tuple[str, st
432432
(
433433
"aspects",
434434
"echo 'Making demo xapi script executable...' && "
435-
"chmod +x /app/aspects/scripts/aspects/clickhouse-demo-xapi-data.sh && "
435+
"chmod +x /app/aspects/scripts/clickhouse-demo-xapi-data.sh && "
436436
"echo 'Done. Running script...' && "
437-
f"bash /app/aspects/scripts/aspects/clickhouse-demo-xapi-data.sh {num_batches}"
437+
f"bash /app/aspects/scripts/clickhouse-demo-xapi-data.sh {num_batches}"
438438
f" {batch_size} && "
439439
"echo 'Done!';",
440440
),
@@ -467,9 +467,9 @@ def dbt(command: string) -> list[tuple[str, str]]:
467467
(
468468
"aspects",
469469
"echo 'Making dbt script executable...' && "
470-
"chmod +x /app/aspects/scripts/aspects/dbt.sh && "
470+
"chmod +x /app/aspects/scripts/dbt.sh && "
471471
f"echo 'Running dbt {command}' && "
472-
f"bash /app/aspects/scripts/aspects/dbt.sh {command} && "
472+
f"bash /app/aspects/scripts/dbt.sh {command} && "
473473
"echo 'Done!';",
474474
),
475475
]

tutoraspects/templates/aspects/apps/scripts/aspects/dbt.sh tutoraspects/templates/aspects/apps/aspects/scripts/dbt.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ python3 -m venv virtualenv
55

66
echo "Installing dbt packages..."
77

8-
pip install -r requirements.txt
8+
pip install -r /app/aspects/dbt/requirements.txt
99

1010
echo "Installing aspects-dbt"
1111
git clone -b {{ DBT_BRANCH }} {{ DBT_REPOSITORY }}
1212

1313
cd {{ DBT_REPOSITORY_PATH }} || exit
1414

1515
echo "Installing dbt dependencies"
16-
dbt deps --profiles-dir /app/aspects/scripts/aspects/
16+
dbt deps --profiles-dir /app/aspects/dbt/
1717

1818
echo "Running dbt $*"
19-
dbt "$@" --profiles-dir /app/aspects/scripts/aspects/
19+
dbt "$@" --profiles-dir /app/aspects/dbt/

tutoraspects/templates/aspects/jobs/init/dbt/init-dbt.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ python3 -m venv virtualenv
55

66
echo "Installing dbt packages..."
77

8-
pip install -r /app/aspects/scripts/aspects/requirements.txt
8+
pip install -r /app/aspects/dbt/requirements.txt
99

1010
echo "Installing aspects-dbt"
1111
git clone -b {{ DBT_BRANCH }} {{ DBT_REPOSITORY }}
1212

1313
cd {{ DBT_REPOSITORY_PATH }} || exit
1414

1515
echo "Installing dbt dependencies"
16-
dbt deps --profiles-dir /app/aspects/scripts/aspects/
16+
dbt deps --profiles-dir /app/aspects/dbt/
1717

1818
echo "Running dbt"
19-
dbt run --profiles-dir /app/aspects/scripts/aspects/
19+
dbt run --profiles-dir /app/aspects/dbt/

0 commit comments

Comments
 (0)