-
Notifications
You must be signed in to change notification settings - Fork 368
Expand file tree
/
Copy pathworker_schema.rb
More file actions
251 lines (211 loc) · 8.1 KB
/
worker_schema.rb
File metadata and controls
251 lines (211 loc) · 8.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
require 'vcap/config'
module VCAP::CloudController
module ConfigSchemas
class WorkerSchema < VCAP::Config
# rubocop:disable Metrics/BlockLength
define_schema do
{
external_port: Integer,
external_domain: String,
system_hostnames: [String],
system_domain: String,
tls_port: Integer,
external_protocol: String,
internal_service_hostname: String,
disable_private_domain_cross_space_context_path_route_sharing: bool,
max_route_options_size: Integer,
readiness_port: {
cloud_controller_worker: Integer
},
default_health_check_timeout: Integer,
maximum_health_check_timeout: Integer,
optional(:temporary_enable_v2) => bool,
uaa: {
internal_url: String,
optional(:ca_file) => String,
client_timeout: Integer
},
logging: {
level: String, # debug, info, etc.
file: String, # Log file to use
syslog: String # Name to associate with syslog messages (should start with 'vcap.')
},
log_audit_events: bool,
directories: {
tmpdir: String
},
stacks_file: String,
optional(:storage_cli_config_file_buildpacks) => String,
optional(:storage_cli_config_file_packages) => String,
optional(:storage_cli_config_file_resource_pool) => String,
optional(:storage_cli_config_file_droplets) => String,
optional(:storage_cli_optional_flags) => String,
newrelic_enabled: bool,
optional(:max_migration_duration_in_minutes) => Integer,
db: {
optional(:database) => Hash, # db connection hash for sequel
max_connections: Integer, # max connections in the connection pool
pool_timeout: Integer, # timeout before raising an error when connection can't be established to the db
log_level: String, # debug, info, etc.
log_db_queries: bool,
ssl_verify_hostname: bool,
connection_validation_timeout: Integer,
optional(:ca_cert_path) => String
},
staging: {
auth: {
user: String,
password: String
},
timeout_in_seconds: Integer
},
diego: {
bbs: {
url: String,
ca_file: String,
cert_file: String,
key_file: String,
connect_timeout: Integer,
send_timeout: Integer,
receive_timeout: Integer
},
cc_uploader_url: String,
file_server_url: String,
lifecycle_bundles: Hash,
droplet_destinations: Hash,
pid_limit: Integer,
use_privileged_containers_for_running: bool,
use_privileged_containers_for_staging: bool,
optional(:temporary_oci_buildpack_mode) => enum('oci-phase-1', NilClass),
enable_declarative_asset_downloads: bool
},
app_log_revision: bool,
index: Integer, # Component index (cc-0, cc-1, etc)
name: String, # Component name (api_z1, api_z2)
local_route: String, # If set, use this to determine the IP address that is returned in discovery messages
nginx: {
use_nginx: bool,
instance_socket: String
},
resource_pool: {
maximum_size: Integer,
minimum_size: Integer,
resource_directory_key: String,
fog_connection: Hash,
optional(:connection_config) => Hash,
fog_aws_storage_options: Hash,
fog_gcp_storage_options: Hash
},
buildpacks: {
buildpack_directory_key: String,
fog_connection: Hash,
optional(:connection_config) => Hash,
fog_aws_storage_options: Hash,
fog_gcp_storage_options: Hash
},
packages: {
max_package_size: Integer,
max_valid_packages_stored: Integer,
app_package_directory_key: String,
fog_connection: Hash,
optional(:connection_config) => Hash,
fog_aws_storage_options: Hash,
fog_gcp_storage_options: Hash
},
droplets: {
droplet_directory_key: String,
fog_connection: Hash,
optional(:connection_config) => Hash,
fog_aws_storage_options: Hash,
fog_gcp_storage_options: Hash
},
db_encryption_key: enum(String, NilClass),
optional(:database_encryption) => {
keys: Hash,
current_key_label: String,
optional(:pbkdf2_hmac_iterations) => Integer
},
disable_custom_buildpacks: bool,
broker_client_timeout_seconds: Integer,
broker_client_default_async_poll_interval_seconds: Integer,
broker_client_max_async_poll_duration_minutes: Integer,
broker_client_async_poll_exponential_backoff_rate: Numeric,
broker_client_max_async_poll_interval_seconds: Integer,
optional(:broker_client_response_parser) => {
log_errors: bool,
log_validators: bool,
log_response_fields: Hash
},
optional(:uaa_client_name) => String,
optional(:uaa_client_secret) => String,
optional(:uaa_client_scope) => String,
optional(:cc_service_key_client_name) => String,
optional(:credhub_api) => {
internal_url: String
},
credential_references: {
interpolate_service_bindings: bool
},
optional(:loggregator) => {
router: String
},
optional(:fluent) => {
optional(:host) => String,
optional(:port) => Integer
},
optional(:publish_metrics) => bool,
optional(:prometheus_port) => Integer,
skip_cert_verify: bool,
optional(:routing_api) => {
url: String,
routing_client_name: String,
routing_client_secret: String
},
allow_app_ssh_access: bool,
perform_blob_cleanup: bool,
cpu_weight_min_memory: Integer,
cpu_weight_max_memory: Integer,
default_app_memory: Integer,
default_app_disk_in_mb: Integer,
instance_file_descriptor_limit: Integer,
maximum_app_disk_in_mb: Integer,
default_app_log_rate_limit_in_bytes_per_second: Integer,
default_app_ssh_access: bool,
additional_allowed_process_users: Array,
allow_docker_root_user: bool,
jobs: {
global: {
timeout_in_seconds: Integer,
worker_sleep_delay_in_seconds: Integer
},
queues: {
optional(:cc_generic) => { timeout_in_seconds: Integer }
},
optional(:read_ahead) => Integer,
optional(:enable_dynamic_job_priorities) => bool,
optional(:app_usage_events_cleanup) => { timeout_in_seconds: Integer },
optional(:blobstore_delete) => { timeout_in_seconds: Integer },
optional(:diego_sync) => { timeout_in_seconds: Integer },
optional(:priorities) => Hash
},
volume_services_enabled: bool,
route_services_enabled: bool,
max_manifest_service_binding_poll_duration_in_seconds: Integer,
max_service_credential_bindings_per_app_service_instance: Integer,
max_labels_per_resource: Integer,
max_annotations_per_resource: Integer,
custom_metric_tag_prefix_list: Array,
default_app_lifecycle: enum('buildpack', 'cnb'),
optional(:feature_flag_overrides) => Hash
}
end
# rubocop:enable Metrics/BlockLength
class << self
def configure_components(config)
ResourcePool.instance = ResourcePool.new(config)
Stack.configure(config.get(:stacks_file))
end
end
end
end
end