Skip to content

Commit

Permalink
removed duplicate container defintion from neuron.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
ak-org committed Dec 4, 2024
1 parent a7c38b9 commit 56e1278
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 20 deletions.
1 change: 1 addition & 0 deletions neuron-problem-detector/ecs-npd-cdk/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__pycache__/
cdk.out/
17 changes: 16 additions & 1 deletion neuron-problem-detector/ecs-npd-cdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ $ pip install -r requirements.txt
```

## Synthesize CloudFormation template
It is assumed that you have authenticated successfully to connect to your AWS environment.
At this point you can now synthesize the CloudFormation template for this code.

```
$ cdk synth
```
It is assumed that you have authenticated successfully to connect to your AWS environment.

Perform bootstrap function with the following command.
```
Expand All @@ -69,6 +69,21 @@ Deploy the stack in your AWS environment
cdk deploy [--profile <profile name>]
```

## Cleanup Instructions

Destroy the stack in your AWS environment

```
cdk destroy [--profile <profile name>]
```

Delete the following log groups in cloudwatch

```
/ecs/recovery
/ecs/npd
```

## Optional
To add additional dependencies, for example other CDK libraries, just add
them to your `setup.py` file and rerun the `pip install -r requirements.txt`
Expand Down
3 changes: 0 additions & 3 deletions neuron-problem-detector/ecs-npd-cdk/neuron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,6 @@ Resources:
- Ref: NeuronProblemDetectorTaskRole673752FB
Metadata:
aws:cdk:path: NeuronProblemDetectorStack/NeuronProblemDetectorTaskRole/DefaultPolicy/Resource
NeuronNpdAndRecoveryTaskDef7591F251:
Type: AWS::ECS::TaskDefinition
Properties:
ContainerDefinitions:
Expand Down Expand Up @@ -986,8 +985,6 @@ Resources:
- Ref: NeuronProblemDetectorVPCPrivateSubnet1Subnet708A0901
- Ref: NeuronProblemDetectorVPCPrivateSubnet2Subnet3B7C3437
SchedulingStrategy: DAEMON
TaskDefinition:
Ref: NeuronNpdAndRecoveryTaskDef7591F251
DependsOn:
- NeuronProblemDetectorTaskRoleDefaultPolicyCFCDEF04
- NeuronProblemDetectorTaskRole673752FB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
{
"name": "npd-80-tcp",
"containerPort": 80,
"hostPort": 80,
"protocol": "tcp",
"appProtocol": "http"
"hostPort": 80
}
],
"essential": true,
Expand Down Expand Up @@ -43,7 +41,6 @@
"options": {
"awslogs-group": "/ecs/npd",
"awslogs-create-group": "true",
"awslogs-region": "us-west-2",
"awslogs-stream-prefix": "ecs"
},
"secretOptions": []
Expand Down Expand Up @@ -77,20 +74,12 @@
"options": {
"awslogs-create-group": "true",
"awslogs-group": "/ecs/recovery",
"awslogs-region": "us-west-2",
"awslogs-stream-prefix": "ecs"
}
},
"systemControls": []
}
],
"requiresCompatibilities": [
"EC2"
],
"cpu": "1024",
"memory": "3072",
"runtimePlatform": {
"cpuArchitecture": "X86_64",
"operatingSystemFamily": "LINUX"
}
"memory": "3072"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class NeuronProblemDetectorStack(Stack):

def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
with open('ecs_task_definition.json', 'r') as f:
with open('neuron_problem_detector/ecs_task_definition.json', 'r') as f:
ecs_task_definition = json.load(f)

vpc = ec2.Vpc(self, "NeuronProblemDetectorVPC", max_azs=2)
Expand Down Expand Up @@ -121,7 +121,7 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
image=ecs.ContainerImage.from_registry(
ecs_task_definition["containerDefinitions"][0]["image"]
),
entry_point=ecs_task_definition["containerDefinitions"][0]["entrypoint"],
entry_point=ecs_task_definition["containerDefinitions"][0]["entryPoint"],
command=ecs_task_definition["containerDefinitions"][0]["command"],
privileged=True,
logging=ecs.AwsLogDriver(
Expand Down
2 changes: 1 addition & 1 deletion neuron-problem-detector/ecs-npd-cdk/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
aws-cdk-lib==2.152.0
aws-cdk-lib>=2.152.0
constructs>=10.0.0,<11.0.0

0 comments on commit 56e1278

Please sign in to comment.