gitlab-qa 5.13.6 → 5.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,68 @@
1
+ module Gitlab
2
+ module QA
3
+ module Scenario
4
+ module Test
5
+ module Instance
6
+ class Airgapped < Scenario::Template
7
+ require 'resolv'
8
+ attr_accessor :commands
9
+
10
+ def initialize
11
+ gitlab_ip = Resolv.getaddress('registry.gitlab.com')
12
+ @commands = <<~AIRGAP_AND_VERIFY_COMMAND.split(/\n+/)
13
+ # Should not fail before airgapping due to eg. DNS failure
14
+ # Ping and wget check
15
+ apt-get update && apt-get install -y iptables netcat
16
+ nc -zv -w 10 #{gitlab_ip} 80 && (echo \"Regular connectivity netcat check passed.\" && exit 0) || (echo \"Regular connectivity netcat check failed.\" && exit 1)
17
+ echo "Checking regular connectivity..." \
18
+ && wget --retry-connrefused --waitretry=1 --read-timeout=15 --timeout=10 -t 2 http://registry.gitlab.com > /dev/null 2>&1 \
19
+ && (echo "Regular connectivity wget check passed." && exit 0) || (echo "Regular connectivity wget check failed." && exit 1)
20
+
21
+ iptables -P INPUT DROP && iptables -P OUTPUT DROP
22
+ iptables -A INPUT -i lo -j ACCEPT && iptables -A OUTPUT -o lo -j ACCEPT # LOOPBACK
23
+ iptables -I INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
24
+ iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
25
+
26
+ # Jenkins on port 8080 and 50000
27
+ iptables -A OUTPUT -p tcp -m tcp --dport 8080 -m state --state NEW,ESTABLISHED -j ACCEPT \
28
+ && iptables -A OUTPUT -p tcp -m tcp --dport 50000 -m state --state NEW,ESTABLISHED -j ACCEPT
29
+ iptables -A OUTPUT -p tcp -m tcp --sport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
30
+ iptables -A INPUT -p tcp -m tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
31
+ iptables -A OUTPUT -p tcp -m tcp --sport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
32
+ iptables -A INPUT -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
33
+
34
+ # Should now fail to ping and wget, port 80 should be open
35
+ nc -zv -w 10 #{gitlab_ip} 80 && (echo \"Airgapped network faulty. Connectivity netcat check failed.\" && exit 1) || (echo \"Connectivity netcat check passed.\" && exit 0)
36
+ nc -zv -w 10 127.0.0.1 22 && (echo "Airgapped connectivity port 22 check passed." && exit 0) || (echo "Airgapped connectivity port 22 check failed." && exit 1)
37
+ nc -zv -w 10 127.0.0.1 80 && (echo "Airgapped connectivity port 80 check passed." && exit 0) || (echo "Airgapped connectivity port 80 check failed." && exit 1)
38
+ echo "Checking airgapped connectivity..." \
39
+ && wget --retry-connrefused --waitretry=1 --read-timeout=15 --timeout=10 -t 2 http://registry.gitlab.com > /dev/null 2>&1 \
40
+ && (echo "Airgapped network faulty. Connectivity wget check failed." && exit 1) || (echo "Airgapped network confirmed. Connectivity wget check passed." && exit 0)
41
+ AIRGAP_AND_VERIFY_COMMAND
42
+ end
43
+
44
+ def perform(release, *rspec_args)
45
+ Component::Gitlab.perform do |gitlab|
46
+ gitlab.release = release
47
+ gitlab.network = 'test'
48
+ gitlab.runner_network = 'airgapped'
49
+ gitlab.exec_commands = @commands
50
+ rspec_args << "--" unless rspec_args.include?('--')
51
+ rspec_args << %w[--tag ~orchestrated]
52
+ gitlab.instance do
53
+ Component::Specs.perform do |specs|
54
+ specs.suite = 'Test::Instance::Airgapped'
55
+ specs.release = gitlab.release
56
+ specs.network = gitlab.network
57
+ specs.runner_network = gitlab.runner_network
58
+ specs.args = [gitlab.address, *rspec_args]
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -27,13 +27,14 @@ module Gitlab
27
27
  gitlab_rails['db_pool'] = 5;
28
28
  gitlab_rails['geo_node_name'] = '#{primary.name}';
29
29
  gitlab_rails['monitoring_whitelist'] = ['0.0.0.0/0'];
30
+ gitlab_rails['packages_enabled'] = true;
30
31
  postgresql['listen_address'] = '0.0.0.0';
31
32
  postgresql['max_replication_slots'] = 1;
32
33
  postgresql['md5_auth_cidr_addresses'] = ['0.0.0.0/0'];
33
34
  postgresql['sql_user_password'] = 'e1d1469ec5f533651918b4567a3ed1ae';
34
35
  postgresql['trust_auth_cidr_addresses'] = ['0.0.0.0/0','0.0.0.0/0'];
35
36
  sidekiq['concurrency'] = 2;
36
- unicorn['worker_processes'] = 2;
37
+ puma['worker_processes'] = 2;
37
38
  OMNIBUS
38
39
  primary.exec_commands = fast_ssh_key_lookup_commands + git_lfs_install_commands
39
40
 
@@ -50,11 +51,12 @@ module Gitlab
50
51
  gitlab_rails['db_pool'] = 5;
51
52
  gitlab_rails['geo_node_name'] = '#{secondary.name}';
52
53
  gitlab_rails['monitoring_whitelist'] = ['0.0.0.0/0'];
54
+ gitlab_rails['packages_enabled'] = true;
53
55
  postgresql['listen_address'] = '0.0.0.0';
54
56
  postgresql['md5_auth_cidr_addresses'] = ['0.0.0.0/0'];
55
57
  postgresql['sql_user_password'] = 'e1d1469ec5f533651918b4567a3ed1ae';
56
58
  sidekiq['concurrency'] = 2;
57
- unicorn['worker_processes'] = 2;
59
+ puma['worker_processes'] = 2;
58
60
  OMNIBUS
59
61
  secondary.exec_commands = fast_ssh_key_lookup_commands + git_lfs_install_commands
60
62
 
@@ -0,0 +1,201 @@
1
+ module Gitlab
2
+ module QA
3
+ module Scenario
4
+ module Test
5
+ module Integration
6
+ class GitalyCluster < Scenario::Template
7
+ attr_reader :gitlab_name, :spec_suite
8
+
9
+ def initialize
10
+ @gitlab_name = 'gitlab-gitaly-ha'
11
+ @primary_node_name = 'gitaly1'
12
+ @secondary_node_name = 'gitaly2'
13
+ @tertiary_node_name = 'gitaly3'
14
+ @praefect_node_name = 'praefect'
15
+ @database = 'postgres'
16
+ @spec_suite = 'Test::Integration::GitalyHA'
17
+ @network = 'test'
18
+ end
19
+
20
+ # rubocop:disable Metrics/AbcSize
21
+ def perform(release, *rspec_args)
22
+ gitaly_primary_node = gitaly(@primary_node_name, release)
23
+ gitaly_secondary_node = gitaly(@secondary_node_name, release)
24
+ gitaly_tertiary_node = gitaly(@tertiary_node_name, release)
25
+
26
+ sql_node = Component::PostgreSQL.new.tap do |sql|
27
+ sql.name = @database
28
+ sql.network = @network
29
+ sql.instance_no_teardown do
30
+ sql.run_psql '-d template1 -c "CREATE DATABASE praefect_production OWNER postgres"'
31
+ end
32
+ end
33
+
34
+ praefect_node = Component::Gitlab.new.tap do |praefect|
35
+ praefect.release = QA::Release.new(release)
36
+ praefect.name = @praefect_node_name
37
+ praefect.network = @network
38
+ praefect.skip_availability_check = true
39
+
40
+ praefect.omnibus_config = praefect_omnibus_configuration
41
+
42
+ praefect.instance_no_teardown
43
+ end
44
+
45
+ Component::Gitlab.perform do |gitlab|
46
+ gitlab.release = QA::Release.new(release)
47
+ gitlab.name = gitlab_name
48
+ gitlab.network = @network
49
+
50
+ gitlab.omnibus_config = gitlab_omnibus_configuration
51
+ gitlab.instance do
52
+ puts "Running Gitaly HA specs!"
53
+
54
+ Component::Specs.perform do |specs|
55
+ specs.suite = spec_suite
56
+ specs.release = gitlab.release
57
+ specs.network = gitlab.network
58
+ specs.args = [gitlab.address, *rspec_args]
59
+ end
60
+ end
61
+ end
62
+ ensure
63
+ praefect_node&.teardown
64
+ sql_node&.teardown
65
+ gitaly_primary_node&.teardown
66
+ gitaly_secondary_node&.teardown
67
+ gitaly_tertiary_node&.teardown
68
+ end
69
+ # rubocop:enable Metrics/AbcSize
70
+
71
+ private
72
+
73
+ def disable_other_services
74
+ <<~OMNIBUS
75
+ postgresql['enable'] = false;
76
+ redis['enable'] = false;
77
+ nginx['enable'] = false;
78
+ prometheus['enable'] = false;
79
+ grafana['enable'] = false;
80
+ puma['enable'] = false;
81
+ sidekiq['enable'] = false;
82
+ gitlab_workhorse['enable'] = false;
83
+ gitlab_rails['rake_cache_clear'] = false;
84
+ gitlab_rails['auto_migrate'] = false;
85
+ OMNIBUS
86
+ end
87
+
88
+ def praefect_omnibus_configuration
89
+ <<~OMNIBUS
90
+ #{disable_other_services}
91
+ gitaly['enable'] = false;
92
+ praefect['enable'] = true;
93
+ praefect['listen_addr'] = '0.0.0.0:2305';
94
+ praefect['prometheus_listen_addr'] = '0.0.0.0:9652';
95
+ praefect['auth_token'] = 'PRAEFECT_EXTERNAL_TOKEN';
96
+ praefect['database_host'] = '#{@database}.#{@network}';
97
+ praefect['database_user'] = 'postgres';
98
+ praefect['database_port'] = 5432;
99
+ praefect['database_password'] = 'SQL_PASSWORD';
100
+ praefect['database_dbname'] = 'praefect_production';
101
+ praefect['database_sslmode'] = 'disable';
102
+ praefect['postgres_queue_enabled'] = true;
103
+ praefect['failover_enabled'] = true;
104
+ praefect['virtual_storages'] = {
105
+ 'default' => {
106
+ '#{@primary_node_name}' => {
107
+ 'address' => 'tcp://#{@primary_node_name}.#{@network}:8075',
108
+ 'token' => 'PRAEFECT_INTERNAL_TOKEN',
109
+ 'primary' => true
110
+ },
111
+ '#{@secondary_node_name}' => {
112
+ 'address' => 'tcp://#{@secondary_node_name}.#{@network}:8075',
113
+ 'token' => 'PRAEFECT_INTERNAL_TOKEN'
114
+ },
115
+ '#{@tertiary_node_name}' => {
116
+ 'address' => 'tcp://#{@tertiary_node_name}.#{@network}:8075',
117
+ 'token' => 'PRAEFECT_INTERNAL_TOKEN'
118
+ }
119
+ }
120
+ };
121
+ OMNIBUS
122
+ end
123
+
124
+ def gitaly_omnibus_configuration
125
+ <<~OMNIBUS
126
+ #{disable_other_services}
127
+ prometheus['enable'] = true;
128
+ prometheus_monitoring['enable'] = false;
129
+ gitaly['enable'] = true;
130
+ gitaly['listen_addr'] = '0.0.0.0:8075';
131
+ gitaly['prometheus_listen_addr'] = '0.0.0.0:9236';
132
+ gitaly['auth_token'] = 'PRAEFECT_INTERNAL_TOKEN';
133
+ gitlab_shell['secret_token'] = 'GITLAB_SHELL_SECRET_TOKEN';
134
+ gitlab_rails['internal_api_url'] = 'http://#{@gitlab_name}.#{@network}';
135
+ git_data_dirs({
136
+ '#{@primary_node_name}' => {
137
+ 'path' => '/var/opt/gitlab/git-data'
138
+ },
139
+ '#{@secondary_node_name}' => {
140
+ 'path' => '/var/opt/gitlab/git-data'
141
+ },
142
+ '#{@tertiary_node_name}' => {
143
+ 'path' => '/var/opt/gitlab/git-data'
144
+ }
145
+ });
146
+ OMNIBUS
147
+ end
148
+
149
+ def gitlab_omnibus_configuration
150
+ <<~OMNIBUS
151
+ external_url 'http://#{@gitlab_name}.#{@network}';
152
+
153
+ git_data_dirs({
154
+ 'default' => {
155
+ 'gitaly_address' => 'tcp://#{@praefect_node_name}.#{@network}:2305',
156
+ 'gitaly_token' => 'PRAEFECT_EXTERNAL_TOKEN'
157
+ }
158
+ });
159
+ gitaly['listen_addr'] = '0.0.0.0:8075';
160
+ gitlab_shell['secret_token'] = 'GITLAB_SHELL_SECRET_TOKEN';
161
+ prometheus['scrape_configs'] = [
162
+ {
163
+ 'job_name' => 'praefect',
164
+ 'static_configs' => [
165
+ 'targets' => [
166
+ '#{@praefect_node_name}.#{@network}:9652'
167
+ ]
168
+ ]
169
+ },
170
+ {
171
+ 'job_name' => 'praefect-gitaly',
172
+ 'static_configs' => [
173
+ 'targets' => [
174
+ '#{@primary_node_name}.#{@network}:9236',
175
+ '#{@secondary_node_name}.#{@network}:9236',
176
+ '#{@tertiary_node_name}.#{@network}:9236'
177
+ ]
178
+ ]
179
+ }
180
+ ];
181
+ grafana['disable_login_form'] = false;
182
+ grafana['admin_password'] = 'GRAFANA_ADMIN_PASSWORD';
183
+ OMNIBUS
184
+ end
185
+
186
+ def gitaly(name, release)
187
+ Component::Gitlab.new.tap do |gitaly|
188
+ gitaly.release = QA::Release.new(release)
189
+ gitaly.name = name
190
+ gitaly.network = @network
191
+ gitaly.skip_availability_check = true
192
+ gitaly.omnibus_config = gitaly_omnibus_configuration
193
+ gitaly.instance_no_teardown
194
+ end
195
+ end
196
+ end
197
+ end
198
+ end
199
+ end
200
+ end
201
+ end
@@ -13,7 +13,11 @@ module Gitlab
13
13
  gitlab.name = 'gitlab'
14
14
  gitlab.network = 'test'
15
15
  gitlab.volumes = volumes
16
- gitlab.exec_commands = ['gitlab-psql -d template1 -c "CREATE DATABASE praefect_production OWNER gitlab"']
16
+ gitlab.exec_commands = [
17
+ 'gitlab-psql -d template1 -c "CREATE DATABASE praefect_production OWNER gitlab"',
18
+ 'mkdir -p /var/opt/gitlab/git-data/repositories/praefect',
19
+ 'chown -R git:root /var/opt/gitlab/git-data/repositories'
20
+ ]
17
21
 
18
22
  gitlab.act do
19
23
  prepare
@@ -21,7 +25,7 @@ module Gitlab
21
25
  reconfigure
22
26
  process_exec_commands
23
27
  wait
24
- teardown
28
+ teardown!
25
29
  end
26
30
  end
27
31
 
@@ -61,21 +65,25 @@ module Gitlab
61
65
  def omnibus_config_with_praefect
62
66
  <<~OMNIBUS
63
67
  gitaly['enable'] = true;
64
- gitaly['auth_token'] = 'praefect-gitaly-token';
68
+ gitaly['auth_token'] = 'secret-token';
65
69
  gitaly['storage'] = [
66
70
  {
67
71
  'name' => 'praefect-gitaly-0',
68
- 'path' => '/var/opt/gitlab/git-data/repositories'
72
+ 'path' => '/var/opt/gitlab/git-data/repositories/praefect'
73
+ },
74
+ {
75
+ 'name' => 'gitaly',
76
+ 'path' => '/var/opt/gitlab/git-data/repositories/gitaly'
69
77
  }
70
78
  ];
71
79
  praefect['enable'] = true;
72
80
  praefect['listen_addr'] = '0.0.0.0:2305';
73
- praefect['auth_token'] = 'praefect-token';
81
+ praefect['auth_token'] = 'secret-token';
74
82
  praefect['virtual_storages'] = {
75
83
  'default' => {
76
84
  'praefect-gitaly-0' => {
77
85
  'address' => 'unix:/var/opt/gitlab/gitaly/gitaly.socket',
78
- 'token' => 'praefect-gitaly-token',
86
+ 'token' => 'secret-token',
79
87
  'primary' => true
80
88
  }
81
89
  }
@@ -84,10 +92,13 @@ module Gitlab
84
92
  praefect['database_user'] = 'gitlab';
85
93
  praefect['database_dbname'] = 'praefect_production';
86
94
  praefect['postgres_queue_enabled'] = true;
87
- gitlab_rails['gitaly_token'] = 'praefect-token';
95
+ gitlab_rails['gitaly_token'] = 'secret-token';
88
96
  git_data_dirs({
89
97
  'default' => {
90
98
  'gitaly_address' => 'tcp://localhost:2305'
99
+ },
100
+ 'gitaly' => {
101
+ 'path' => '/var/opt/gitlab/git-data/repositories/gitaly'
91
102
  }
92
103
  });
93
104
  OMNIBUS
@@ -24,7 +24,7 @@ module Gitlab
24
24
  end
25
25
  end
26
26
 
27
- project = "gitlab-org/#{QA::Release.new(release).project_name}"
27
+ project = "gitlab-org/#{QA::Release.new(release).api_project_name}"
28
28
  commit = recent_commits(project).find { |c| c['id'] == version }
29
29
 
30
30
  if commit
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module QA
3
- VERSION = '5.13.6'.freeze
3
+ VERSION = '5.16.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-qa
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.13.6
4
+ version: 5.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grzegorz Bizon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-02 00:00:00.000000000 Z
11
+ date: 2020-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -237,6 +237,7 @@ files:
237
237
  - fixtures/ldap/tanuki.ldif
238
238
  - gitlab-qa.gemspec
239
239
  - lib/gitlab/qa.rb
240
+ - lib/gitlab/qa/component/base.rb
240
241
  - lib/gitlab/qa/component/elasticsearch.rb
241
242
  - lib/gitlab/qa/component/gitlab.rb
242
243
  - lib/gitlab/qa/component/internet_tunnel.rb
@@ -263,10 +264,12 @@ files:
263
264
  - lib/gitlab/qa/reporter.rb
264
265
  - lib/gitlab/qa/runner.rb
265
266
  - lib/gitlab/qa/runtime/env.rb
267
+ - lib/gitlab/qa/runtime/scenario.rb
266
268
  - lib/gitlab/qa/runtime/token_finder.rb
267
269
  - lib/gitlab/qa/scenario/actable.rb
268
270
  - lib/gitlab/qa/scenario/cli_commands.rb
269
271
  - lib/gitlab/qa/scenario/template.rb
272
+ - lib/gitlab/qa/scenario/test/instance/airgapped.rb
270
273
  - lib/gitlab/qa/scenario/test/instance/any.rb
271
274
  - lib/gitlab/qa/scenario/test/instance/deployment_base.rb
272
275
  - lib/gitlab/qa/scenario/test/instance/geo.rb
@@ -281,7 +284,7 @@ files:
281
284
  - lib/gitlab/qa/scenario/test/instance/staging_geo.rb
282
285
  - lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
283
286
  - lib/gitlab/qa/scenario/test/integration/geo.rb
284
- - lib/gitlab/qa/scenario/test/integration/gitaly_ha.rb
287
+ - lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb
285
288
  - lib/gitlab/qa/scenario/test/integration/group_saml.rb
286
289
  - lib/gitlab/qa/scenario/test/integration/instance_saml.rb
287
290
  - lib/gitlab/qa/scenario/test/integration/jira.rb
@@ -327,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
327
330
  - !ruby/object:Gem::Version
328
331
  version: '0'
329
332
  requirements: []
330
- rubygems_version: 3.1.3
333
+ rubygems_version: 3.1.4
331
334
  signing_key:
332
335
  specification_version: 4
333
336
  summary: Integration tests for GitLab
@@ -1,166 +0,0 @@
1
- module Gitlab
2
- module QA
3
- module Scenario
4
- module Test
5
- module Integration
6
- class GitalyHA < Scenario::Template
7
- attr_reader :gitlab_name, :spec_suite
8
-
9
- def initialize
10
- @gitlab_name = 'gitlab-gitaly-ha'
11
- @primary_node = 'gitaly1'
12
- @secondary_node = 'gitaly2'
13
- @praefect_node = 'praefect'
14
- @database = 'postgres'
15
- @spec_suite = 'Test::Integration::GitalyHA'
16
- @network = 'test'
17
- end
18
-
19
- # rubocop:disable Metrics/AbcSize
20
- def perform(release, *rspec_args)
21
- gitaly(@primary_node, release) do
22
- gitaly(@secondary_node, release) do
23
- Component::PostgreSQL.perform do |sql|
24
- sql.name = @database
25
- sql.network = @network
26
-
27
- sql.instance do
28
- sql.run_psql '-d template1 -c "CREATE DATABASE praefect_production OWNER postgres"'
29
-
30
- Component::Gitlab.perform do |praefect|
31
- praefect.release = QA::Release.new(release)
32
- praefect.name = @praefect_node
33
- praefect.network = @network
34
- praefect.skip_check = true
35
-
36
- praefect.omnibus_config = praefect_omnibus_configuration
37
-
38
- praefect.instance do
39
- Component::Gitlab.perform do |gitlab|
40
- gitlab.release = QA::Release.new(release)
41
- gitlab.name = gitlab_name
42
- gitlab.network = @network
43
-
44
- gitlab.omnibus_config = gitlab_omnibus_configuration
45
- gitlab.instance do
46
- puts "Running Gitaly HA specs!"
47
-
48
- Component::Specs.perform do |specs|
49
- specs.suite = spec_suite
50
- specs.release = gitlab.release
51
- specs.network = gitlab.network
52
- specs.args = [gitlab.address, *rspec_args]
53
- end
54
- end
55
- end
56
- end
57
- end
58
- end
59
- end
60
- end
61
- end
62
- end
63
- # rubocop:enable Metrics/AbcSize
64
-
65
- private
66
-
67
- def disable_other_services
68
- <<~OMNIBUS
69
- postgresql['enable'] = false;
70
- redis['enable'] = false;
71
- nginx['enable'] = false;
72
- prometheus['enable'] = false;
73
- grafana['enable'] = false;
74
- unicorn['enable'] = false;
75
- sidekiq['enable'] = false;
76
- gitlab_workhorse['enable'] = false;
77
- gitlab_rails['rake_cache_clear'] = false;
78
- gitlab_rails['auto_migrate'] = false;
79
- OMNIBUS
80
- end
81
-
82
- def praefect_omnibus_configuration
83
- <<~OMNIBUS
84
- #{disable_other_services}
85
- gitaly['enable'] = false;
86
- praefect['enable'] = true;
87
- praefect['listen_addr'] = '0.0.0.0:2305';
88
- praefect['prometheus_listen_addr'] = '0.0.0.0:9652';
89
- praefect['auth_token'] = 'PRAEFECT_EXTERNAL_TOKEN';
90
- praefect['database_host'] = '#{@database}.#{@network}';
91
- praefect['database_user'] = 'postgres';
92
- praefect['database_port'] = 5432;
93
- praefect['database_password'] = 'SQL_PASSWORD';
94
- praefect['database_dbname'] = 'praefect_production';
95
- praefect['database_sslmode'] = 'disable';
96
- praefect['postgres_queue_enabled'] = true;
97
- praefect['failover_enabled'] = true;
98
- praefect['virtual_storages'] = {
99
- 'default' => {
100
- '#{@primary_node}' => {
101
- 'address' => 'tcp://#{@primary_node}.#{@network}:8075',
102
- 'token' => 'PRAEFECT_INTERNAL_TOKEN',
103
- 'primary' => true
104
- },
105
- '#{@secondary_node}' => {
106
- 'address' => 'tcp://#{@secondary_node}.#{@network}:8075',
107
- 'token' => 'PRAEFECT_INTERNAL_TOKEN'
108
- }
109
- }
110
- };
111
- OMNIBUS
112
- end
113
-
114
- def gitaly_omnibus_configuration
115
- <<~OMNIBUS
116
- #{disable_other_services}
117
- prometheus_monitoring['enable'] = false;
118
- gitaly['enable'] = true;
119
- gitaly['listen_addr'] = '0.0.0.0:8075';
120
- gitaly['prometheus_listen_addr'] = '0.0.0.0:9236';
121
- gitaly['auth_token'] = 'PRAEFECT_INTERNAL_TOKEN';
122
- gitlab_shell['secret_token'] = 'GITLAB_SHELL_SECRET_TOKEN';
123
- gitlab_rails['internal_api_url'] = 'http://#{@gitlab_name}.#{@network}';
124
- git_data_dirs({
125
- '#{@primary_node}' => {
126
- 'path' => '/var/opt/gitlab/git-data'
127
- },
128
- '#{@secondary_node}' => {
129
- 'path' => '/var/opt/gitlab/git-data'
130
- }
131
- });
132
- OMNIBUS
133
- end
134
-
135
- def gitlab_omnibus_configuration
136
- <<~OMNIBUS
137
- git_data_dirs({
138
- 'default' => {
139
- 'gitaly_address' => 'tcp://#{@praefect_node}.#{@network}:2305',
140
- 'gitaly_token' => 'PRAEFECT_EXTERNAL_TOKEN'
141
- }
142
- });
143
- gitlab_shell['secret_token'] = 'GITLAB_SHELL_SECRET_TOKEN';
144
- OMNIBUS
145
- end
146
-
147
- def gitaly(name, release)
148
- Component::Gitlab.perform do |gitaly|
149
- gitaly.release = QA::Release.new(release)
150
- gitaly.name = name
151
- gitaly.network = @network
152
- gitaly.skip_check = true
153
-
154
- gitaly.omnibus_config = gitaly_omnibus_configuration
155
-
156
- gitaly.instance do
157
- yield self
158
- end
159
- end
160
- end
161
- end
162
- end
163
- end
164
- end
165
- end
166
- end