From a5d9cae2d90af84d768d26af5487356e002506ca Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Tue, 5 Mar 2024 18:47:05 +0100 Subject: [PATCH 1/4] fix disk pressure error --- .../single-new-eks-gpu-opensource-observability.md | 7 +++++-- .../gpu-index.ts | 9 +++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/patterns/single-new-eks-observability-accelerators/single-new-eks-gpu-opensource-observability.md b/docs/patterns/single-new-eks-observability-accelerators/single-new-eks-gpu-opensource-observability.md index 90a2c6bb..4640ef43 100644 --- a/docs/patterns/single-new-eks-observability-accelerators/single-new-eks-gpu-opensource-observability.md +++ b/docs/patterns/single-new-eks-observability-accelerators/single-new-eks-gpu-opensource-observability.md @@ -124,12 +124,13 @@ Example settings: Update the context in `cdk.json` file located in `cdk-eks-blue "desiredSize": 2, "minSize": 2, "maxSize": 3, - "ebsSize": 50 + "ebsSize": 50, + "ebsDeviceName": "/dev/xvda" }, } ``` -**Note**: insure your selected instance type is available in your region. To check that, you can run the following command (amend `Values` below as you see fit): +**Note**: ensure your selected instance type is available in your region. To check that, you can run the following command (amend `Values` below as you see fit): ```bash aws ec2 describe-instance-type-offerings \ @@ -138,6 +139,8 @@ aws ec2 describe-instance-type-offerings \ --region us-east-2 ``` +**Note**: ensure `ebsDeviceName` [reflects the name of the root device name of your AMI](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html). + 8. Once all pre-requisites are set you are ready to deploy the pipeline. Run the following command from the root of this repository to deploy the pipeline stack: ```bash diff --git a/lib/single-new-eks-opensource-observability-pattern/gpu-index.ts b/lib/single-new-eks-opensource-observability-pattern/gpu-index.ts index 1360aba7..cde47a84 100644 --- a/lib/single-new-eks-opensource-observability-pattern/gpu-index.ts +++ b/lib/single-new-eks-opensource-observability-pattern/gpu-index.ts @@ -12,7 +12,8 @@ interface GpuNodeGroupProps { desiredSize: number, minSize: number, maxSize:number, - ebsSize: number + ebsSize: number, + ebsDeviceName: string } export default class SingleNewEksGpuOpenSourceObservabilityPattern { @@ -96,6 +97,10 @@ export default class SingleNewEksGpuOpenSourceObservabilityPattern { } function addGpuNodeGroup(gpuNodeGroupProps: GpuNodeGroupProps): blueprints.ManagedNodeGroup { + if (gpuNodeGroupProps === undefined) { + throw new Error("Missing node group configuration"); + } + return { id: "mng-linux-gpu-01", amiType: eks.NodegroupAmiType.AL2_X86_64_GPU, @@ -113,7 +118,7 @@ function addGpuNodeGroup(gpuNodeGroupProps: GpuNodeGroupProps): blueprints.Manag requireImdsv2: false, blockDevices: [ { - deviceName: "/dev/sda1", + deviceName: gpuNodeGroupProps.ebsDeviceName, volume: ec2.BlockDeviceVolume.ebs(gpuNodeGroupProps.ebsSize), } ] From ca30807c2d55a53feb3be971ad80f179c7effb6f Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Tue, 5 Mar 2024 18:58:16 +0100 Subject: [PATCH 2/4] fix to doc --- .../single-new-eks-gpu-opensource-observability.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/patterns/single-new-eks-observability-accelerators/single-new-eks-gpu-opensource-observability.md b/docs/patterns/single-new-eks-observability-accelerators/single-new-eks-gpu-opensource-observability.md index 4640ef43..5bda6b10 100644 --- a/docs/patterns/single-new-eks-observability-accelerators/single-new-eks-gpu-opensource-observability.md +++ b/docs/patterns/single-new-eks-observability-accelerators/single-new-eks-gpu-opensource-observability.md @@ -136,7 +136,7 @@ Example settings: Update the context in `cdk.json` file located in `cdk-eks-blue aws ec2 describe-instance-type-offerings \ --filters Name=instance-type,Values="g4*" \ --query "InstanceTypeOfferings[].InstanceType" \ - --region us-east-2 + --region $AWS_REGION ``` **Note**: ensure `ebsDeviceName` [reflects the name of the root device name of your AMI](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html). From 8de27e0ed06cf8f2031817f327699adca92cd4ed Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Tue, 5 Mar 2024 20:30:07 +0100 Subject: [PATCH 3/4] added default to make e2e work --- .../gpu-index.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/single-new-eks-opensource-observability-pattern/gpu-index.ts b/lib/single-new-eks-opensource-observability-pattern/gpu-index.ts index cde47a84..e0132f1a 100644 --- a/lib/single-new-eks-opensource-observability-pattern/gpu-index.ts +++ b/lib/single-new-eks-opensource-observability-pattern/gpu-index.ts @@ -97,10 +97,6 @@ export default class SingleNewEksGpuOpenSourceObservabilityPattern { } function addGpuNodeGroup(gpuNodeGroupProps: GpuNodeGroupProps): blueprints.ManagedNodeGroup { - if (gpuNodeGroupProps === undefined) { - throw new Error("Missing node group configuration"); - } - return { id: "mng-linux-gpu-01", amiType: eks.NodegroupAmiType.AL2_X86_64_GPU, @@ -118,7 +114,7 @@ function addGpuNodeGroup(gpuNodeGroupProps: GpuNodeGroupProps): blueprints.Manag requireImdsv2: false, blockDevices: [ { - deviceName: gpuNodeGroupProps.ebsDeviceName, + deviceName: gpuNodeGroupProps.ebsDeviceName ?? "/dev/xvda", volume: ec2.BlockDeviceVolume.ebs(gpuNodeGroupProps.ebsSize), } ] From 756b6eaddd75794f2c9eee572816afa4cba91f0d Mon Sep 17 00:00:00 2001 From: Riccardo Freschi Date: Tue, 5 Mar 2024 20:50:49 +0100 Subject: [PATCH 4/4] moved e2e dependency out of code --- cdk.json | 3 ++- .../gpu-index.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cdk.json b/cdk.json index dc36022b..7e98f78a 100644 --- a/cdk.json +++ b/cdk.json @@ -45,7 +45,8 @@ "desiredSize": 2, "minSize": 2, "maxSize": 3, - "ebsSize": 50 + "ebsSize": 50, + "ebsDeviceName": "/dev/xvda" }, "existing.cluster.name": "single-new-eks-observability-accelerator", "existing.kubectl.rolename": "YOUR_KUBECTL_ROLE" diff --git a/lib/single-new-eks-opensource-observability-pattern/gpu-index.ts b/lib/single-new-eks-opensource-observability-pattern/gpu-index.ts index e0132f1a..c846a236 100644 --- a/lib/single-new-eks-opensource-observability-pattern/gpu-index.ts +++ b/lib/single-new-eks-opensource-observability-pattern/gpu-index.ts @@ -114,7 +114,7 @@ function addGpuNodeGroup(gpuNodeGroupProps: GpuNodeGroupProps): blueprints.Manag requireImdsv2: false, blockDevices: [ { - deviceName: gpuNodeGroupProps.ebsDeviceName ?? "/dev/xvda", + deviceName: gpuNodeGroupProps.ebsDeviceName, volume: ec2.BlockDeviceVolume.ebs(gpuNodeGroupProps.ebsSize), } ]