Skip to content

Commit

Permalink
Update docker-deploy.yaml and simplify requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkylok committed May 11, 2024
1 parent da73f39 commit 73a5586
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/docker-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Login to AWS ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
registry: advancedrag
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2

- name: Build Docker image
- name: Login to AWS ECR
uses: aws-actions/amazon-ecr-login@v2
with:
registry: advancedrag

- name: Build Docker image and push to ECR
run: |
docker build -t advancedrag/advanced-rag-image:latest .
docker push advancedrag/advanced-rag-image:latest
docker tag advancedrag/advanced-rag-image:latest ${{ steps.login-ecr.outputs.registry }}/advanced-rag-image:latest
docker push ${{ steps.login-ecr.outputs.registry }}/advanced-rag-image:latest
- name: SSH into EC2 instance
uses: appleboy/ssh-action@master
Expand All @@ -36,15 +40,9 @@ jobs:
key: ${{ secrets.EC2_PRIVATE_KEY }}
port: ${{ secrets.EC2_PORT }}
script: |
# Pull the latest Docker image from Amazon ECR
docker pull advancedrag/advanced-rag-image:latest
docker pull ${{ steps.login-ecr.outputs.registry }}/advanced-rag-image:latest
# Stop and remove the existing container (if exists)
docker stop advanced-rag-demo || true
docker rm advanced-rag-demo || true
# Run the new Docker container
docker run -d \
--name advanced-rag-demo \
-p 80:8501 \ # Example port mapping, adjust as needed
advancedrag/advanced-rag-image:latest
docker run -d --name advanced-rag-demo -p 80:8501 advancedrag/advanced-rag-image:latest
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ nltk==3.8.1
ollama==0.1.9
pandas==2.2.2
PyYAML==6.0.1
PyYAML==6.0.1
requests_aws4auth==1.2.3
streamlit==1.34.0
tqdm==4.65.0
tqdm==4.66.4

0 comments on commit 73a5586

Please sign in to comment.