Skip to content

Commit

Permalink
EKS Nvidia Test Use A GPU Instance Type (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethAmazon authored May 3, 2024
1 parent a273a24 commit c4a3a4a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion generator/resources/eks_daemon_test_matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"k8s_version": "1.24",
"ami": "AL2_x86_64",
"instanceType":"t3a.medium",
"instanceType":"t3.medium",
"arc": "amd64"
},
{
Expand Down
8 changes: 7 additions & 1 deletion generator/test_case_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type testConfig struct {
// e.g. statsd can have a multiple terraform module sets for difference test scenarios (ecs, eks or ec2)
testDir string
terraformDir string
instanceType string
runMockServer bool
// define target matrix field as set(s)
// empty map means a testConfig will be created with a test entry for each entry from *_test_matrix.json
Expand Down Expand Up @@ -216,7 +217,8 @@ var testTypeToTestConfig = map[string][]testConfig{
{testDir: "./test/fluent", terraformDir: "terraform/eks/daemon/fluent/windows/2022"},
{
testDir: "./test/gpu", terraformDir: "terraform/eks/daemon/gpu",
targets: map[string]map[string]struct{}{"arc": {"amd64": {}}},
targets: map[string]map[string]struct{}{"arc": {"amd64": {}}},
instanceType: "g4dn.xlarge",
},
},
"eks_deployment": {
Expand Down Expand Up @@ -304,6 +306,10 @@ func genMatrix(testType string, testConfigs []testConfig, ami []string) []matrix
log.Panicf("can't decode map test %v to metric line struct with error %v", testConfig, err)
}

if testConfig.instanceType != "" {
row.InstanceType = testConfig.instanceType
}

if len(ami) != 0 && !slices.Contains(ami, row.Ami) {
continue
}
Expand Down
4 changes: 2 additions & 2 deletions terraform/eks/daemon/gpu/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ resource "aws_eks_node_group" "this" {
min_size = 1
}

ami_type = "AL2_x86_64"
ami_type = var.ami_type
capacity_type = "ON_DEMAND"
disk_size = 20
instance_types = ["t3.medium"]
instance_types = [var.instance_type]

depends_on = [
aws_iam_role_policy_attachment.node_AmazonEC2ContainerRegistryReadOnly,
Expand Down

0 comments on commit c4a3a4a

Please sign in to comment.