18562: Rename config to AlwaysUsePreemptibleInstances.
authorTom Clegg <tom@curii.com>
Thu, 23 Dec 2021 21:59:12 +0000 (16:59 -0500)
committerTom Clegg <tom@curii.com>
Thu, 23 Dec 2021 21:59:12 +0000 (16:59 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

doc/admin/spot-instances.html.textile.liquid
lib/config/config.default.yml
lib/config/export.go
lib/config/generated_config.go
sdk/go/arvados/config.go
services/api/app/models/container_request.rb
services/api/config/arvados_config.rb
services/api/test/unit/container_request_test.rb

index 5d4b677413472cc3ea6a24b3e6b4028d0ce6dbd6..7ca57df0ab0d1cee9ad6fc0e0b0e44f2455edc92 100644 (file)
@@ -16,13 +16,13 @@ Currently Arvados supports preemptible instances using AWS and Azure spot instan
 
 h2. Configuration
 
-To use preemptible instances, ensure they are not disabled in your configuration file (they are enabled by default, but can be disabled with @UsePreemptibleInstances: false@), and add entries to @InstanceTypes@ that have @Preemptible: true@.  Typically you want to add both preemptible and non-preemptible entries for each cloud provider VM type.  The @Price@ for preemptible instances is the maximum bid price, the actual price paid is dynamic and will likely be lower.  For example:
+First, ensure automatic selection of preemptible instances is not disabled in your configuration file (this is enabled by default, but can be disabled with @AlwaysUsePreemptibleInstances: false@), and add entries to @InstanceTypes@ that have @Preemptible: true@.  Typically you want to add both preemptible and non-preemptible entries for each cloud provider VM type.  The @Price@ for preemptible instances is the maximum bid price, the actual price paid is dynamic and will likely be lower.  For example:
 
 <pre>
 Clusters:
   ClusterID: 
     Containers:
-      UsePreemptibleInstances: true
+      AlwaysUsePreemptibleInstances: true
     InstanceTypes:
       m4.large:
         Preemptible: false
@@ -40,7 +40,7 @@ Clusters:
         Price: 0.1
 </pre>
 
-When @UsePreemptibleInstances@ is enabled, child containers (workflow steps) will automatically be made preemptible.  Note that because preempting the workflow runner would cancel the entire workflow, the workflow runner runs in a reserved (non-preemptible) instance.
+When @AlwaysUsePreemptibleInstances@ is enabled, child containers (workflow steps) will automatically be made preemptible.  Note that because preempting the workflow runner would cancel the entire workflow, the workflow runner runs in a reserved (non-preemptible) instance.
 
 No additional configuration is required, "arvados-dispatch-cloud":{{site.baseurl}}/install/crunch2-cloud/install-dispatch-cloud.html will now start preemptible instances where appropriate.
 
index 87d38ffe4bd380d3d98c37f9a0a2c0861a82850f..d16f9f25f7ddcfa5abda41f7c685d00f99ea5027 100644 (file)
@@ -912,7 +912,7 @@ Clusters:
       #
       # This flag is ignored if no preemptible instance types are
       # configured, and has no effect on top-level containers.
-      UsePreemptibleInstances: true
+      AlwaysUsePreemptibleInstances: true
 
       # PEM encoded SSH key (RSA, DSA, or ECDSA) used by the
       # cloud dispatcher for executing containers on worker VMs.
index cfc4cb6272d522d0505c909a82906c2723fea323..9fe7d6cf27537442497fbf10debe3d392f379692 100644 (file)
@@ -59,93 +59,93 @@ func ExportJSON(w io.Writer, cluster *arvados.Cluster) error {
 // exists.
 var whitelist = map[string]bool{
        // | sort -t'"' -k2,2
-       "API":                                                 true,
-       "API.AsyncPermissionsUpdateInterval":                  false,
-       "API.DisabledAPIs":                                    false,
-       "API.KeepServiceRequestTimeout":                       false,
-       "API.MaxConcurrentRequests":                           false,
-       "API.MaxIndexDatabaseRead":                            false,
-       "API.MaxItemsPerResponse":                             true,
-       "API.MaxKeepBlobBuffers":                              false,
-       "API.MaxRequestAmplification":                         false,
-       "API.MaxRequestSize":                                  true,
-       "API.MaxTokenLifetime":                                false,
-       "API.RequestTimeout":                                  true,
-       "API.SendTimeout":                                     true,
-       "API.VocabularyPath":                                  false,
-       "API.WebsocketClientEventQueue":                       false,
-       "API.WebsocketServerEventQueue":                       false,
-       "AuditLogs":                                           false,
-       "AuditLogs.MaxAge":                                    false,
-       "AuditLogs.MaxDeleteBatch":                            false,
-       "AuditLogs.UnloggedAttributes":                        false,
-       "ClusterID":                                           true,
-       "Collections":                                         true,
-       "Collections.BalanceCollectionBatch":                  false,
-       "Collections.BalanceCollectionBuffers":                false,
-       "Collections.BalancePeriod":                           false,
-       "Collections.BalanceTimeout":                          false,
-       "Collections.BalanceUpdateLimit":                      false,
-       "Collections.BlobDeleteConcurrency":                   false,
-       "Collections.BlobMissingReport":                       false,
-       "Collections.BlobReplicateConcurrency":                false,
-       "Collections.BlobSigning":                             true,
-       "Collections.BlobSigningKey":                          false,
-       "Collections.BlobSigningTTL":                          true,
-       "Collections.BlobTrash":                               false,
-       "Collections.BlobTrashCheckInterval":                  false,
-       "Collections.BlobTrashConcurrency":                    false,
-       "Collections.BlobTrashLifetime":                       false,
-       "Collections.CollectionVersioning":                    true,
-       "Collections.DefaultReplication":                      true,
-       "Collections.DefaultTrashLifetime":                    true,
-       "Collections.ForwardSlashNameSubstitution":            true,
-       "Collections.ManagedProperties":                       true,
-       "Collections.ManagedProperties.*":                     true,
-       "Collections.ManagedProperties.*.*":                   true,
-       "Collections.PreserveVersionIfIdle":                   true,
-       "Collections.S3FolderObjects":                         true,
-       "Collections.TrashSweepInterval":                      false,
-       "Collections.TrustAllContent":                         true,
-       "Collections.WebDAVCache":                             false,
-       "Collections.KeepproxyPermission":                     false,
-       "Collections.WebDAVPermission":                        false,
-       "Collections.WebDAVLogEvents":                         false,
-       "Containers":                                          true,
-       "Containers.CloudVMs":                                 false,
-       "Containers.CrunchRunArgumentsList":                   false,
-       "Containers.CrunchRunCommand":                         false,
-       "Containers.DefaultKeepCacheRAM":                      true,
-       "Containers.DispatchPrivateKey":                       false,
-       "Containers.JobsAPI":                                  true,
-       "Containers.JobsAPI.Enable":                           true,
-       "Containers.JobsAPI.GitInternalDir":                   false,
-       "Containers.LocalKeepBlobBuffersPerVCPU":              false,
-       "Containers.LocalKeepLogsToContainerLog":              false,
-       "Containers.Logging":                                  false,
-       "Containers.LogReuseDecisions":                        false,
-       "Containers.LSF":                                      false,
-       "Containers.MaxComputeVMs":                            false,
-       "Containers.MaxDispatchAttempts":                      false,
-       "Containers.MaxRetryAttempts":                         true,
-       "Containers.MinRetryPeriod":                           true,
-       "Containers.ReserveExtraRAM":                          true,
-       "Containers.RuntimeEngine":                            true,
-       "Containers.ShellAccess":                              true,
-       "Containers.ShellAccess.Admin":                        true,
-       "Containers.ShellAccess.User":                         true,
-       "Containers.SLURM":                                    false,
-       "Containers.StaleLockTimeout":                         false,
-       "Containers.SupportedDockerImageFormats":              true,
-       "Containers.SupportedDockerImageFormats.*":            true,
-       "Containers.UsePreemptibleInstances":                  true,
-       "Git":                                                 false,
-       "InstanceTypes":                                       true,
-       "InstanceTypes.*":                                     true,
-       "InstanceTypes.*.*":                                   true,
-       "Login":                                               true,
-       "Login.Google":                                        true,
-       "Login.Google.AlternateEmailAddresses":                false,
+       "API":                                      true,
+       "API.AsyncPermissionsUpdateInterval":       false,
+       "API.DisabledAPIs":                         false,
+       "API.KeepServiceRequestTimeout":            false,
+       "API.MaxConcurrentRequests":                false,
+       "API.MaxIndexDatabaseRead":                 false,
+       "API.MaxItemsPerResponse":                  true,
+       "API.MaxKeepBlobBuffers":                   false,
+       "API.MaxRequestAmplification":              false,
+       "API.MaxRequestSize":                       true,
+       "API.MaxTokenLifetime":                     false,
+       "API.RequestTimeout":                       true,
+       "API.SendTimeout":                          true,
+       "API.VocabularyPath":                       false,
+       "API.WebsocketClientEventQueue":            false,
+       "API.WebsocketServerEventQueue":            false,
+       "AuditLogs":                                false,
+       "AuditLogs.MaxAge":                         false,
+       "AuditLogs.MaxDeleteBatch":                 false,
+       "AuditLogs.UnloggedAttributes":             false,
+       "ClusterID":                                true,
+       "Collections":                              true,
+       "Collections.BalanceCollectionBatch":       false,
+       "Collections.BalanceCollectionBuffers":     false,
+       "Collections.BalancePeriod":                false,
+       "Collections.BalanceTimeout":               false,
+       "Collections.BalanceUpdateLimit":           false,
+       "Collections.BlobDeleteConcurrency":        false,
+       "Collections.BlobMissingReport":            false,
+       "Collections.BlobReplicateConcurrency":     false,
+       "Collections.BlobSigning":                  true,
+       "Collections.BlobSigningKey":               false,
+       "Collections.BlobSigningTTL":               true,
+       "Collections.BlobTrash":                    false,
+       "Collections.BlobTrashCheckInterval":       false,
+       "Collections.BlobTrashConcurrency":         false,
+       "Collections.BlobTrashLifetime":            false,
+       "Collections.CollectionVersioning":         true,
+       "Collections.DefaultReplication":           true,
+       "Collections.DefaultTrashLifetime":         true,
+       "Collections.ForwardSlashNameSubstitution": true,
+       "Collections.ManagedProperties":            true,
+       "Collections.ManagedProperties.*":          true,
+       "Collections.ManagedProperties.*.*":        true,
+       "Collections.PreserveVersionIfIdle":        true,
+       "Collections.S3FolderObjects":              true,
+       "Collections.TrashSweepInterval":           false,
+       "Collections.TrustAllContent":              true,
+       "Collections.WebDAVCache":                  false,
+       "Collections.KeepproxyPermission":          false,
+       "Collections.WebDAVPermission":             false,
+       "Collections.WebDAVLogEvents":              false,
+       "Containers":                               true,
+       "Containers.CloudVMs":                      false,
+       "Containers.CrunchRunArgumentsList":        false,
+       "Containers.CrunchRunCommand":              false,
+       "Containers.DefaultKeepCacheRAM":           true,
+       "Containers.DispatchPrivateKey":            false,
+       "Containers.JobsAPI":                       true,
+       "Containers.JobsAPI.Enable":                true,
+       "Containers.JobsAPI.GitInternalDir":        false,
+       "Containers.LocalKeepBlobBuffersPerVCPU":   false,
+       "Containers.LocalKeepLogsToContainerLog":   false,
+       "Containers.Logging":                       false,
+       "Containers.LogReuseDecisions":             false,
+       "Containers.LSF":                           false,
+       "Containers.MaxComputeVMs":                 false,
+       "Containers.MaxDispatchAttempts":           false,
+       "Containers.MaxRetryAttempts":              true,
+       "Containers.MinRetryPeriod":                true,
+       "Containers.ReserveExtraRAM":               true,
+       "Containers.RuntimeEngine":                 true,
+       "Containers.ShellAccess":                   true,
+       "Containers.ShellAccess.Admin":             true,
+       "Containers.ShellAccess.User":              true,
+       "Containers.SLURM":                         false,
+       "Containers.StaleLockTimeout":              false,
+       "Containers.SupportedDockerImageFormats":   true,
+       "Containers.SupportedDockerImageFormats.*": true,
+       "Containers.AlwaysUsePreemptibleInstances": true,
+       "Git":                                  false,
+       "InstanceTypes":                        true,
+       "InstanceTypes.*":                      true,
+       "InstanceTypes.*.*":                    true,
+       "Login":                                true,
+       "Login.Google":                         true,
+       "Login.Google.AlternateEmailAddresses": false,
        "Login.Google.AuthenticationRequestParameters":        false,
        "Login.Google.ClientID":                               false,
        "Login.Google.ClientSecret":                           false,
index 4187717f8db94b9587d71ac14b3631656886ee9f..402d74bde1dcbcc2cdc3123a9f6d08f061909c16 100644 (file)
@@ -918,7 +918,7 @@ Clusters:
       #
       # This flag is ignored if no preemptible instance types are
       # configured, and has no effect on top-level containers.
-      UsePreemptibleInstances: true
+      AlwaysUsePreemptibleInstances: true
 
       # PEM encoded SSH key (RSA, DSA, or ECDSA) used by the
       # cloud dispatcher for executing containers on worker VMs.
index 6d5156e765c07cb580f695b3e83b03bf996172be..e0e0a30f723fa38f00e1394c49b4230c650152e9 100644 (file)
@@ -424,23 +424,23 @@ type InstanceType struct {
 }
 
 type ContainersConfig struct {
-       CloudVMs                    CloudVMsConfig
-       CrunchRunCommand            string
-       CrunchRunArgumentsList      []string
-       DefaultKeepCacheRAM         ByteSize
-       DispatchPrivateKey          string
-       LogReuseDecisions           bool
-       MaxComputeVMs               int
-       MaxDispatchAttempts         int
-       MaxRetryAttempts            int
-       MinRetryPeriod              Duration
-       ReserveExtraRAM             ByteSize
-       StaleLockTimeout            Duration
-       SupportedDockerImageFormats StringSet
-       UsePreemptibleInstances     bool
-       RuntimeEngine               string
-       LocalKeepBlobBuffersPerVCPU int
-       LocalKeepLogsToContainerLog string
+       CloudVMs                      CloudVMsConfig
+       CrunchRunCommand              string
+       CrunchRunArgumentsList        []string
+       DefaultKeepCacheRAM           ByteSize
+       DispatchPrivateKey            string
+       LogReuseDecisions             bool
+       MaxComputeVMs                 int
+       MaxDispatchAttempts           int
+       MaxRetryAttempts              int
+       MinRetryPeriod                Duration
+       ReserveExtraRAM               ByteSize
+       StaleLockTimeout              Duration
+       SupportedDockerImageFormats   StringSet
+       AlwaysUsePreemptibleInstances bool
+       RuntimeEngine                 string
+       LocalKeepBlobBuffersPerVCPU   int
+       LocalKeepLogsToContainerLog   string
 
        JobsAPI struct {
                Enable         string
index 3186df0905e99e626b59e6a60e07dda58dbcd112..440c3ff3551c4ace359675415cc9d144b09af807 100644 (file)
@@ -328,7 +328,7 @@ class ContainerRequest < ArvadosModel
   def set_preemptible
     if (new_record? || state_changed?) &&
        state == Committed &&
-       Rails.configuration.Containers.UsePreemptibleInstances &&
+       Rails.configuration.Containers.AlwaysUsePreemptibleInstances &&
        get_requesting_container_uuid() &&
        self.class.any_preemptible_instances?
       self.scheduling_parameters['preemptible'] = true
index c5db6e6b9e443a54550a577db32594e71194afc8..8a96c432a8df89873cccfaca7832dd9120ca9741 100644 (file)
@@ -124,7 +124,7 @@ arvcfg.declare_config "Containers.LogReuseDecisions", Boolean, :log_reuse_decisi
 arvcfg.declare_config "Containers.DefaultKeepCacheRAM", Integer, :container_default_keep_cache_ram
 arvcfg.declare_config "Containers.MaxDispatchAttempts", Integer, :max_container_dispatch_attempts
 arvcfg.declare_config "Containers.MaxRetryAttempts", Integer, :container_count_max
-arvcfg.declare_config "Containers.UsePreemptibleInstances", Boolean, :preemptible_instances
+arvcfg.declare_config "Containers.AlwaysUsePreemptibleInstances", Boolean, :preemptible_instances
 arvcfg.declare_config "Containers.MaxComputeVMs", Integer, :max_compute_nodes
 arvcfg.declare_config "Containers.Logging.LogBytesPerEvent", Integer, :crunch_log_bytes_per_event
 arvcfg.declare_config "Containers.Logging.LogSecondsBetweenEvents", ActiveSupport::Duration, :crunch_log_seconds_between_events
index b7a1a7636ea94c06bc224381e25552b9d099e98c..9b35769ef2f0886ab3e1595d280b0a9a133fb83e 100644 (file)
@@ -984,15 +984,15 @@ class ContainerRequestTest < ActiveSupport::TestCase
     [false, true, false, false, false],
     [true, true, false, false, false],
     # client requests non-preemptible for child container, preemptible
-    # is enabled anyway if UsePreemptibleInstances and instance types
+    # is enabled anyway if AlwaysUsePreemptibleInstances and instance types
     # are configured.
     [false, false, true, false, false],
     [true, false, true, false, false],
     [false, true, true, false, false],
     [true, true, true, false, true],
   ].each do |use_preemptible, have_preemptible, is_child, ask, expect|
-    test "with UsePreemptibleInstances=#{use_preemptible} and preemptible types #{have_preemptible ? '' : 'not '}configured, create #{is_child ? 'child' : 'top-level'} container request with preemptible=#{ask} and expect #{expect}" do
-      Rails.configuration.Containers.UsePreemptibleInstances = use_preemptible
+    test "with AlwaysUsePreemptibleInstances=#{use_preemptible} and preemptible types #{have_preemptible ? '' : 'not '}configured, create #{is_child ? 'child' : 'top-level'} container request with preemptible=#{ask} and expect #{expect}" do
+      Rails.configuration.Containers.AlwaysUsePreemptibleInstances = use_preemptible
       if have_preemptible
         configure_preemptible_instance_type
       end
@@ -1044,12 +1044,12 @@ class ContainerRequestTest < ActiveSupport::TestCase
 
     with_container_auth(parent) do
       configure_preemptible_instance_type
-      Rails.configuration.Containers.UsePreemptibleInstances = false
+      Rails.configuration.Containers.AlwaysUsePreemptibleInstances = false
 
       expect[true].push create_minimal_req!(attrs_p)
       expect[false].push create_minimal_req!(attrs_nonp)
 
-      Rails.configuration.Containers.UsePreemptibleInstances = true
+      Rails.configuration.Containers.AlwaysUsePreemptibleInstances = true
 
       expect[true].push create_minimal_req!(attrs_p)
       expect[true].push create_minimal_req!(attrs_nonp)