13647: Merge branch 'master' into 13647-keepstore-config
authorTom Clegg <tclegg@veritasgenetics.com>
Tue, 10 Sep 2019 19:22:45 +0000 (15:22 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Tue, 10 Sep 2019 19:22:45 +0000 (15:22 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

1  2 
lib/config/config.default.yml
lib/config/export.go
lib/config/generated_config.go
sdk/go/arvados/config.go

index d13a93e605db5e8df8d9bd8b065ee197896fea68,c7a038bec6c5da05fbeef993acae2f31ff7197b9..c1d79ff27a6abab2a2b2aa87c3f07d5b17863a0e
@@@ -26,8 -26,7 +26,8 @@@ Clusters
        SAMPLE:
          InternalURLs:
            "http://example.host:12345": {}
 -          SAMPLE: {}
 +          SAMPLE:
 +            Rendezvous: ""
          ExternalURL: "-"
  
        RailsAPI:
        # parameter higher than this value, this value is used instead.
        MaxItemsPerResponse: 1000
  
 +      # Maximum number of concurrent requests to accept in a single
 +      # service process, or 0 for no limit. Currently supported only
 +      # by keepstore.
 +      MaxConcurrentRequests: 0
 +
 +      # Maximum number of 64MiB memory buffers per keepstore server
 +      # process, or 0 for no limit.
 +      MaxKeepBlockBuffers: 128
 +
        # API methods to disable. Disabled methods are not listed in the
        # discovery document, and respond 404 to all requests.
        # Example: {"jobs.create":{}, "pipeline_instances.create": {}}
  
        # BlobSigningKey is a string of alphanumeric characters used to
        # generate permission signatures for Keep locators. It must be
 -      # identical to the permission key given to Keep. IMPORTANT: This is
 -      # a site secret. It should be at least 50 characters.
 +      # identical to the permission key given to Keep. IMPORTANT: This
 +      # is a site secret. It should be at least 50 characters.
        #
        # Modifying BlobSigningKey will invalidate all existing
        # signatures, which can cause programs to fail (e.g., arv-put,
 -      # arv-get, and Crunch jobs).  To avoid errors, rotate keys only when
 -      # no such processes are running.
 +      # arv-get, and Crunch jobs).  To avoid errors, rotate keys only
 +      # when no such processes are running.
        BlobSigningKey: ""
  
 +      # Enable garbage collection of unreferenced blobs in Keep.
 +      BlobTrash: true
 +
 +      # Time to leave unreferenced blobs in "trashed" state before
 +      # deleting them, or 0 to skip the "trashed" state entirely and
 +      # delete unreferenced blobs.
 +      #
 +      # If you use any Amazon S3 buckets as storage volumes, this
 +      # must be at least 24h to avoid occasional data loss.
 +      BlobTrashLifetime: 336h
 +
 +      # How often to check for (and delete) trashed blocks whose
 +      # BlobTrashLifetime has expired.
 +      BlobTrashCheckInterval: 24h
 +
 +      # Maximum number of concurrent "trash blob" and "delete trashed
 +      # blob" operations conducted by a single keepstore process. Each
 +      # of these can be set to 0 to disable the respective operation.
 +      #
 +      # If BlobTrashLifetime is zero, "trash" and "delete trash"
 +      # happen at once, so only the lower of these two values is used.
 +      BlobTrashConcurrency: 4
 +      BlobDeleteConcurrency: 4
 +
 +      # Maximum number of concurrent "create additional replica of
 +      # existing blob" operations conducted by a single keepstore
 +      # process.
 +      BlobReplicateConcurrency: 4
 +
        # Default replication level for collections. This is used when a
        # collection's replication_desired attribute is nil.
        DefaultReplication: 2
          MaxUUIDEntries:       1000
  
      Login:
-       # These settings are provided by your OAuth2 provider (e.g.,
-       # sso-provider).
+       # These settings are provided by your OAuth2 provider (eg
+       # Google) used to perform upstream authentication.
        ProviderAppSecret: ""
        ProviderAppID: ""
  
+       # The cluster ID to delegate the user database.  When set,
+       # logins on this cluster will be redirected to the login cluster
+       # (login cluster must appear in RemoteHosts with Proxy: true)
+       LoginCluster: ""
+       # How long a cached token belonging to a remote cluster will
+       # remain valid before it needs to be revalidated.
+       RemoteTokenRefresh: 5m
      Git:
        # Path to git or gitolite-shell executable. Each authenticated
        # request will execute this program with the single argument "http-backend"
          Price: 0.1
          Preemptible: false
  
 +    Volumes:
 +      SAMPLE:
 +        AccessViaHosts:
 +          SAMPLE:
 +            ReadOnly: false
 +        ReadOnly: false
 +        Replication: 1
 +        StorageClasses:
 +          default: true
 +          SAMPLE: true
 +        Driver: s3
 +        DriverParameters:
 +
 +          # for s3 driver
 +          AccessKey: aaaaa
 +          SecretKey: aaaaa
 +          Endpoint: ""
 +          Region: us-east-1a
 +          Bucket: aaaaa
 +          LocationConstraint: false
 +          IndexPageSize: 1000
 +          ConnectTimeout: 1m
 +          ReadTimeout: 10m
 +          RaceWindow: 24h
 +          UnsafeDelete: false
 +
 +          # for azure driver
 +          StorageAccountName: aaaaa
 +          StorageAccountKey: aaaaa
 +          StorageBaseURL: core.windows.net
 +          ContainerName: aaaaa
 +          RequestTimeout: 30s
 +          ListBlobsRetryDelay: 10s
 +          ListBlobsMaxAttempts: 10
 +          MaxGetBytes: 0
 +          WriteRaceInterval: 15s
 +          WriteRacePollTime: 1s
 +
 +          # for local directory driver
 +          Root: /var/lib/arvados/keep-data
 +          Serialize: false
 +
      Mail:
        MailchimpAPIKey: ""
        MailchimpListID: ""
diff --combined lib/config/export.go
index 57f62fa83589f458d61e47405f29eafea6b75388,69aae2c624a68ed4fcf5837739e33e3d97fc30e7..f545abc14f71aebb36db2f90d6c1520cf40855ab
@@@ -63,10 -63,8 +63,10 @@@ var whitelist = map[string]bool
        "API":                                          true,
        "API.AsyncPermissionsUpdateInterval":           false,
        "API.DisabledAPIs":                             false,
 +      "API.MaxConcurrentRequests":                    false,
        "API.MaxIndexDatabaseRead":                     false,
        "API.MaxItemsPerResponse":                      true,
 +      "API.MaxKeepBlockBuffers":                      false,
        "API.MaxRequestAmplification":                  false,
        "API.MaxRequestSize":                           true,
        "API.RailsSessionSecretToken":                  false,
        "Collections.BlobSigning":                      true,
        "Collections.BlobSigningKey":                   false,
        "Collections.BlobSigningTTL":                   true,
 +      "Collections.BlobTrash":                        false,
 +      "Collections.BlobTrashLifetime":                false,
 +      "Collections.BlobTrashConcurrency":             false,
 +      "Collections.BlobTrashCheckInterval":           false,
 +      "Collections.BlobDeleteConcurrency":            false,
 +      "Collections.BlobReplicateConcurrency":         false,
        "Collections.CollectionVersioning":             false,
        "Collections.DefaultReplication":               true,
        "Collections.DefaultTrashLifetime":             true,
        "InstanceTypes":                                true,
        "InstanceTypes.*":                              true,
        "InstanceTypes.*.*":                            true,
-       "Login":                                        false,
+       "Login":                                        true,
+       "Login.ProviderAppSecret":                      false,
+       "Login.ProviderAppID":                          false,
+       "Login.LoginCluster":                           true,
+       "Login.RemoteTokenRefresh":                     true,
        "Mail":                                         false,
        "ManagementToken":                              false,
        "PostgreSQL":                                   false,
        "Users.NewUsersAreActive":                      false,
        "Users.UserNotifierEmailFrom":                  false,
        "Users.UserProfileNotificationAddress":         false,
 +      "Volumes":                                      true,
 +      "Volumes.*":                                    true,
 +      "Volumes.*.*":                                  false,
 +      "Volumes.*.AccessViaHosts":                     true,
 +      "Volumes.*.AccessViaHosts.*":                   true,
 +      "Volumes.*.AccessViaHosts.*.ReadOnly":          true,
 +      "Volumes.*.ReadOnly":                           true,
 +      "Volumes.*.Replication":                        true,
 +      "Volumes.*.StorageClasses":                     true,
 +      "Volumes.*.StorageClasses.*":                   false,
        "Workbench":                                    true,
        "Workbench.ActivationContactLink":              false,
        "Workbench.APIClientConnectTimeout":            true,
index 89cfb800972a215c99ec92f9ceb4bb1f36179986,f8a0e097dc7d4e3f9de577d747cd9c0b54a87d0b..ecc2e8ea010630e857766a2e785281a03b8a8a09
@@@ -32,8 -32,7 +32,8 @@@ Clusters
        SAMPLE:
          InternalURLs:
            "http://example.host:12345": {}
 -          SAMPLE: {}
 +          SAMPLE:
 +            Rendezvous: ""
          ExternalURL: "-"
  
        RailsAPI:
        # parameter higher than this value, this value is used instead.
        MaxItemsPerResponse: 1000
  
 +      # Maximum number of concurrent requests to accept in a single
 +      # service process, or 0 for no limit. Currently supported only
 +      # by keepstore.
 +      MaxConcurrentRequests: 0
 +
 +      # Maximum number of 64MiB memory buffers per keepstore server
 +      # process, or 0 for no limit.
 +      MaxKeepBlockBuffers: 128
 +
        # API methods to disable. Disabled methods are not listed in the
        # discovery document, and respond 404 to all requests.
        # Example: {"jobs.create":{}, "pipeline_instances.create": {}}
  
        # BlobSigningKey is a string of alphanumeric characters used to
        # generate permission signatures for Keep locators. It must be
 -      # identical to the permission key given to Keep. IMPORTANT: This is
 -      # a site secret. It should be at least 50 characters.
 +      # identical to the permission key given to Keep. IMPORTANT: This
 +      # is a site secret. It should be at least 50 characters.
        #
        # Modifying BlobSigningKey will invalidate all existing
        # signatures, which can cause programs to fail (e.g., arv-put,
 -      # arv-get, and Crunch jobs).  To avoid errors, rotate keys only when
 -      # no such processes are running.
 +      # arv-get, and Crunch jobs).  To avoid errors, rotate keys only
 +      # when no such processes are running.
        BlobSigningKey: ""
  
 +      # Enable garbage collection of unreferenced blobs in Keep.
 +      BlobTrash: true
 +
 +      # Time to leave unreferenced blobs in "trashed" state before
 +      # deleting them, or 0 to skip the "trashed" state entirely and
 +      # delete unreferenced blobs.
 +      #
 +      # If you use any Amazon S3 buckets as storage volumes, this
 +      # must be at least 24h to avoid occasional data loss.
 +      BlobTrashLifetime: 336h
 +
 +      # How often to check for (and delete) trashed blocks whose
 +      # BlobTrashLifetime has expired.
 +      BlobTrashCheckInterval: 24h
 +
 +      # Maximum number of concurrent "trash blob" and "delete trashed
 +      # blob" operations conducted by a single keepstore process. Each
 +      # of these can be set to 0 to disable the respective operation.
 +      #
 +      # If BlobTrashLifetime is zero, "trash" and "delete trash"
 +      # happen at once, so only the lower of these two values is used.
 +      BlobTrashConcurrency: 4
 +      BlobDeleteConcurrency: 4
 +
 +      # Maximum number of concurrent "create additional replica of
 +      # existing blob" operations conducted by a single keepstore
 +      # process.
 +      BlobReplicateConcurrency: 4
 +
        # Default replication level for collections. This is used when a
        # collection's replication_desired attribute is nil.
        DefaultReplication: 2
          MaxUUIDEntries:       1000
  
      Login:
-       # These settings are provided by your OAuth2 provider (e.g.,
-       # sso-provider).
+       # These settings are provided by your OAuth2 provider (eg
+       # Google) used to perform upstream authentication.
        ProviderAppSecret: ""
        ProviderAppID: ""
  
+       # The cluster ID to delegate the user database.  When set,
+       # logins on this cluster will be redirected to the login cluster
+       # (login cluster must appear in RemoteHosts with Proxy: true)
+       LoginCluster: ""
+       # How long a cached token belonging to a remote cluster will
+       # remain valid before it needs to be revalidated.
+       RemoteTokenRefresh: 5m
      Git:
        # Path to git or gitolite-shell executable. Each authenticated
        # request will execute this program with the single argument "http-backend"
          Price: 0.1
          Preemptible: false
  
 +    Volumes:
 +      SAMPLE:
 +        AccessViaHosts:
 +          SAMPLE:
 +            ReadOnly: false
 +        ReadOnly: false
 +        Replication: 1
 +        StorageClasses:
 +          default: true
 +          SAMPLE: true
 +        Driver: s3
 +        DriverParameters:
 +
 +          # for s3 driver
 +          AccessKey: aaaaa
 +          SecretKey: aaaaa
 +          Endpoint: ""
 +          Region: us-east-1a
 +          Bucket: aaaaa
 +          LocationConstraint: false
 +          IndexPageSize: 1000
 +          ConnectTimeout: 1m
 +          ReadTimeout: 10m
 +          RaceWindow: 24h
 +          UnsafeDelete: false
 +
 +          # for azure driver
 +          StorageAccountName: aaaaa
 +          StorageAccountKey: aaaaa
 +          StorageBaseURL: core.windows.net
 +          ContainerName: aaaaa
 +          RequestTimeout: 30s
 +          ListBlobsRetryDelay: 10s
 +          ListBlobsMaxAttempts: 10
 +          MaxGetBytes: 0
 +          WriteRaceInterval: 15s
 +          WriteRacePollTime: 1s
 +
 +          # for local directory driver
 +          Root: /var/lib/arvados/keep-data
 +          Serialize: false
 +
      Mail:
        MailchimpAPIKey: ""
        MailchimpListID: ""
diff --combined sdk/go/arvados/config.go
index 6f78073ac8df415287b5efbf80cec6d4c356e0a0,29dd62ac1eb2ca3f0c224bd08033284451f45c05..a058f6181bba1f7b8bb2cd9e5b2703f78be54aae
@@@ -81,8 -81,6 +81,8 @@@ type Cluster struct 
                DisabledAPIs                   StringSet
                MaxIndexDatabaseRead           int
                MaxItemsPerResponse            int
 +              MaxConcurrentRequests          int
 +              MaxKeepBlockBuffers            int
                MaxRequestAmplification        int
                MaxRequestSize                 int
                RailsSessionSecretToken        string
                UnloggedAttributes StringSet
        }
        Collections struct {
 -              BlobSigning          bool
 -              BlobSigningKey       string
 -              BlobSigningTTL       Duration
 -              CollectionVersioning bool
 -              DefaultTrashLifetime Duration
 -              DefaultReplication   int
 -              ManagedProperties    map[string]struct {
 +              BlobSigning              bool
 +              BlobSigningKey           string
 +              BlobSigningTTL           Duration
 +              BlobTrash                bool
 +              BlobTrashLifetime        Duration
 +              BlobTrashCheckInterval   Duration
 +              BlobTrashConcurrency     int
 +              BlobDeleteConcurrency    int
 +              BlobReplicateConcurrency int
 +              CollectionVersioning     bool
 +              DefaultTrashLifetime     Duration
 +              DefaultReplication       int
 +              ManagedProperties        map[string]struct {
                        Value     interface{}
                        Function  string
                        Protected bool
                Repositories string
        }
        Login struct {
-               ProviderAppSecret string
-               ProviderAppID     string
+               ProviderAppSecret  string
+               ProviderAppID      string
+               LoginCluster       string
+               RemoteTokenRefresh Duration
        }
        Mail struct {
                MailchimpAPIKey                string
                UserNotifierEmailFrom                 string
                UserProfileNotificationAddress        string
        }
 +      Volumes   map[string]Volume
        Workbench struct {
                ActivationContactLink            string
                APIClientConnectTimeout          Duration
        EnableBetaController14287 bool
  }
  
 +type Volume struct {
 +      AccessViaHosts   map[URL]VolumeAccess
 +      ReadOnly         bool
 +      Replication      int
 +      StorageClasses   map[string]bool
 +      Driver           string
 +      DriverParameters json.RawMessage
 +}
 +
 +type S3VolumeDriverParameters struct {
 +      AccessKey          string
 +      SecretKey          string
 +      Endpoint           string
 +      Region             string
 +      Bucket             string
 +      LocationConstraint bool
 +      IndexPageSize      int
 +      ConnectTimeout     Duration
 +      ReadTimeout        Duration
 +      RaceWindow         Duration
 +      UnsafeDelete       bool
 +}
 +
 +type AzureVolumeDriverParameters struct {
 +      StorageAccountName   string
 +      StorageAccountKey    string
 +      StorageBaseURL       string
 +      ContainerName        string
 +      RequestTimeout       Duration
 +      ListBlobsRetryDelay  Duration
 +      ListBlobsMaxAttempts int
 +}
 +
 +type DirectoryVolumeDriverParameters struct {
 +      Root      string
 +      Serialize bool
 +}
 +
 +type VolumeAccess struct {
 +      ReadOnly bool
 +}
 +
  type Services struct {
        Composer       Service
        Controller     Service
@@@ -290,16 -241,7 +292,16 @@@ func (su URL) MarshalText() ([]byte, er
        return []byte(fmt.Sprintf("%s", (*url.URL)(&su).String())), nil
  }
  
 -type ServiceInstance struct{}
 +func (su URL) String() string {
 +      return (*url.URL)(&su).String()
 +}
 +
 +type ServiceInstance struct {
 +      // Rendezvous is normally empty; when changing the URL of a
 +      // Keepstore service, Rendezvous can be set to the old URL to
 +      // preserve rendezvous ordering.
 +      Rendezvous string `json:",omitempty"`
 +}
  
  type PostgreSQL struct {
        Connection     PostgreSQLConnection