From df371b7e2501e52510f934cd01f174e52af642f1 Mon Sep 17 00:00:00 2001 From: Gennady Lipenkov Date: Wed, 3 Jun 2020 20:58:39 +0300 Subject: [PATCH] Do not require 'gpu-standard-v1' platform_id for any GPU-based config. Support use another kind of GPU platforms. --- builder/yandex/config.go | 5 ----- builder/yandex/config_test.go | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/builder/yandex/config.go b/builder/yandex/config.go index f45c53637..370c37219 100644 --- a/builder/yandex/config.go +++ b/builder/yandex/config.go @@ -248,11 +248,6 @@ func (c *Config) Prepare(raws ...interface{}) ([]string, error) { c.FolderID = os.Getenv("YC_FOLDER_ID") } - if c.PlatformID != defaultGpuPlatformID && c.InstanceGpus != 0 { - errs = packer.MultiErrorAppend( - errs, fmt.Errorf("for instances with gpu platform_id must be specified as `%s`", defaultGpuPlatformID)) - } - if c.Token == "" && c.ServiceAccountKeyFile == "" { errs = packer.MultiErrorAppend( errs, errors.New("a token or service account key file must be specified")) diff --git a/builder/yandex/config_test.go b/builder/yandex/config_test.go index ab9ebfc3f..a3c2765f3 100644 --- a/builder/yandex/config_test.go +++ b/builder/yandex/config_test.go @@ -231,7 +231,7 @@ func TestGpuDefaultPlatformID(t *testing.T) { var c Config c.Prepare(raw) if c.PlatformID != "gpu-standard-v1" { - t.Fatalf("expected 'gpu-standard-v1', but got '%s'", c.PlatformID) + t.Fatalf("expected 'gpu-standard-v1' as default platform_id for instance with GPU(s), but got '%s'", c.PlatformID) } }