Project

General

Profile

Cluster configuration » History » Version 19

Tom Clegg, 01/23/2019 04:54 PM

1 1 Tom Clegg
h1. Cluster configuration
2
3 18 Tom Clegg
We are (2019) consolidating configuration from per-microservice yaml/json/ini files into a single cluster configuration document that is used by all components.
4 1 Tom Clegg
* Long term: system nodes automatically keep their configs synchronized (using something like consul).
5
* Short term: sysadmin uses tools like puppet and terraform to ensure /etc/arvados/config.yml is identical on all system nodes.
6
* Hosts without config files (e.g., hosts outside the cluster) can retrieve the config document from the API server.
7
8
h2. Discovery document
9
10
Previously, we copied selected config values from the API server config into the API discovery document so clients could see them. When clients can get the configuration document itself, this won't be needed. The discovery document should advertise APIs provided by the server, not cluster configuration.
11
12 7 Tom Clegg
h2. Secrets
13
14
Secrets like BlobSigningKey can be given literally in the config file (convenient for dev/test, consul-template, etc) or indirectly using a secret backend. Anticipated backends:
15
* <code class="yaml">BlobSigningKey: foobar</code> &rArr; the secret is literally <code>foobar</code>
16
* <code class="yaml">BlobSigningKey: "vault:foobar"</code> &rArr; the secret can be obtained from vault using the vault key "foobar"
17
* <code class="yaml">BlobSigningKey: "file:/foobar"</code> &rArr; the secret can be read from the local file @/foobar@
18
* <code class="yaml">BlobSigningKey: "env:FOOBAR"</code> &rArr; the secret can be read from the environment variable @FOOBAR@
19
20 19 Tom Clegg
h2. Implementation
21
22
Development strategy for switching config file format/location in an operator-friendly way:
23
# Read the new config file into an internal struct, if the new config file exists.
24
# Copy old config file values into the new config struct.
25
# Use the new config struct internally (the old config is no longer referenced except in the load-and-copy-to-new-struct step).
26
# Add a mechanism for dumping the new config struct at startup/runtime after loading both new and old configs.
27
# Add a mechanism for reporting that some parts of the old config are not redundant, i.e., haven't been migrated to the new config file by the operator. [optional?]
28
# Wait one minor version release cycle.
29
# Error out if the new config file does not exist.
30
# Error out if the old config file exists (...and some parts of the old config are not redundant [optional?]).
31
32 1 Tom Clegg
h2. Example config file
33
34
(Format not yet frozen!)
35
36
<pre><code class="yaml">
37
Clusters:
38
  xyzzy:
39 16 Tom Clegg
    ManagementToken: eec1999ccb6d75840a2c09bc70b6d3cbc990744e
40 1 Tom Clegg
    BlobSigningKey: ungu355able
41
    BlobSignatureTTL: 172800
42 6 Tom Clegg
    SessionKey: 186005aa54cab1ca95a3738e6e954e0a35a96d3d13a8ea541f4156e8d067b4f3
43 4 Tom Clegg
    PostgreSQL:
44 11 Tom Clegg
      ConnectionPool: 32 # max concurrent connections per arvados server daemon
45 10 Tom Clegg
      Connection:
46
        # All parameters here are passed to the PG client library in a connection string;
47
        # see https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS
48
        Host: localhost
49
        Port: 5432
50
        User: arvados
51
        Password: s3cr3t
52
        DBName: arvados_production
53
        client_encoding: utf8
54
        fallback_application_name: arvados
55 4 Tom Clegg
    HTTPRequestTimeout: 5m
56 6 Tom Clegg
    Defaults:
57
      CollectionReplication: 2
58
      TrashLifetime: 2w
59
    UserActivation:
60
      ActivateNewUsers: true
61
      AutoAdminUser: root@example.com
62
      UserProfileNotificationAddress: notify@example.com
63 8 Tom Clegg
      NewUserNotificationRecipients: {}
64
      NewInactiveUserNotificationRecipients: {}
65 15 Tom Clegg
    RequestLimits:
66 6 Tom Clegg
      MaxRequestLogParamsSize: 2KB
67
      MaxRequestSize: 128MiB
68
      MaxIndexDatabaseRead: 128MiB
69 1 Tom Clegg
      MaxItemsPerResponse: 1000
70 15 Tom Clegg
      MultiClusterRequestConcurrency: 4
71 14 Tom Clegg
    LogLevel: info
72
    CloudVMs:
73 17 Tom Clegg
      BootProbeCommand: "docker ps -q"
74
      SSHPort: 22
75
      SyncInterval: 1m    # how often to get list of active instances from cloud provider
76
      TimeoutIdle: 1m     # shutdown if idle longer than this
77
      TimeoutBooting: 10m # shutdown if exists longer than this without running BootProbeCommand successfully
78
      TimeoutProbe: 2m    # shutdown if (after booting) communication fails longer than this, even if ctrs are running
79
      TimeoutShutdown: 1m # shutdown again if node still exists this long after shutdown
80 1 Tom Clegg
      Driver: Amazon
81 14 Tom Clegg
      DriverParameters:
82
        Region: us-east-1
83
        APITimeout: 20s
84 17 Tom Clegg
        AWSAccessKeyID: abcdef
85
        AWSSecretAccessKey: abcdefghijklmnopqrstuvwxyz
86 14 Tom Clegg
        ImageID: ami-0a01b48b88d14541e
87
        SubnetID: subnet-24f5ae62
88
        SecurityGroups: sg-3ec53e2a
89 13 Lucas Di Pentima
    AuditLogs:
90
      MaxAge: 2w
91 6 Tom Clegg
      DeleteBatchSize: 100000
92
      UnloggedAttributes: {} # example: {"manifest_text": true}
93
    ContainerLogStream:
94 8 Tom Clegg
      BatchSize: 4KiB
95 6 Tom Clegg
      BatchTime: 1s
96
      ThrottlePeriod: 1m
97
      ThrottleThresholdSize: 64KiB
98
      ThrottleThresholdLines: 1024
99
      TruncateSize: 64MiB
100
      PartialLineThrottlePeriod: 5s
101
    Timers:
102
      TrashSweepInterval: 60s
103 14 Tom Clegg
      ContainerDispatchPollInterval: 10s
104
      APIRequestTimeout: 20s
105 6 Tom Clegg
    Scaling:
106
      MaxComputeNodes: 64
107
      EnablePreemptibleInstances: false
108 8 Tom Clegg
    DisableAPIMethods: {} # example: {"jobs.create": true}
109
    DockerImageFormats: {"v2": true}
110 6 Tom Clegg
    Crunch1:
111
      Enable: true
112
      CrunchJobWrapper: none
113
      CrunchJobUser: crunch
114 12 Tom Clegg
      CrunchRefreshTrigger: /tmp/crunch_refresh_trigger
115 6 Tom Clegg
      DefaultDockerImage: false
116 4 Tom Clegg
    NodeProfiles:
117
      # Key is a profile name; can be specified on service prog command line, defaults to $(hostname)
118
      keep:
119
        # Don’t run other services automatically -- only specified ones
120
        Default: {Disable: true}
121
        Keepstore: {Listen: ":25107"}
122
      apiserver:
123
        Default: {Disable: true}
124
        RailsAPI: {Listen: ":9000", TLS: true}
125
        Controller: {Listen: ":9100"}
126 1 Tom Clegg
        Websocket: {Listen: ":9101"}
127
        Health: {Listen: ":9199"}
128
      keep:
129
        Default: {Disable: true}
130
        KeepProxy: {Listen: ":9102"}
131
        KeepWeb: {Listen: ":9103"}
132
      *:
133
        # This section used for a node whose profile name is not listed above
134 13 Lucas Di Pentima
        Default: {Disable: false} # (this is the default behavior)
135
    Volumes:
136
      xyzzy-keep-0:
137
        Type: s3
138
        Region: us-east
139
        Bucket: xyzzy-keep-0
140
        # [rest of keepstore volume config goes here]
141 4 Tom Clegg
    WebRoutes:
142 5 Tom Clegg
      # “default” means route according to method/host/path (e.g., if host is a login shell, route there)
143 4 Tom Clegg
      xyzzy.arvadosapi.com: default
144
      # “collections” means always route to keep-web
145
      collections.xyzzy.arvadosapi.com: collections
146
      # leading * is a wildcard (longest match wins)
147
      "*--collections.xyzzy.arvadosapi.com": collections
148
      cloud.curoverse.com: workbench
149
      workbench.xyzzy.arvadosapi.com: workbench
150
      "*.xyzzy.arvadosapi.com": default
151 3 Tom Clegg
    InstanceTypes:
152 8 Tom Clegg
      m4.large:
153
        VCPUs: 2
154
        RAM: 8000000000
155
        Scratch: 31000000000
156
        Price: 0.1
157
      m4.large-1t:
158
        # same instance type as m4.large but our scripts attach more scratch
159
        ProviderType: m4.large
160
        VCPUs: 2
161
        RAM: 8000000000
162
        Scratch: 999000000000
163
        Price: 0.12
164
      m4.xlarge:
165
        VCPUs: 4
166
        RAM: 16000000000
167
        Scratch: 78000000000
168
        Price: 0.2
169
      m4.8xlarge:
170
        VCPUs: 40
171
        RAM: 160000000000
172
        Scratch: 156000000000
173
        Price: 2
174
      m4.16xlarge:
175
        VCPUs: 64
176
        RAM: 256000000000
177
        Scratch: 310000000000
178
        Price: 3.2
179
      c4.large:
180
        VCPUs: 2
181
        RAM: 3750000000
182
        Price: 0.1
183
      c4.8xlarge:
184
        VCPUs: 36
185
        RAM: 60000000000
186
        Price: 1.591
187 9 Tom Clegg
    RemoteClusters:
188
      xrrrr:
189
        Host: xrrrr.arvadosapi.com
190
        Proxy: true        # proxy requests to xrrrr on behalf of our clients
191
        AuthProvider: true # users authenticated by xrrrr can use our cluster
192 1 Tom Clegg
</code></pre>