Project

General

Profile

Cluster configuration » History » Version 22

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