15467: List to map changes (WIP)
[arvados.git] / sdk / go / arvados / config.go
index 2165e87f520bc5a16fc3af4b0abc7d4c40c3b5dd..e04849bb89810b8526244e36f1e469efa832c6b8 100644 (file)
@@ -9,11 +9,18 @@ import (
        "errors"
        "fmt"
        "net/url"
+       "os"
 
        "git.curoverse.com/arvados.git/sdk/go/config"
 )
 
-const DefaultConfigFile = "/etc/arvados/config.yml"
+var DefaultConfigFile = func() string {
+       if path := os.Getenv("ARVADOS_CONFIG"); path != "" {
+               return path
+       } else {
+               return "/etc/arvados/config.yml"
+       }
+}()
 
 type Config struct {
        Clusters map[string]Cluster
@@ -62,29 +69,37 @@ type Cluster struct {
 
        API struct {
                AsyncPermissionsUpdateInterval Duration
-               DisabledAPIs                   []string
+               DisabledAPIs                   map[string]struct{}
                MaxIndexDatabaseRead           int
                MaxItemsPerResponse            int
                MaxRequestAmplification        int
                MaxRequestSize                 int
                RailsSessionSecretToken        string
                RequestTimeout                 Duration
+               SendTimeout                    Duration
+               WebsocketClientEventQueue      int
+               WebsocketServerEventQueue      int
        }
        AuditLogs struct {
                MaxAge             Duration
                MaxDeleteBatch     int
-               UnloggedAttributes []string
+               UnloggedAttributes map[string]struct{}
        }
        Collections struct {
-               BlobSigning           bool
-               BlobSigningKey        string
-               BlobSigningTTL        Duration
-               CollectionVersioning  bool
-               DefaultTrashLifetime  Duration
-               DefaultReplication    int
-               ManagedProperties     map[string]interface{}
+               BlobSigning          bool
+               BlobSigningKey       string
+               BlobSigningTTL       Duration
+               CollectionVersioning bool
+               DefaultTrashLifetime Duration
+               DefaultReplication   int
+               ManagedProperties    map[string]struct {
+                       Value     interface{}
+                       Function  string
+                       Protected bool
+               }
                PreserveVersionIfIdle Duration
                TrashSweepInterval    Duration
+               TrustAllContent       bool
        }
        Git struct {
                Repositories string
@@ -113,16 +128,17 @@ type Cluster struct {
                Insecure    bool
        }
        Users struct {
+               AnonymousUserToken                    string
                AdminNotifierEmailFrom                string
                AutoAdminFirstUser                    bool
                AutoAdminUserWithEmail                string
                AutoSetupNewUsers                     bool
                AutoSetupNewUsersWithRepository       bool
                AutoSetupNewUsersWithVmUUID           string
-               AutoSetupUsernameBlacklist            []string
+               AutoSetupUsernameBlacklist            map[string]struct{}
                EmailSubjectPrefix                    string
-               NewInactiveUserNotificationRecipients []string
-               NewUserNotificationRecipients         []string
+               NewInactiveUserNotificationRecipients map[string]struct{}
+               NewUserNotificationRecipients         map[string]struct{}
                NewUsersAreActive                     bool
                UserNotifierEmailFrom                 string
                UserProfileNotificationAddress        string
@@ -135,16 +151,17 @@ type Cluster struct {
                ApplicationMimetypesWithViewIcon map[string]struct{}
                ArvadosDocsite                   string
                ArvadosPublicDataDocURL          string
+               DefaultOpenIdPrefix              string
                EnableGettingStartedPopup        bool
                EnablePublicProjectsPage         bool
                FileViewersConfigURL             string
                LogViewerMaxBytes                ByteSize
                MultiSiteSearch                  string
+               ProfilingEnabled                 bool
                Repositories                     bool
                RepositoryCache                  string
                RunningJobLogRecordsToFetch      int
                SecretKeyBase                    string
-               SecretToken                      string
                ShowRecentCollectionsOnDashboard bool
                ShowUserAgreementInline          bool
                ShowUserNotifications            bool
@@ -239,14 +256,18 @@ 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 []string
+       SupportedDockerImageFormats map[string]struct{}
        UsePreemptibleInstances     bool
 
        JobsAPI struct {
@@ -271,13 +292,15 @@ type ContainersConfig struct {
                LogUpdateSize                ByteSize
        }
        SLURM struct {
-               Managed struct {
+               PrioritySpread      int64
+               SbatchArgumentsList []string
+               Managed             struct {
                        DNSServerConfDir       string
                        DNSServerConfTemplate  string
                        DNSServerReloadCommand string
                        DNSServerUpdateCommand string
                        ComputeNodeDomain      string
-                       ComputeNodeNameservers []string
+                       ComputeNodeNameservers map[string]struct{}
                        AssignNodeHostname     string
                }
        }