From 1ba00bcb3f8df2ebe4c8d4c8de304eee84f7d9f7 Mon Sep 17 00:00:00 2001 From: Jiaxin Shan Date: Fri, 16 Aug 2019 17:00:42 -0700 Subject: [PATCH] Support gpu instance g3 --- pkg/ami/static_resolver_test.go | 8 ++++++++ pkg/utils/utils.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/ami/static_resolver_test.go b/pkg/ami/static_resolver_test.go index ea6c8a7dfa..6d140ca7d0 100644 --- a/pkg/ami/static_resolver_test.go +++ b/pkg/ami/static_resolver_test.go @@ -88,6 +88,14 @@ var _ = Describe("AMI Static Resolution", func() { ExpectedAMI: "ami-042f9abf2f96a0097", ExpectError: false, }), + Entry("with gpu (g3) instance and eu-west-1", ResolveCase{ + Region: "eu-west-1", + Version: "1.12", + InstanceType: "g3.4xlarge", + ImageFamily: "AmazonLinux2", + ExpectedAMI: "ami-042f9abf2f96a0097", + ExpectError: false, + }), Entry("with gpu (p3) instance and non-existent region", ResolveCase{ Region: "eu-east-1", Version: "1.12", diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 1acfa0893e..814472024b 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -7,7 +7,7 @@ import ( // IsGPUInstanceType returns tru of the instance type is GPU // optimised. func IsGPUInstanceType(instanceType string) bool { - return strings.HasPrefix(instanceType, "p2") || strings.HasPrefix(instanceType, "p3") + return strings.HasPrefix(instanceType, "p2") || strings.HasPrefix(instanceType, "p3") || strings.HasPrefix(instanceType, "g3") } // HasGPUInstanceType returns true if it finds a gpu instance among the mixed instances