Skip to content

Commit 7c4f4dd

Browse files
committed
update workflow
1 parent 350b0d1 commit 7c4f4dd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/ec2-pipeline.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,22 +146,23 @@ jobs:
146146
- name: Run DVC commands in container
147147
run: |
148148
mkdir model_storage
149-
touch best_model_checkpoint.txt
150149
docker run --rm --gpus=all \
151150
-v model_storage:/workspace/model_storage \
152-
-v best_model_checkpoint.txt:/workspace/best_model_checkpoint.txt \
153151
-e AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
154152
-e AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
155153
-e AWS_DEFAULT_REGION=${{ secrets.AWS_REGION }} \
156154
${{ secrets.AWS_ECR_LOGIN_URI }}/${{ secrets.ECR_REPOSITORY_NAME }}:latest \
157155
/bin/bash -c "
158156
dvc pull -r myremote && \
159157
mkdir model_storage && \
160-
dvc repro -f
158+
dvc repro -f && \
159+
cp best_model_checkpoint.txt model_storage/
161160
"
162161
163162
# # Wait a moment to ensure the container has started
164163
# sleep 5
164+
165+
ls model_storage/
165166
166167
# # Print logs from the container
167168
# docker logs $CONTAINER_ID
@@ -172,7 +173,7 @@ jobs:
172173
- name: Read best checkpoint file name
173174
id: read_checkpoint
174175
run: |
175-
checkpoint_file=$(head -n 1 best_model_checkpoint.txt)
176+
checkpoint_file=$(head -n 1 model_storage/best_model_checkpoint.txt)
176177
echo "CHECKPOINT_FILE=$checkpoint_file" >> $GITHUB_ENV
177178
178179
- name: Get latest commit ID

0 commit comments

Comments
 (0)