Skip to content

Migrate canary to Fargate #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ To create an aggregate metric across all dimensions, you can use an empty `Dimen

```java
setDimensions(
DimensionSet.of(
"Operation", "Aggregator",
"DeviceType", "Actuator"),
new DimensionSet()
DimensionSet.of(
"Operation", "Aggregator",
"DeviceType", "Actuator"),
new DimensionSet()
)
```

Expand Down
27 changes: 14 additions & 13 deletions bin/deploy-canary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ LIB_PATH=$rootdir
CANARY_PATH=$LIB_PATH/canarytests/agent
ACCOUNT_ID=863722843142
REGION=us-west-2
IMAGE_NAME=emf-java-canary
ECS_CLUSTER_NAME=emf-canary
ECS_TASK_FAMILY=emf-java-canary
ECS_SERVICE_NAME=emf-java-canary
ECR_REMOTE=$ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com/$IMAGE_NAME

EMF_LANGUAGE=java
IMAGE_NAME=emf-$EMF_LANGUAGE-canary
ECS_CLUSTER_NAME=emf-canary-cluster
ECS_TASK_FAMILY=emf-canary-$EMF_LANGUAGE-tasks
ECS_SERVICE_NAME=emf-canary-$EMF_LANGUAGE-service
ECR_ENDPOINT=$ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com
ECR_REMOTE=$ECR_ENDPOINT/$IMAGE_NAME

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

Expand All @@ -35,13 +36,13 @@ aws ecs update-service \
--service $ECS_SERVICE_NAME \
--force-new-deployment \
--task-definition $(aws ecs register-task-definition \
--network-mode bridge \
--requires-compatibilities EC2 \
--task-role arn:aws:iam::$ACCOUNT_ID:role/ecsTaskExecutionRole \
--execution-role-arn "arn:aws:iam::$ACCOUNT_ID:role/ecsTaskExecutionRole" \
--network-mode awsvpc \
--requires-compatibilities FARGATE \
--task-role arn:aws:iam::$ACCOUNT_ID:role/ECSCanaryTaskExecutionRole \
--execution-role-arn "arn:aws:iam::$ACCOUNT_ID:role/ECSCanaryTaskExecutionRole" \
--region $REGION \
--memory 256 \
--cpu '1 vcpu' \
--memory 512 \
--cpu '0.25 vcpu' \
--family $ECS_TASK_FAMILY \
--container-definitions "$(cat container-definitions.json)" \
| jq --raw-output '.taskDefinition.taskDefinitionArn' | awk -F '/' '{ print $2 }')
Expand Down
3 changes: 1 addition & 2 deletions canarytests/agent/container-definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
"environment": [
{
"name": "AWS_EMF_AGENT_ENDPOINT",
"value": "tcp://cloudwatch-agent:25888"
"value": "tcp://127.0.0.1:25888"
}
],
"image": "863722843142.dkr.ecr.us-west-2.amazonaws.com/emf-java-canary",
"links": ["cloudwatch-agent"],
"name": "emf-java-canary"
},
{
Expand Down