Patrick Walukagga commited on
Commit
4bcacf2
·
1 Parent(s): 632bf0d

Update task definition deployments

Browse files
README.md CHANGED
@@ -221,3 +221,21 @@ Then look for the outputs to the link for the deployed application.
221
  chmod u+x bin/cfn/*
222
  ./bin/cfn/ecs-deploy
223
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  chmod u+x bin/cfn/*
222
  ./bin/cfn/ecs-deploy
223
  ```
224
+
225
+ #### Update Task Definition Deployments
226
+ After making changes, build the docker images and then push to ECR.
227
+
228
+ To update the task definition deployments, force the new deployment by running the commands below
229
+
230
+ For the gradio task definition
231
+
232
+ ```sh
233
+ ./bin/cfn/ecs-deploy-update-gradio
234
+ ```
235
+
236
+ For the api task definition
237
+
238
+ ```sh
239
+ ./bin/cfn/ecs-deploy-update-api
240
+ ```
241
+
bin/cfn/ecs-deploy-update-api ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #! /usr/bin/bash
2
+
3
+ set -e
4
+
5
+ CLUSTER_NAME="rag-ecs-cluster"
6
+ FASTAPI_SERVICE_NAME="dev-acres-fastapi"
7
+ TASK_FASTAPI_DEFINTION_FAMILY="dev-acres-fastapi"
8
+
9
+
10
+ LATEST_FASTAPI_TASK_DEFINITION_ARN=$(aws ecs describe-task-definition \
11
+ --task-definition $TASK_FASTAPI_DEFINTION_FAMILY \
12
+ --query 'taskDefinition.taskDefinitionArn' \
13
+ --output text)
14
+
15
+ echo "TASK DEF ARN:"
16
+ echo $LATEST_FASTAPI_TASK_DEFINITION_ARN
17
+
18
+ aws ecs update-service \
19
+ --cluster $CLUSTER_NAME \
20
+ --service $FASTAPI_SERVICE_NAME \
21
+ --task-definition $LATEST_FASTAPI_TASK_DEFINITION_ARN \
22
+ --force-new-deployment
bin/cfn/ecs-deploy-update-gradio ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #! /usr/bin/bash
2
+
3
+ set -e
4
+
5
+ CLUSTER_NAME="rag-ecs-cluster"
6
+ SERVICE_NAME="dev-acres-gradio"
7
+ TASK_GRADIO_DEFINTION_FAMILY="dev-acres-gradio"
8
+
9
+
10
+ LATEST_GRADIO_TASK_DEFINITION_ARN=$(aws ecs describe-task-definition \
11
+ --task-definition $TASK_GRADIO_DEFINTION_FAMILY \
12
+ --query 'taskDefinition.taskDefinitionArn' \
13
+ --output text)
14
+
15
+ echo "TASK DEF ARN:"
16
+ echo $LATEST_GRADIO_TASK_DEFINITION_ARN
17
+
18
+ aws ecs update-service \
19
+ --cluster $CLUSTER_NAME \
20
+ --service $SERVICE_NAME \
21
+ --task-definition $LATEST_GRADIO_TASK_DEFINITION_ARN \
22
+ --force-new-deployment