Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ajithvcoder committed Nov 4, 2024
1 parent 350b0d1 commit 7c4f4dd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ec2-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,23 @@ jobs:
- name: Run DVC commands in container
run: |
mkdir model_storage
touch best_model_checkpoint.txt
docker run --rm --gpus=all \
-v model_storage:/workspace/model_storage \
-v best_model_checkpoint.txt:/workspace/best_model_checkpoint.txt \
-e AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
-e AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
-e AWS_DEFAULT_REGION=${{ secrets.AWS_REGION }} \
${{ secrets.AWS_ECR_LOGIN_URI }}/${{ secrets.ECR_REPOSITORY_NAME }}:latest \
/bin/bash -c "
dvc pull -r myremote && \
mkdir model_storage && \
dvc repro -f
dvc repro -f && \
cp best_model_checkpoint.txt model_storage/
"
# # Wait a moment to ensure the container has started
# sleep 5
ls model_storage/
# # Print logs from the container
# docker logs $CONTAINER_ID
Expand All @@ -172,7 +173,7 @@ jobs:
- name: Read best checkpoint file name
id: read_checkpoint
run: |
checkpoint_file=$(head -n 1 best_model_checkpoint.txt)
checkpoint_file=$(head -n 1 model_storage/best_model_checkpoint.txt)
echo "CHECKPOINT_FILE=$checkpoint_file" >> $GITHUB_ENV
- name: Get latest commit ID
Expand Down

0 comments on commit 7c4f4dd

Please sign in to comment.