Project

General

Profile

Cluster configuration » History » Version 24

Tom Clegg, 01/23/2019 08:40 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 22 Tom Clegg
h2. Instructions for ops
21
22 24 Tom Clegg
Tentative instructions for switching config file format/location:
23
# Upgrade Arvados to a version that supports loading all configs from the new cluster-wide config file (maybe 1.4). When services come back up, they will still use your old configuration files, but they will log some deprecation warnings.
24 22 Tom Clegg
# Migrate your configuration to the new config file, one component at a time. For each component:
25
## Restart the component.
26
## Inspect the deprecation warning that is logged at startup. It will tell you either "old config file is superfluous" or "new config file is incomplete".
27
## If your old config file is superfluous, delete it. You're done.
28 23 Tom Clegg
## Run the component with the "--config-diff" flag. This suggests changes to your new config file which will make your old config file obsolete. (Alternatively, run the component with the "--config-dump" flag. This outputs a new config file that would make your old config file obsolete. Saving this might be easier than applying a diff, but it will reorder keys and lose comments.)
29 22 Tom Clegg
## Make the suggested changes.
30 1 Tom Clegg
## Repeat until finished.
31 22 Tom Clegg
# Upgrade to a version that doesn't support old config files at all (maybe 1.5).
32 24 Tom Clegg
33 22 Tom Clegg
34 19 Tom Clegg
h2. Implementation
35 1 Tom Clegg
36 22 Tom Clegg
Development strategy for facilitating the above ops instructions:
37 1 Tom Clegg
# Read the new config file into an internal struct, if the new config file exists.
38
# Copy old config file values into the new config struct.
39 19 Tom Clegg
# Use the new config struct internally (the old config is no longer referenced except in the load-and-copy-to-new-struct step).
40 22 Tom Clegg
# Add a mechanism for showing the effect of the old config file on the resulting config struct (see "--config-diff" above).
41
# At startup, if the old config has any effect (i.e., some parts haven't been migrated to the new config file by the operator), log a deprecation warning recommending "--config-diff" and RTFM.
42 1 Tom Clegg
# Wait one minor version release cycle.
43 19 Tom Clegg
# Error out if the new config file does not exist.
44
# Error out if the old config file exists (...and some parts of the old config are not redundant [optional?]).
45 22 Tom Clegg
46 19 Tom Clegg
47 1 Tom Clegg
h2. Example config file
48
49
(Format not yet frozen!)
50
51 20 Tom Clegg
Notes:
52
* Keys are CamelCase &mdash; except in special cases like PostgreSQL connection settings, which are passed through to another system without being interpreted by Arvados.
53
* Arrays and lists are not permitted. These cannot be expressed natively in consul, and tend to be troublesome anyway: "what changed?" is harder to answer usefully, significance of duplicate elements is unclear, etc.
54
55 1 Tom Clegg
<pre><code class="yaml">
56
Clusters:
57
  xyzzy:
58 16 Tom Clegg
    ManagementToken: eec1999ccb6d75840a2c09bc70b6d3cbc990744e
59 1 Tom Clegg
    BlobSigningKey: ungu355able
60
    BlobSignatureTTL: 172800
61 6 Tom Clegg
    SessionKey: 186005aa54cab1ca95a3738e6e954e0a35a96d3d13a8ea541f4156e8d067b4f3
62 4 Tom Clegg
    PostgreSQL:
63 11 Tom Clegg
      ConnectionPool: 32 # max concurrent connections per arvados server daemon
64 10 Tom Clegg
      Connection:
65
        # All parameters here are passed to the PG client library in a connection string;
66
        # see https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS
67
        Host: localhost
68
        Port: 5432
69
        User: arvados
70
        Password: s3cr3t
71
        DBName: arvados_production
72
        client_encoding: utf8
73
        fallback_application_name: arvados
74 4 Tom Clegg
    HTTPRequestTimeout: 5m
75 6 Tom Clegg
    Defaults:
76
      CollectionReplication: 2
77
      TrashLifetime: 2w
78
    UserActivation:
79
      ActivateNewUsers: true
80
      AutoAdminUser: root@example.com
81
      UserProfileNotificationAddress: notify@example.com
82 8 Tom Clegg
      NewUserNotificationRecipients: {}
83
      NewInactiveUserNotificationRecipients: {}
84 15 Tom Clegg
    RequestLimits:
85 6 Tom Clegg
      MaxRequestLogParamsSize: 2KB
86
      MaxRequestSize: 128MiB
87
      MaxIndexDatabaseRead: 128MiB
88 1 Tom Clegg
      MaxItemsPerResponse: 1000
89 15 Tom Clegg
      MultiClusterRequestConcurrency: 4
90 14 Tom Clegg
    LogLevel: info
91
    CloudVMs:
92 17 Tom Clegg
      BootProbeCommand: "docker ps -q"
93
      SSHPort: 22
94
      SyncInterval: 1m    # how often to get list of active instances from cloud provider
95
      TimeoutIdle: 1m     # shutdown if idle longer than this
96
      TimeoutBooting: 10m # shutdown if exists longer than this without running BootProbeCommand successfully
97
      TimeoutProbe: 2m    # shutdown if (after booting) communication fails longer than this, even if ctrs are running
98
      TimeoutShutdown: 1m # shutdown again if node still exists this long after shutdown
99 1 Tom Clegg
      Driver: Amazon
100 14 Tom Clegg
      DriverParameters:
101
        Region: us-east-1
102
        APITimeout: 20s
103 17 Tom Clegg
        AWSAccessKeyID: abcdef
104
        AWSSecretAccessKey: abcdefghijklmnopqrstuvwxyz
105 14 Tom Clegg
        ImageID: ami-0a01b48b88d14541e
106
        SubnetID: subnet-24f5ae62
107
        SecurityGroups: sg-3ec53e2a
108 13 Lucas Di Pentima
    AuditLogs:
109
      MaxAge: 2w
110 6 Tom Clegg
      DeleteBatchSize: 100000
111
      UnloggedAttributes: {} # example: {"manifest_text": true}
112
    ContainerLogStream:
113 8 Tom Clegg
      BatchSize: 4KiB
114 6 Tom Clegg
      BatchTime: 1s
115
      ThrottlePeriod: 1m
116
      ThrottleThresholdSize: 64KiB
117
      ThrottleThresholdLines: 1024
118
      TruncateSize: 64MiB
119
      PartialLineThrottlePeriod: 5s
120
    Timers:
121
      TrashSweepInterval: 60s
122 14 Tom Clegg
      ContainerDispatchPollInterval: 10s
123
      APIRequestTimeout: 20s
124 6 Tom Clegg
    Scaling:
125
      MaxComputeNodes: 64
126
      EnablePreemptibleInstances: false
127 8 Tom Clegg
    DisableAPIMethods: {} # example: {"jobs.create": true}
128
    DockerImageFormats: {"v2": true}
129 6 Tom Clegg
    Crunch1:
130
      Enable: true
131
      CrunchJobWrapper: none
132
      CrunchJobUser: crunch
133 12 Tom Clegg
      CrunchRefreshTrigger: /tmp/crunch_refresh_trigger
134 6 Tom Clegg
      DefaultDockerImage: false
135 4 Tom Clegg
    NodeProfiles:
136
      # Key is a profile name; can be specified on service prog command line, defaults to $(hostname)
137
      keep:
138
        # Don’t run other services automatically -- only specified ones
139
        Default: {Disable: true}
140
        Keepstore: {Listen: ":25107"}
141
      apiserver:
142
        Default: {Disable: true}
143
        RailsAPI: {Listen: ":9000", TLS: true}
144
        Controller: {Listen: ":9100"}
145 1 Tom Clegg
        Websocket: {Listen: ":9101"}
146
        Health: {Listen: ":9199"}
147
      keep:
148
        Default: {Disable: true}
149
        KeepProxy: {Listen: ":9102"}
150
        KeepWeb: {Listen: ":9103"}
151
      *:
152
        # This section used for a node whose profile name is not listed above
153 13 Lucas Di Pentima
        Default: {Disable: false} # (this is the default behavior)
154
    Volumes:
155
      xyzzy-keep-0:
156
        Type: s3
157
        Region: us-east
158
        Bucket: xyzzy-keep-0
159
        # [rest of keepstore volume config goes here]
160 4 Tom Clegg
    WebRoutes:
161 5 Tom Clegg
      # “default” means route according to method/host/path (e.g., if host is a login shell, route there)
162 4 Tom Clegg
      xyzzy.arvadosapi.com: default
163
      # “collections” means always route to keep-web
164
      collections.xyzzy.arvadosapi.com: collections
165
      # leading * is a wildcard (longest match wins)
166
      "*--collections.xyzzy.arvadosapi.com": collections
167
      cloud.curoverse.com: workbench
168
      workbench.xyzzy.arvadosapi.com: workbench
169
      "*.xyzzy.arvadosapi.com": default
170 3 Tom Clegg
    InstanceTypes:
171 8 Tom Clegg
      m4.large:
172
        VCPUs: 2
173
        RAM: 8000000000
174
        Scratch: 31000000000
175
        Price: 0.1
176
      m4.large-1t:
177
        # same instance type as m4.large but our scripts attach more scratch
178
        ProviderType: m4.large
179
        VCPUs: 2
180
        RAM: 8000000000
181
        Scratch: 999000000000
182
        Price: 0.12
183
      m4.xlarge:
184
        VCPUs: 4
185
        RAM: 16000000000
186
        Scratch: 78000000000
187
        Price: 0.2
188
      m4.8xlarge:
189
        VCPUs: 40
190
        RAM: 160000000000
191
        Scratch: 156000000000
192
        Price: 2
193
      m4.16xlarge:
194
        VCPUs: 64
195
        RAM: 256000000000
196
        Scratch: 310000000000
197
        Price: 3.2
198
      c4.large:
199
        VCPUs: 2
200
        RAM: 3750000000
201
        Price: 0.1
202
      c4.8xlarge:
203
        VCPUs: 36
204
        RAM: 60000000000
205
        Price: 1.591
206 9 Tom Clegg
    RemoteClusters:
207
      xrrrr:
208
        Host: xrrrr.arvadosapi.com
209
        Proxy: true        # proxy requests to xrrrr on behalf of our clients
210
        AuthProvider: true # users authenticated by xrrrr can use our cluster
211 1 Tom Clegg
</code></pre>