Skip to content

Commit adc60ab

Browse files
committed
add ./README.md ./SETUP.md
1 parent c82a477 commit adc60ab

8 files changed

Lines changed: 538 additions & 119 deletions

File tree

.dockerignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Include any files or directories that you don't want to be copied to your
2+
# container here (e.g., local build artifacts, temporary files, etc.).
3+
#
4+
# For more help, visit the .dockerignore file reference guide at
5+
# https://docs.docker.com/go/build-context-dockerignore/
6+
7+
**/.DS_Store
8+
**/__pycache__
9+
**/.venv
10+
**/.classpath
11+
**/.dockerignore
12+
**/.env
13+
**/.git
14+
**/.gitignore
15+
**/.project
16+
**/.settings
17+
**/.toolstarget
18+
**/.vs
19+
**/.vscode
20+
**/*.*proj.user
21+
**/*.dbmdl
22+
**/*.jfm
23+
**/bin
24+
**/charts
25+
**/docker-compose*
26+
**/compose.y*ml
27+
**/Dockerfile*
28+
**/node_modules
29+
**/npm-debug.log
30+
**/obj
31+
**/secrets.dev.yaml
32+
**/values.dev.yaml
33+
LICENSE
34+
README.md
35+
**/.aws

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
BUCKET_NAME=your-bucket-name
2+
AWS_REGION=us-east-1 #default
3+
AWS_ACCESS_KEY_ID=your-aws-access-key-id
4+
AWS_SECRET_ACCESS_KEY=your-aws-secret-access-key

.gitattributes

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 88 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,104 @@
1-
name: CI/CD Pipeline
2-
on:
3-
push:
4-
branches:
5-
- main
6-
workflow_dispatch:
1+
# name: CI/CD Pipeline
2+
# on:
3+
# push:
4+
# branches:
5+
# - main
6+
# workflow_dispatch:
77

8-
env:
9-
AWS_REGION: us-east-1
10-
ECR_REPOSITORY: sentiment-analysis-api
8+
# env:
9+
# AWS_REGION: us-east-1
10+
# ECR_REPOSITORY: sentiment-analysis-api
1111

12-
jobs:
13-
build-and-push:
14-
name: Build and Push to ECR
15-
runs-on: ubuntu-latest
16-
outputs:
17-
image: ${{ steps.build-image.outputs.image }}
12+
# jobs:
13+
# build-and-push:
14+
# name: Build and Push to ECR
15+
# runs-on: ubuntu-latest
16+
# outputs:
17+
# image: ${{ steps.build-image.outputs.image }}
1818

19-
steps:
20-
- name: Checkout code
21-
uses: actions/checkout@v3
19+
# steps:
20+
# - name: Checkout code
21+
# uses: actions/checkout@v3
2222

23-
- name: Configure AWS credentials
24-
uses: aws-actions/configure-aws-credentials@v2
25-
with:
26-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
27-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
28-
aws-region: ${{ env.AWS_REGION }}
23+
# - name: Configure AWS credentials
24+
# uses: aws-actions/configure-aws-credentials@v2
25+
# with:
26+
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
27+
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
28+
# aws-region: ${{ env.AWS_REGION }}
2929

30-
- name: Login to Amazon ECR
31-
id: login-ecr
32-
uses: aws-actions/amazon-ecr-login@v1
30+
# - name: Login to Amazon ECR
31+
# id: login-ecr
32+
# uses: aws-actions/amazon-ecr-login@v1
3333

34-
- name: Build, tag, and push image to Amazon ECR
35-
id: build-image
36-
env:
37-
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
38-
IMAGE_TAG: ${{ github.sha }}
39-
run: |
40-
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
41-
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
42-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
43-
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
44-
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:latest" >> $GITHUB_OUTPUT
34+
# - name: Build, tag, and push image to Amazon ECR
35+
# id: build-image
36+
# env:
37+
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
38+
# IMAGE_TAG: ${{ github.sha }}
39+
# run: |
40+
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
41+
# docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
42+
# docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
43+
# docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
44+
# echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:latest" >> $GITHUB_OUTPUT
4545

46-
# deploy:
47-
# name: Deploy to EC2
48-
# needs: build-and-push
49-
# runs-on: self-hosted
46+
# # deploy:
47+
# # name: Deploy to EC2
48+
# # needs: build-and-push
49+
# # runs-on: self-hosted
5050

51-
# steps:
52-
# - name: Configure AWS credentials
53-
# uses: aws-actions/configure-aws-credentials@v2
54-
# with:
55-
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
56-
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
57-
# aws-region: ${{ env.AWS_REGION }}
51+
# # steps:
52+
# # - name: Checkout code
53+
# # uses: actions/checkout@v3
5854

59-
# - name: Login to Amazon ECR
60-
# id: login-ecr
61-
# uses: aws-actions/amazon-ecr-login@v1
55+
# # - name: Create .env file
56+
# # run: |
57+
# # echo "BUCKET_NAME=${{ secrets.BUCKET_NAME }}" > .env
58+
# # echo "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}" >> .env
59+
# # echo "AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> .env
60+
# # echo "AWS_DEFAULT_REGION=${{ env.AWS_REGION }}" >> .env
6261

63-
# - name: Stop and remove old container
64-
# run: |
65-
# docker stop sentiment-api || true
66-
# docker rm sentiment-api || true
62+
# # - name: Configure AWS credentials
63+
# # uses: aws-actions/configure-aws-credentials@v2
64+
# # with:
65+
# # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
66+
# # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
67+
# # aws-region: ${{ env.AWS_REGION }}
6768

68-
# - name: Pull and deploy new container
69-
# env:
70-
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
71-
# run: |
72-
# docker pull $ECR_REGISTRY/$ECR_REPOSITORY:latest
73-
74-
# docker run -d \
75-
# --name sentiment-api \
76-
# --restart unless-stopped \
77-
# -p 80:8000 \
78-
# -e BUCKET_NAME=${{ secrets.BUCKET_NAME }} \
79-
# -e AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
80-
# -e AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
81-
# -e AWS_DEFAULT_REGION=${{ env.AWS_REGION }} \
82-
# $ECR_REGISTRY/$ECR_REPOSITORY:latest
69+
# # - name: Login to Amazon ECR
70+
# # id: login-ecr
71+
# # uses: aws-actions/amazon-ecr-login@v1
72+
73+
# # - name: Pull latest image from ECR
74+
# # env:
75+
# # ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
76+
# # run: |
77+
# # docker pull $ECR_REGISTRY/$ECR_REPOSITORY:latest
78+
79+
# # - name: Stop and remove existing containers
80+
# # run: |
81+
# # docker-compose down || true
82+
83+
# # - name: Deploy with Docker Compose
84+
# # env:
85+
# # ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
86+
# # run: |
87+
# # export IMAGE_TAG=$ECR_REGISTRY/$ECR_REPOSITORY:latest
88+
# # docker-compose up -d
8389

84-
# - name: Clean up old images
85-
# run: docker image prune -af
90+
# # - name: Clean up old images
91+
# # run: docker image prune -af
8692

87-
# - name: Verify deployment
88-
# run: |
89-
# echo "Waiting for application to start..."
90-
# sleep 30
93+
# # - name: Verify deployment
94+
# # run: |
95+
# # echo "Waiting for services to start..."
96+
# # sleep 45
9197

92-
# echo "Checking container status..."
93-
# docker ps | grep sentiment-api
98+
# # echo "Checking container status..."
99+
# # docker-compose ps
94100

95-
# echo "Checking application health..."
96-
# curl -f http://localhost:80/health || exit 1
101+
# # echo "Testing application health..."
102+
# # curl -f http://localhost/health || exit 1
97103

98-
# echo "✅ Deployment successful!"
104+
# # echo "✅ Deployment successful!"

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ train_dir
197197

198198
.env
199199
fastapi_app/.env
200-
tinybert-sentiment-analysis
201200
train_dir
202-
fastapi_app/model/*
201+
tinybert-sentiment-analysis
202+
fastapi_app/model/*
203+
CHECKLIST.md
204+
COMMANDS.md
205+
DEPLOYMENT.md
206+
QUICKSTART.md

0 commit comments

Comments
 (0)