-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from snuhcs-course/dev
Merge dev into main
- Loading branch information
Showing
53 changed files
with
513 additions
and
24,328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Update ML Container | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
- feat/ML_server | ||
paths: | ||
- 'recommend/**' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Add SSH key for EC2 instance | ||
run: | | ||
mkdir -p ~/.ssh | ||
ssh-keyscan -H ${{ secrets.CLOUD_URL }} >> ~/.ssh/known_hosts | ||
- name: Transfer Recommendation Script | ||
run: | | ||
set +x | ||
echo "${{ secrets.PEM }}" > key.pem | ||
set -x | ||
chmod 600 key.pem | ||
scp -i ./"key.pem" -o StrictHostKeyChecking=no ./recommendation_pipeline.sh ec2-user@${{ secrets.CLOUD_URL }}:~ | ||
scp -i ./"key.pem" -o StrictHostKeyChecking=no ./cron_routine.sh ec2-user@${{ secrets.CLOUD_URL }}:~ | ||
chmod +x cron_routine.sh | ||
- name: Sync ML Code | ||
run: | | ||
set +x | ||
echo "${{ secrets.PEM }}" > key.pem | ||
set -x | ||
chmod 600 key.pem | ||
rsync -avz -e "ssh -o StrictHostKeyChecking=no -i ./key.pem" ./recommend/ ec2-user@${{ secrets.CLOUD_URL }}:/home/ec2-user/recommend/ | ||
- name: Restart ML Container & Mount Code | ||
run: | | ||
set +x | ||
echo "${{ secrets.PEM }}" > key.pem | ||
set -x | ||
chmod 600 key.pem | ||
ssh -i ./"key.pem" -o StrictHostKeyChecking=no ec2-user@${{ secrets.CLOUD_URL }} <<EOF | ||
docker stop ml-container | ||
docker rm ml-container | ||
docker run -d --name ml-container -v /home/ec2-user/recommend:/app -v shared-volume:/mlvolume "${{ secrets.DOCKER_USERNAME }}/ml-image:latest" tail -f /dev/null | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.