et_full_system 7.0.2 → 7.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/foreman/Procfile +2 -4
- data/foreman/traefik.json +144 -204
- data/lib/et_full_system/cli/local.rb +24 -12
- data/lib/et_full_system/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 547c2cae46678baf0823bd64996d3210cffccc6004f7b51d3c7a47c8f2ad9714
|
4
|
+
data.tar.gz: 06eb0eb61df6573e0356277b344bfd06fb620dd7805ea3223ab6bb6dbef920c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55d4f7379e5a2f533e09e54a4b53cace8be18f11ec477428ab3780633ad4ca310005ed95ee11569cea3a17d1ac94b343d77d4ea3cfd5dfffecd73d63617eac3e
|
7
|
+
data.tar.gz: 16ae911879d8917b07afd1c04cfb3c325a2d696f6c46acce41c4b2ad873135b61ce5562b4972e0488f9f90f19e7ed3a083b03722c0d4ed93299222bdcd137069
|
data/Gemfile.lock
CHANGED
data/foreman/Procfile
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
traefik: bash --login -c "traefik --
|
1
|
+
traefik: bash --login -c "traefik --providers.rest=true --providers.rest.insecure=true --api.insecure=true --api.insecure=true --entryPoints.http.address=:3100 --entryPoints.traefik.address=:3200"
|
2
|
+
fake_services: bash --login -c "cd ${FS_ROOT_PATH}/support/fake_services && ./bin/foreman start --port 9000"
|
2
3
|
et1_web: export FREEPORT=$(freeport) && godotenv -f ${FOREMAN_PATH}/.env godotenv -f ${FOREMAN_PATH}/et1.env bash --login -c "cd ${FS_ROOT_PATH} && et_full_system local wait_for_support && et_full_system local update_service_url et1 http://localhost:$FREEPORT && cd systems/et1 && PORT=$FREEPORT ./run.sh"
|
3
4
|
et1_sidekiq: bash --login -c "cd ${FS_ROOT_PATH} && et_full_system local wait_for_support && cd systems/et1 && godotenv -f ${FOREMAN_PATH}/.env godotenv -f ${FOREMAN_PATH}/et1.env ./run_sidekiq.sh"
|
4
5
|
et3_web: export FREEPORT=$(freeport) && godotenv -f ${FOREMAN_PATH}/.env godotenv -f ${FOREMAN_PATH}/et3.env bash --login -c "cd ${FS_ROOT_PATH} && et_full_system local wait_for_support && et_full_system local update_service_url et3 http://localhost:$FREEPORT && cd systems/et3 && PORT=$FREEPORT ./run.sh"
|
@@ -8,7 +9,4 @@ api_sidekiq: bash --login -c "cd ${FS_ROOT_PATH} && et_full_system local wait_fo
|
|
8
9
|
admin_web: export FREEPORT=$(freeport) && godotenv -f ${FOREMAN_PATH}/.env godotenv -f ${FOREMAN_PATH}/et_admin.env bash --login -c "cd ${FS_ROOT_PATH} && et_full_system local wait_for_support && et_full_system local update_service_url admin http://localhost:$FREEPORT && cd systems/admin && PORT=$FREEPORT ./run.sh"
|
9
10
|
atos_api_web: export FREEPORT=$(freeport) && godotenv -f ${FOREMAN_PATH}/.env godotenv -f ${FOREMAN_PATH}/et_atos.env bash --login -c "cd ${FS_ROOT_PATH} && et_full_system local wait_for_support && et_full_system local update_service_url atos_api http://localhost:$FREEPORT && cd systems/atos && PORT=$FREEPORT ./run.sh"
|
10
11
|
azure_blob_web: bash --login -c "azurite -l ${AZURITE_STORAGE_PATH} -d ${AZURITE_STORAGE_PATH}/debug.log"
|
11
|
-
fake_acas_web: export FREEPORT=$(freeport) && bash --login -c "cd ${FS_ROOT_PATH} && et_full_system local wait_for_support && et_full_system local update_service_url fake_acas http://localhost:$FREEPORT && rvm use && et_fake_acas_server -port $FREEPORT -threads=1 -workers=2"
|
12
|
-
fake_ccd_web: export FREEPORT=$(freeport) && bash --login -c "cd ${FS_ROOT_PATH} && et_full_system local wait_for_support && et_full_system local update_service_url fake_ccd http://localhost:$FREEPORT && rvm use && et_fake_ccd start --port=$FREEPORT --create_case_schema=./systems/et_ccd_export/spec/json_schemas/case_create.json"
|
13
|
-
fake_notify_web: export FREEPORT=$(freeport) && godotenv -f ${FOREMAN_PATH}/.env godotenv -f ${FOREMAN_PATH}/fake_notify.env bash --login -c "cd ${FS_ROOT_PATH} && et_full_system local wait_for_support && et_full_system local update_service_url fake_notify http://localhost:$FREEPORT && rvm use && gov_fake_notify start --port=$FREEPORT --config=${FOREMAN_PATH}/gov_fake_notify.yaml"
|
14
12
|
et_ccd_export_sidekiq: bash --login -c "cd ${FS_ROOT_PATH} && et_full_system local wait_for_support && cd systems/et_ccd_export && godotenv -f ${FOREMAN_PATH}/.env godotenv -f ${FOREMAN_PATH}/et_ccd_export.env ./run_sidekiq.sh"
|
data/foreman/traefik.json
CHANGED
@@ -1,208 +1,148 @@
|
|
1
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
|
-
"mail": {
|
148
|
-
"entryPoints": [
|
149
|
-
"http"
|
150
|
-
],
|
151
|
-
"backend": "mail",
|
152
|
-
"passHostHeader": true,
|
153
|
-
"routes": {
|
154
|
-
"test_1": {
|
155
|
-
"rule": "Host:mail.et.127.0.0.1.nip.io"
|
156
|
-
}
|
157
|
-
}
|
158
|
-
},
|
159
|
-
"azure_blob": {
|
160
|
-
"entryPoints": [
|
161
|
-
"http"
|
162
|
-
],
|
163
|
-
"backend": "azure_blob",
|
164
|
-
"passHostHeader": true,
|
165
|
-
"routes": {
|
166
|
-
"test_1": {
|
167
|
-
"rule": "Host:azure_blob_storage.et.127.0.0.1.nip.io"
|
168
|
-
}
|
169
|
-
}
|
170
|
-
},
|
171
|
-
"fake_acas": {
|
172
|
-
"entryPoints": [
|
173
|
-
"http"
|
174
|
-
],
|
175
|
-
"backend": "fake_acas",
|
176
|
-
"passHostHeader": true,
|
177
|
-
"routes": {
|
178
|
-
"test_1": {
|
179
|
-
"rule": "Host:acas.et.127.0.0.1.nip.io"
|
180
|
-
}
|
181
|
-
}
|
182
|
-
},
|
183
|
-
"fake_ccd": {
|
184
|
-
"entryPoints": [
|
185
|
-
"http"
|
186
|
-
],
|
187
|
-
"backend": "fake_ccd",
|
188
|
-
"passHostHeader": true,
|
189
|
-
"routes": {
|
190
|
-
"test_1": {
|
191
|
-
"rule": "Host:ccd.et.127.0.0.1.nip.io"
|
192
|
-
}
|
193
|
-
}
|
194
|
-
},
|
195
|
-
"fake_notify": {
|
196
|
-
"entryPoints": [
|
197
|
-
"http"
|
198
|
-
],
|
199
|
-
"backend": "fake_notify",
|
200
|
-
"passHostHeader": true,
|
201
|
-
"routes": {
|
202
|
-
"test_1": {
|
203
|
-
"rule": "Host:notify.et.127.0.0.1.nip.io"
|
204
|
-
}
|
2
|
+
"http": {
|
3
|
+
"services": {
|
4
|
+
"et1": {
|
5
|
+
"loadBalancer": {
|
6
|
+
"servers": [{
|
7
|
+
"url": "http://localhost:5101"
|
8
|
+
}]
|
9
|
+
}
|
10
|
+
},
|
11
|
+
"et3": {
|
12
|
+
"loadBalancer": {
|
13
|
+
"servers": [{
|
14
|
+
"url": "http://localhost:5601"
|
15
|
+
}]
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"admin": {
|
19
|
+
"loadBalancer": {
|
20
|
+
"servers": [{
|
21
|
+
"url": "http://localhost:7801"
|
22
|
+
}]
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"api": {
|
26
|
+
"loadBalancer": {
|
27
|
+
"servers": [{
|
28
|
+
"url": "http://localhost:6501"
|
29
|
+
}]
|
30
|
+
}
|
31
|
+
},
|
32
|
+
"atos_api": {
|
33
|
+
"loadBalancer": {
|
34
|
+
"servers": [{
|
35
|
+
"url": "http://localhost:8601"
|
36
|
+
}]
|
37
|
+
}
|
38
|
+
},
|
39
|
+
"mail": {
|
40
|
+
"loadBalancer": {
|
41
|
+
"servers": [{
|
42
|
+
"url": "http://localhost:8025"
|
43
|
+
}]
|
44
|
+
}
|
45
|
+
},
|
46
|
+
"azure_blob": {
|
47
|
+
"loadBalancer": {
|
48
|
+
"servers": [{
|
49
|
+
"url": "http://localhost:10000"
|
50
|
+
}]
|
51
|
+
}
|
52
|
+
},
|
53
|
+
"fake_acas": {
|
54
|
+
"loadBalancer": {
|
55
|
+
"servers": [{
|
56
|
+
"url": "http://localhost:9000"
|
57
|
+
}]
|
58
|
+
}
|
59
|
+
},
|
60
|
+
"fake_ccd": {
|
61
|
+
"loadBalancer": {
|
62
|
+
"servers": [{
|
63
|
+
"url": "http://localhost:9100"
|
64
|
+
}]
|
65
|
+
}
|
66
|
+
},
|
67
|
+
"fake_notify": {
|
68
|
+
"loadBalancer": {
|
69
|
+
"servers": [{
|
70
|
+
"url": "http://localhost:9200"
|
71
|
+
}]
|
72
|
+
}
|
73
|
+
}
|
74
|
+
},
|
75
|
+
"routers": {
|
76
|
+
"et1": {
|
77
|
+
"entryPoints": [
|
78
|
+
"http"
|
79
|
+
],
|
80
|
+
"service": "et1",
|
81
|
+
"rule": "Host(`et1.et.127.0.0.1.nip.io`)"
|
82
|
+
},
|
83
|
+
"et3": {
|
84
|
+
"entryPoints": [
|
85
|
+
"http"
|
86
|
+
],
|
87
|
+
"service": "et3",
|
88
|
+
"rule": "Host(`et3.et.127.0.0.1.nip.io`)"
|
89
|
+
},
|
90
|
+
"admin": {
|
91
|
+
"entryPoints": [
|
92
|
+
"http"
|
93
|
+
],
|
94
|
+
"service": "admin",
|
95
|
+
"rule": "Host(`admin.et.127.0.0.1.nip.io`)"
|
96
|
+
},
|
97
|
+
"api": {
|
98
|
+
"entryPoints": [
|
99
|
+
"http"
|
100
|
+
],
|
101
|
+
"service": "api",
|
102
|
+
"rule": "Host(`api.et.127.0.0.1.nip.io`)"
|
103
|
+
},
|
104
|
+
"atos_api": {
|
105
|
+
"entryPoints": [
|
106
|
+
"http"
|
107
|
+
],
|
108
|
+
"service": "atos_api",
|
109
|
+
"rule": "Host(`atos.et.127.0.0.1.nip.io`)"
|
110
|
+
},
|
111
|
+
"mail": {
|
112
|
+
"entryPoints": [
|
113
|
+
"http"
|
114
|
+
],
|
115
|
+
"service": "mail",
|
116
|
+
"rule": "Host(`mail.et.127.0.0.1.nip.io`)"
|
117
|
+
},
|
118
|
+
"azure_blob": {
|
119
|
+
"entryPoints": [
|
120
|
+
"http"
|
121
|
+
],
|
122
|
+
"service": "azure_blob",
|
123
|
+
"rule": "Host(`azure_blob_storage.et.127.0.0.1.nip.io`)"
|
124
|
+
},
|
125
|
+
"fake_acas": {
|
126
|
+
"entryPoints": [
|
127
|
+
"http"
|
128
|
+
],
|
129
|
+
"service": "fake_acas",
|
130
|
+
"rule": "Host(`acas.et.127.0.0.1.nip.io`)"
|
131
|
+
},
|
132
|
+
"fake_ccd": {
|
133
|
+
"entryPoints": [
|
134
|
+
"http"
|
135
|
+
],
|
136
|
+
"service": "fake_ccd",
|
137
|
+
"rule": "Host(`ccd.et.127.0.0.1.nip.io`)"
|
138
|
+
},
|
139
|
+
"fake_notify": {
|
140
|
+
"entryPoints": [
|
141
|
+
"http"
|
142
|
+
],
|
143
|
+
"service": "fake_notify",
|
144
|
+
"rule": "Host(`notify.et.127.0.0.1.nip.io`)"
|
205
145
|
}
|
206
146
|
}
|
207
|
-
}
|
147
|
+
}
|
208
148
|
}
|
@@ -16,6 +16,7 @@ module EtFullSystem
|
|
16
16
|
|
17
17
|
class RestProviderNotConfigured < RuntimeError; end
|
18
18
|
class ServiceUrlIncorrect < RuntimeError; end
|
19
|
+
class ServicesNotConfigured < RuntimeError; end
|
19
20
|
desc "boot", "Sets up the server - traefik frontends and backends, along with initial data in local azure storage"
|
20
21
|
method_option :base_url, type: :string, default: DEFAULT_BASE_URL
|
21
22
|
def boot
|
@@ -54,8 +55,9 @@ module EtFullSystem
|
|
54
55
|
setup_retry_countdown = 10
|
55
56
|
|
56
57
|
begin
|
57
|
-
resp = HTTParty.get "#{options[:base_url]}/api/
|
58
|
-
raise RestProviderNotConfigured if resp.code == 404
|
58
|
+
resp = HTTParty.get "#{options[:base_url]}/api/rawdata", headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}
|
59
|
+
raise RestProviderNotConfigured if resp.code == 404 || resp.parsed_response.dig('routers', 'rest@internal').nil?
|
60
|
+
raise ServicesNotConfigured if resp.parsed_response.dig('routers', 'et1@rest').nil?
|
59
61
|
rescue Errno::EADDRNOTAVAIL, Errno::ECONNREFUSED
|
60
62
|
connect_retry_countdown -= 1
|
61
63
|
if connect_retry_countdown.zero?
|
@@ -74,6 +76,15 @@ module EtFullSystem
|
|
74
76
|
sleep 5
|
75
77
|
retry
|
76
78
|
end
|
79
|
+
rescue ServicesNotConfigured
|
80
|
+
setup_retry_countdown -= 1
|
81
|
+
if setup_retry_countdown.zero?
|
82
|
+
raise "Could not find the ET1 router in traefik after 10 retries"
|
83
|
+
else
|
84
|
+
STDERR.puts "Re checking for the ET1 router in traefik in 5 seconds"
|
85
|
+
sleep 5
|
86
|
+
retry
|
87
|
+
end
|
77
88
|
end
|
78
89
|
STDERR.puts "Support services now ready"
|
79
90
|
end
|
@@ -415,8 +426,8 @@ module EtFullSystem
|
|
415
426
|
connect_retry_countdown = 10
|
416
427
|
setup_retry_countdown = 10
|
417
428
|
begin
|
418
|
-
resp = HTTParty.get "#{options[:base_url]}/api/
|
419
|
-
raise RestProviderNotConfigured if resp.code == 404
|
429
|
+
resp = HTTParty.get "#{options[:base_url]}/api/rawdata", headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }
|
430
|
+
raise RestProviderNotConfigured if resp.code == 404 || resp.parsed_response.dig('routers', 'rest@internal').nil?
|
420
431
|
rescue Errno::EADDRNOTAVAIL, Errno::ECONNREFUSED
|
421
432
|
connect_retry_countdown -= 1
|
422
433
|
if !options[:wait]
|
@@ -442,15 +453,16 @@ module EtFullSystem
|
|
442
453
|
end
|
443
454
|
|
444
455
|
json = resp.parsed_response.dup
|
445
|
-
backend = json
|
446
|
-
raise "Unknown service called #{service} - valid options are #{json['
|
456
|
+
backend = json.dig('services', "#{service}@rest")
|
457
|
+
raise "Unknown service called #{service} - valid options are #{json['services'].keys.join(', ')}" if backend.nil?
|
447
458
|
|
448
|
-
container = backend.dig('
|
449
|
-
raise "The service '#{service}' has no
|
459
|
+
container = backend.dig('loadBalancer', 'servers')&.first
|
460
|
+
raise "The service '#{service}' has no load balancer with a list of servers - it must have for this command to work" if container.nil?
|
450
461
|
|
451
462
|
if container['url'] != url
|
452
463
|
container['url'] = url
|
453
|
-
|
464
|
+
new_json = { http: json }.to_json.gsub(/@rest/, '')
|
465
|
+
put_resp = HTTParty.put "#{options[:base_url]}/api/providers/rest", body: new_json, headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }
|
454
466
|
raise "Error from traefik says: #{put_resp.body}" unless (200..299).include? put_resp.code
|
455
467
|
|
456
468
|
validate_rest_backend_url(service, url)
|
@@ -463,14 +475,14 @@ module EtFullSystem
|
|
463
475
|
def validate_rest_backend_url(service, url)
|
464
476
|
retry_countdown = 10
|
465
477
|
begin
|
466
|
-
resp = HTTParty.get "#{options[:base_url]}/api/
|
467
|
-
raise ServiceUrlIncorrect unless (200..299).include?(resp.code) && resp.parsed_response.dig('
|
478
|
+
resp = HTTParty.get "#{options[:base_url]}/api/rawdata", headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }
|
479
|
+
raise ServiceUrlIncorrect unless (200..299).include?(resp.code) && resp.parsed_response.dig('services', "#{service}@rest", 'loadBalancer', 'servers')&.first&.fetch('url', nil) == url
|
468
480
|
return
|
469
481
|
rescue ServiceUrlIncorrect
|
470
482
|
retry_countdown -= 1
|
471
483
|
raise if retry_countdown.zero?
|
472
484
|
|
473
|
-
STDERR.puts "Retrying request to validate the url of '#{service}' is '#{url}' in 1 second"
|
485
|
+
STDERR.puts "Retrying request to validate the url of '#{service}' is '#{url}' in 1 second (it was #{resp.parsed_response.dig('services', "#{service}@rest", 'loadBalancer', 'servers')&.first&.fetch('url', nil)})"
|
474
486
|
sleep 1
|
475
487
|
retry
|
476
488
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: et_full_system
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gary Taylor
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -173,7 +173,7 @@ homepage: https://github.com/ministryofjustice/et-full-system
|
|
173
173
|
licenses:
|
174
174
|
- MIT
|
175
175
|
metadata: {}
|
176
|
-
post_install_message:
|
176
|
+
post_install_message:
|
177
177
|
rdoc_options: []
|
178
178
|
require_paths:
|
179
179
|
- lib
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
191
|
rubygems_version: 3.1.6
|
192
|
-
signing_key:
|
192
|
+
signing_key:
|
193
193
|
specification_version: 4
|
194
194
|
summary: Runs the employment tribunals system - all services and background jobs
|
195
195
|
test_files: []
|