File tree Expand file tree Collapse file tree 4 files changed +64
-1
lines changed Expand file tree Collapse file tree 4 files changed +64
-1
lines changed Original file line number Diff line number Diff line change
1
+ version : 0.0
2
+ os : linux
3
+ files :
4
+ - source : /
5
+ destination : /home/ubuntu/app
6
+ hooks :
7
+ BeforeInstall :
8
+ - location : deploy/scripts/install_dependencies.sh
9
+ timeout : 300
10
+ runas : ubuntu
11
+ ApplicationStart :
12
+ - location : deploy/scripts/start_docker.sh
13
+ timeout : 300
14
+ runas : ubuntu
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Ensure that the script runs in non-interactive mode
4
+ export DEBIAN_FRONTEND=noninteractive
5
+
6
+ # Update the package lists
7
+ sudo apt-get update -y
8
+
9
+ # Install Docker
10
+ sudo apt-get install -y docker.io
11
+
12
+ # Start and enable Docker service
13
+ sudo systemctl start docker
14
+ sudo systemctl enable docker
15
+
16
+ # Install necessary utilities
17
+ sudo apt-get install -y unzip curl
18
+
19
+ # Download and install AWS CLI
20
+ curl " https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o " /home/ubuntu/awscliv2.zip"
21
+ unzip -o /home/ubuntu/awscliv2.zip -d /home/ubuntu/
22
+ sudo /home/ubuntu/aws/install
23
+
24
+ # Add 'ubuntu' user to the 'docker' group to run Docker commands without 'sudo'
25
+ sudo usermod -aG docker ubuntu
26
+
27
+ # Clean up the AWS CLI installation files
28
+ rm -rf /home/ubuntu/awscliv2.zip /home/ubuntu/aws
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Login to AWS ECR
3
+ aws ecr get-login-password --region ap-southeast-2 | docker login --username AWS --password-stdin 843369994444.dkr.ecr.eu-north-1.amazonaws.com/text-classification:v3
4
+
5
+ # Pull the latest image
6
+ docker pull 843369994444.dkr.ecr.eu-north-1.amazonaws.com/text-classification:v3
7
+
8
+ # Check if the container 'campusx-app' is running
9
+ if [ " $( docker ps -q -f name=text-classification) " ]; then
10
+ # Stop the running container
11
+ docker stop text-classification
12
+ fi
13
+
14
+ # Check if the container 'campusx-app' exists (stopped or running)
15
+ if [ " $( docker ps -aq -f name=text-classification) " ]; then
16
+ # Remove the container if it exists
17
+ docker rm text-classification
18
+ fi
19
+
20
+ # Run a new container
21
+ docker run -d -p 80:5000 -e DAGSHUB_PAT=319a47e590ec9cc01014f4b6e8805468766d0757 --name text-classification 843369994444.dkr.ecr.eu-north-1.amazonaws.com/text-classification:v3
Original file line number Diff line number Diff line change 2
2
< head >
3
3
< title > Sentiment Analysis</ title >
4
4
</ head >
5
- < body >
5
+ < body style =" background-color: aqua; " >
6
6
< h1 > Sentiment Analysis</ h1 >
7
7
< form action ="/predict " method ="POST ">
8
8
< label for =""> Write text:</ label > < br >
You can’t perform that action at this time.
0 commit comments