Do not require 'gpu-standard-v1' platform_id for any GPU-based config.

Support use another kind of GPU platforms.
pull/9356/head
Gennady Lipenkov 6 years ago
parent 434c9bcae0
commit df371b7e25

@ -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"))

@ -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)
}
}

Loading…
Cancel
Save