14291: Adjust ExtraScratch (int) to AttachScratch (bool)
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Thu, 28 Feb 2019 18:05:57 +0000 (13:05 -0500)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Thu, 28 Feb 2019 18:05:57 +0000 (13:05 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

lib/cloud/ec2/ec2.go
lib/cloud/ec2/ec2_test.go
lib/dispatchcloud/driver.go
sdk/go/arvados/config.go

index 9b75abe09c2853df54557f28cc2d2cb23ce5953e..2a0a2ba764f6e3d2ee67ac3af0f7d07659173e67 100644 (file)
@@ -129,12 +129,12 @@ func (instanceSet *ec2InstanceSet) Create(
                        }},
        }
 
-       if instanceType.ExtraScratch > 0 {
+       if instanceType.AttachScratch {
                rii.BlockDeviceMappings = []*ec2.BlockDeviceMapping{&ec2.BlockDeviceMapping{
                        DeviceName: aws.String("/dev/xvdt"),
                        Ebs: &ec2.EbsBlockDevice{
                                DeleteOnTermination: aws.Bool(true),
-                               VolumeSize:          aws.Int64((int64(instanceType.ExtraScratch) / 1000000000) + 1),
+                               VolumeSize:          aws.Int64((int64(instanceType.Scratch) / 1000000000) + 1),
                                VolumeType:          aws.String("gp2"),
                        }}}
        }
index 868de095650c4684abf49707c3ec893ebba53a69..f5352d12115d019514bfbacdb6d9c1f6d656955b 100644 (file)
@@ -94,14 +94,14 @@ func GetInstanceSet() (cloud.InstanceSet, cloud.ImageID, arvados.Cluster, error)
                                Preemptible:  false,
                        },
                        "tiny-with-extra-scratch": arvados.InstanceType{
-                               Name:         "tiny",
-                               ProviderType: "t2.micro",
-                               VCPUs:        1,
-                               RAM:          4000000000,
-                               Scratch:      10000000000,
-                               ExtraScratch: 20000000000,
-                               Price:        .02,
-                               Preemptible:  false,
+                               Name:          "tiny",
+                               ProviderType:  "t2.micro",
+                               VCPUs:         1,
+                               RAM:           4000000000,
+                               Scratch:       20000000000,
+                               Price:         .02,
+                               Preemptible:   false,
+                               AttachScratch: true,
                        },
                        "tiny-preemptible": arvados.InstanceType{
                                Name:         "tiny",
index 2ac69e04c17bb94ce706979547c8501b3f80b609..0343f85b91a7bc63d20034e111e04487608bef9c 100644 (file)
@@ -9,12 +9,14 @@ import (
 
        "git.curoverse.com/arvados.git/lib/cloud"
        "git.curoverse.com/arvados.git/lib/cloud/azure"
+       "git.curoverse.com/arvados.git/lib/cloud/ec2"
        "git.curoverse.com/arvados.git/sdk/go/arvados"
        "github.com/sirupsen/logrus"
 )
 
 var drivers = map[string]cloud.Driver{
        "azure": azure.Driver,
+       "ec2":   ec2.Driver,
 }
 
 func newInstanceSet(cluster *arvados.Cluster, setID cloud.InstanceSetID, logger logrus.FieldLogger) (cloud.InstanceSet, error) {
index 5f6235cf0a6df53af446a6c830dea8237fc1e32e..fddf5100acb6ae01a4c72e2d7b1e848e097a53e4 100644 (file)
@@ -94,14 +94,14 @@ type RemoteCluster struct {
 }
 
 type InstanceType struct {
-       Name         string
-       ProviderType string
-       VCPUs        int
-       RAM          ByteSize
-       Scratch      ByteSize
-       ExtraScratch ByteSize
-       Price        float64
-       Preemptible  bool
+       Name          string
+       ProviderType  string
+       VCPUs         int
+       RAM           ByteSize
+       Scratch       ByteSize
+       Price         float64
+       Preemptible   bool
+       AttachScratch bool
 }
 
 type Dispatch struct {