Skip to content

Commit 43840bf

Browse files
authored
Migrate canary to Fargate (awslabs#73)
1 parent b6a99c0 commit 43840bf

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ To create an aggregate metric across all dimensions, you can use an empty `Dimen
135135

136136
```java
137137
setDimensions(
138-
DimensionSet.of(
139-
"Operation", "Aggregator",
140-
"DeviceType", "Actuator"),
141-
new DimensionSet()
138+
DimensionSet.of(
139+
"Operation", "Aggregator",
140+
"DeviceType", "Actuator"),
141+
new DimensionSet()
142142
)
143143
```
144144

bin/deploy-canary.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ LIB_PATH=$rootdir
99
CANARY_PATH=$LIB_PATH/canarytests/agent
1010
ACCOUNT_ID=863722843142
1111
REGION=us-west-2
12-
IMAGE_NAME=emf-java-canary
13-
ECS_CLUSTER_NAME=emf-canary
14-
ECS_TASK_FAMILY=emf-java-canary
15-
ECS_SERVICE_NAME=emf-java-canary
16-
ECR_REMOTE=$ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com/$IMAGE_NAME
17-
12+
EMF_LANGUAGE=java
13+
IMAGE_NAME=emf-$EMF_LANGUAGE-canary
14+
ECS_CLUSTER_NAME=emf-canary-cluster
15+
ECS_TASK_FAMILY=emf-canary-$EMF_LANGUAGE-tasks
16+
ECS_SERVICE_NAME=emf-canary-$EMF_LANGUAGE-service
17+
ECR_ENDPOINT=$ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com
18+
ECR_REMOTE=$ECR_ENDPOINT/$IMAGE_NAME
1819

1920
pushd $CANARY_PATH
2021
echo 'BUILDING THE DOCKER IMAGE FOR THE CANARY TESTS'
21-
`aws ecr get-login --no-include-email --region $REGION`
22+
aws ecr get-login-password --region $REGION | docker login --username AWS --password-stdin $ECR_ENDPOINT
2223
docker build . -t $IMAGE_NAME:latest
2324
check_exit
2425

@@ -35,13 +36,13 @@ aws ecs update-service \
3536
--service $ECS_SERVICE_NAME \
3637
--force-new-deployment \
3738
--task-definition $(aws ecs register-task-definition \
38-
--network-mode bridge \
39-
--requires-compatibilities EC2 \
40-
--task-role arn:aws:iam::$ACCOUNT_ID:role/ecsTaskExecutionRole \
41-
--execution-role-arn "arn:aws:iam::$ACCOUNT_ID:role/ecsTaskExecutionRole" \
39+
--network-mode awsvpc \
40+
--requires-compatibilities FARGATE \
41+
--task-role arn:aws:iam::$ACCOUNT_ID:role/ECSCanaryTaskExecutionRole \
42+
--execution-role-arn "arn:aws:iam::$ACCOUNT_ID:role/ECSCanaryTaskExecutionRole" \
4243
--region $REGION \
43-
--memory 256 \
44-
--cpu '1 vcpu' \
44+
--memory 512 \
45+
--cpu '0.25 vcpu' \
4546
--family $ECS_TASK_FAMILY \
4647
--container-definitions "$(cat container-definitions.json)" \
4748
| jq --raw-output '.taskDefinition.taskDefinitionArn' | awk -F '/' '{ print $2 }')

canarytests/agent/container-definitions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717
"environment": [
1818
{
1919
"name": "AWS_EMF_AGENT_ENDPOINT",
20-
"value": "tcp://cloudwatch-agent:25888"
20+
"value": "tcp://127.0.0.1:25888"
2121
}
2222
],
2323
"image": "863722843142.dkr.ecr.us-west-2.amazonaws.com/emf-java-canary",
24-
"links": ["cloudwatch-agent"],
2524
"name": "emf-java-canary"
2625
},
2726
{

0 commit comments

Comments
 (0)