Skip to content

Commit 0deb0d6

Browse files
author
mo
committed
k8s: avoid non-empty clone dir by cloning code to /app/src; mount PVC at /data; use absolute /data paths
1 parent f655dd7 commit 0deb0d6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

k8s-prepare-job.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
- |
1616
set -eu
1717
apt-get update && apt-get install -y git
18-
mkdir -p /app/repo && cd /app/repo
18+
mkdir -p /app/src && cd /app/src
1919
git clone https://github.com/david-thrower/cerebros-core-algorithm-alpha.git .
2020
git fetch origin 208-refactor-nlp-example-to-tokenize-first
2121
git checkout 208-refactor-nlp-example-to-tokenize-first
@@ -24,7 +24,7 @@ spec:
2424
PIP_BREAK_SYSTEM_PACKAGES=1 python -m pip install --no-cache-dir --break-system-packages -r cicd-requirements.txt
2525
PIP_BREAK_SYSTEM_PACKAGES=1 python -m pip install --no-cache-dir --break-system-packages mlflow transformers
2626
python tokenize_first_runner.py --mode prepare \
27-
--out data/train_tokens.npz --max_len 128 \
27+
--out /data/train_tokens.npz --max_len 128 \
2828
--tokenizer_checkpoint HuggingFaceTB/SmolLM3-3B
2929
env:
3030
- name: MLFLOW_TRACKING_URI
@@ -35,7 +35,7 @@ spec:
3535
value: "1"
3636
volumeMounts:
3737
- name: data-storage
38-
mountPath: /app/repo/data
38+
mountPath: /data
3939
resources:
4040
requests:
4141
memory: "4Gi"

k8s-train-job.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
- |
1616
set -eu
1717
apt-get update && apt-get install -y git
18-
mkdir -p /app/repo && cd /app/repo
18+
mkdir -p /app/src && cd /app/src
1919
git clone https://github.com/david-thrower/cerebros-core-algorithm-alpha.git .
2020
git fetch origin 208-refactor-nlp-example-to-tokenize-first
2121
git checkout 208-refactor-nlp-example-to-tokenize-first
@@ -24,7 +24,7 @@ spec:
2424
PIP_BREAK_SYSTEM_PACKAGES=1 python -m pip install --no-cache-dir --break-system-packages -r cicd-requirements.txt
2525
PIP_BREAK_SYSTEM_PACKAGES=1 python -m pip install --no-cache-dir --break-system-packages mlflow transformers
2626
python tokenize_first_runner.py --mode train \
27-
--cache data/train_tokens.npz --epochs 1 --batch 8 --print-score-only
27+
--cache /data/train_tokens.npz --epochs 1 --batch 8 --print-score-only
2828
env:
2929
- name: MLFLOW_TRACKING_URI
3030
value: "http://mlflow-service:5000"
@@ -34,7 +34,7 @@ spec:
3434
value: "1"
3535
volumeMounts:
3636
- name: data-storage
37-
mountPath: /app/repo/data
37+
mountPath: /data
3838
resources:
3939
requests:
4040
memory: "6Gi"

0 commit comments

Comments
 (0)