diff --git a/bin/deploy-canary.sh b/bin/deploy-canary.sh index 7aa9037..a9ba7da 100755 --- a/bin/deploy-canary.sh +++ b/bin/deploy-canary.sh @@ -8,22 +8,22 @@ LIB_PATH=$rootdir CANARY_PATH=$LIB_PATH/tests/canary/agent ACCOUNT_ID=863722843142 REGION=us-west-2 -IMAGE_NAME=emf-python-canary -ECS_CLUSTER_NAME=emf-canary -ECS_TASK_FAMILY=emf-python-canary -ECS_SERVICE_NAME=emf-python-canary -ECR_REMOTE=$ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com/$IMAGE_NAME +EMF_LANGUAGE=python +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 'INSTALLING LOCAL PROJECT' python3 -m venv venv source venv/bin/activate pip3 install $rootdir -pip3 install psutil -pip3 install getversion echo 'BUILDING THE EXAMPLE DOCKER IMAGE' -`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 @@ -40,13 +40,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 '0.5 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 }') diff --git a/tests/canary/agent/container-definitions.json b/tests/canary/agent/container-definitions.json index e66822f..3b21fe9 100644 --- a/tests/canary/agent/container-definitions.json +++ b/tests/canary/agent/container-definitions.json @@ -18,7 +18,7 @@ "environment": [ { "name": "AWS_EMF_AGENT_ENDPOINT", - "value": "tcp://cloudwatch-agent-python:25888" + "value": "tcp://127.0.0.1:25888" }, { "name": "AWS_EMF_ENABLE_DEBUG_LOGGING", @@ -26,7 +26,6 @@ } ], "image": "863722843142.dkr.ecr.us-west-2.amazonaws.com/emf-python-canary", - "links": ["cloudwatch-agent-python"], "name": "emf-python-canary" }, { diff --git a/tests/canary/agent/start.sh b/tests/canary/agent/start.sh index 4e3b60c..02776f6 100755 --- a/tests/canary/agent/start.sh +++ b/tests/canary/agent/start.sh @@ -1,3 +1,7 @@ #!/bin/bash . /app/venv/bin/activate -python ./canary.py \ No newline at end of file + +pip3 install psutil > /dev/null +pip3 install getversion > /dev/null + +python3 ./canary.py \ No newline at end of file