gitlab-qa 15.5.0 → 15.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 560a6652160efd3d50f067a9025aabe2a50444e2c3a8109793abbb329812bb02
4
- data.tar.gz: 1a99c243bd9f380dbcd68138c787dc1603424da7fa9e35ee8183820501926a30
3
+ metadata.gz: b800bf0843ad8f6c636de6f83713ed9c6c631d90d4140ce14670e88af7228be9
4
+ data.tar.gz: 90b75c71cd03df92f810505e5f1c920845f482d508aff47fdd9a40041cfe9521
5
5
  SHA512:
6
- metadata.gz: ebd9339eab6959505dd2bfd60512b4053a0705952e5285ba13c8d8fe6735731600b3d6bf1614f43202b5a852baf51845405d5adb9f9a10641827c218a602b0f8
7
- data.tar.gz: 662a700afcf694d62ab07a7f49454bb0d580a3108b1ff35556bc7f4b84965878b5eae3e4eded2d97cc56c02272d0b527e59725bdc8f401e6070f663b97793361
6
+ metadata.gz: 6b73f4e3a80917e77422b1a49ce6e2c2ea6525d9c5bc6ceac42495e781baa555ba2b96b2f22bee9bef7eeaa5def8053758ae71ee762bba046674a75015e2d06e
7
+ data.tar.gz: ef66c9ed5786f1cc3bc2d31b6b75929c94a3737ed1af492b5d73992c2f0fa63f08d5726da3c69ba6485f8892c7e8b0b0c9d61ceedbdf655b30a4fc3fafcd56f1
data/.rubocop_todo.yml CHANGED
@@ -54,7 +54,6 @@ Metrics/AbcSize:
54
54
  - 'lib/gitlab/qa/scenario/test/integration/registry_tls.rb'
55
55
  - 'lib/gitlab/qa/scenario/test/integration/registry_with_cdn.rb'
56
56
  - 'lib/gitlab/qa/scenario/test/integration/smtp.rb'
57
- - 'lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb'
58
57
 
59
58
  # Offense count: 2
60
59
  # Configuration parameters: CheckIdentifiers, CheckConstants, CheckVariables, CheckStrings, CheckSymbols, CheckComments, CheckFilepaths, FlaggedTerms.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-qa (15.5.0)
4
+ gitlab-qa (15.6.0)
5
5
  activesupport (>= 6.1, < 7.2)
6
6
  ffi (~> 1.17)
7
7
  gitlab (~> 4.19)
@@ -56,8 +56,7 @@ All environment variables used by GitLab QA should be defined in [`lib/gitlab/qa
56
56
  | `CHROME_DISABLE_DEV_SHM` | `false` | Set to `true` to disable `/dev/shm` usage in Chrome on Linux. | No|
57
57
  | `QA_ADDITIONAL_REPOSITORY_STORAGE` |- | The name of additional, non-default storage to be used with tests tagged `repository_storage`, run via the `Test::Instance::RepositoryStorage` scenario. Note: Admin access is required to change repository storage. | No|
58
58
  | `QA_PRAEFECT_REPOSITORY_STORAGE` |- | The name of repository storage using Praefect. Note: Admin access is required to change repository storage. | No|
59
- | `QA_COOKIES` |- | Optionally set to "cookie1=value;cookie2=value" in order to add a cookie to every request. This can be used to set the canary cookie by setting it to "gitlab_canary=true". | No|
60
- | `QA_DEBUG` |- | Set to `true` to verbosely log page object actions. Note: if enabled be aware that sensitive data might be logged. If an input element has a QA selector with `password` in the name, data entered into the input element will be masked. If the element doesn't have `password` in its name it won't be masked. | No|
59
+ | `QA_COOKIES` |- | Optionally set to "cookie1=value;cookie2=value" in order to add a cookie to every request. This can be used to set the canary cookie by setting it to "gitlab_canary=true", or to use a different cell e.g. "_gitlab_session=cell-2-please". | No|
61
60
  | `QA_LOG_LEVEL` | `info` | Logging level to use for gitlab-qa output and qa tests output | No|
62
61
  | `QA_LOG_PATH` | `QA_ARTIFACTS_DIR` | Path to output debug logging to. | No|
63
62
  | `QA_CAN_TEST_GIT_PROTOCOL_V2` | `true` | Set to `false` to skip tests that require Git protocol v2 if your environment doesn't support it. | No|
@@ -864,6 +863,19 @@ $ export QA_PRAEFECT_REPOSITORY_STORAGE="nfs-file22"
864
863
  $ gitlab-qa Test::Instance::Staging -- --tag smoke
865
864
  ```
866
865
 
866
+ #### Testing Against Different Cells
867
+
868
+ When running tests against GitLab instances that use a [cells architecture](https://docs.gitlab.com/ee/architecture/blueprints/cells/), you can target specific cells by setting the GitLab session cookie. This is useful for testing cell-specific functionality or debugging issues within a particular cell.
869
+
870
+ To direct tests to a specific cell, use the `QA_COOKIES` environment variable to set the `_gitlab_session` cookie with the target cell identifier:
871
+
872
+ ```shell
873
+ $ export QA_COOKIES="_gitlab_session=cell-2-please"
874
+ $ gitlab-qa Test::Instance::Staging
875
+ ```
876
+
877
+ **Note:** The actual cell identifiers depend on your GitLab instance configuration. Check with your GitLab administrator for the correct cell names in your environment.
878
+
867
879
  ### `Test::Instance::StagingRef`
868
880
 
869
881
  This scenario tests that the [`Staging Ref`](https://staging-ref.gitlab.com)
@@ -176,6 +176,10 @@ module Gitlab
176
176
  exec_commands.each { |command| docker.exec(name, command) }
177
177
  end
178
178
 
179
+ def get_reconfigure_log_file_from_artifact
180
+ nil
181
+ end
182
+
179
183
  private
180
184
 
181
185
  attr_reader :exec_commands, :wait_until_ready, :reconfigure
@@ -200,7 +204,7 @@ module Gitlab
200
204
  wait_until_ready
201
205
  process_exec_commands
202
206
  rescue Support::ShellCommand::StatusError => e
203
- reconfigure_log_file = get_reconfigure_log_file_from_artefact
207
+ reconfigure_log_file = get_reconfigure_log_file_from_artifact
204
208
  # for scenarios where a service fails during startup, attempt to retry to avoid flaky failures
205
209
  if (retries += 1) < 3
206
210
  unless reconfigure_log_file.nil?
@@ -213,7 +213,7 @@ module Gitlab
213
213
  log_file
214
214
  end
215
215
 
216
- def get_reconfigure_log_file_from_artefact
216
+ def get_reconfigure_log_file_from_artifact
217
217
  all_reconfigure_log_file = Dir["#{Runtime::Env.host_artifacts_dir}/*reconfigure.log"].sort_by { |f| File.mtime(f) }
218
218
  all_reconfigure_log_file.last
219
219
  end
@@ -229,7 +229,7 @@ module Gitlab
229
229
 
230
230
  if line.include?('There was an error running gitlab-ctl reconfigure')
231
231
  Runtime::Logger.error(
232
- "Failure while running gitlab-ctl reconfigure command. Please check the #{log_file_path} in the artefact for more info"
232
+ "Failure while running gitlab-ctl reconfigure command. Please check the #{log_file_path} artifact for more info"
233
233
  )
234
234
  end
235
235
 
@@ -60,19 +60,21 @@ module Gitlab
60
60
 
61
61
  docker_pull_qa_image_if_needed
62
62
 
63
- Runtime::Logger.info("Running test suite `#{suite}` for #{release.project_name}")
64
-
65
63
  name = "#{release.project_name}-qa-#{SecureRandom.hex(4)}"
66
- run_specs(name)
67
- rescue Support::ShellCommand::StatusError => e
68
- raise e unless retry_failed_specs
69
64
 
70
- Runtime::Logger.warn("Initial test run failed, attempting to retry failed specs in new process!")
71
- results_file = File.join(host_artifacts_dir(name), LAST_RUN_FILE)
72
- raise e unless valid_last_run_file?(results_file)
65
+ begin
66
+ Runtime::Logger.info("Running test suite `#{suite}` for #{release.project_name}")
67
+ run_specs(name)
68
+ rescue Support::ShellCommand::StatusError => e
69
+ raise e unless retry_failed_specs
70
+
71
+ Runtime::Logger.warn("Initial test run failed, attempting to retry failed specs in new process!")
72
+ results_file = File.join(host_artifacts_dir(name), LAST_RUN_FILE)
73
+ raise e unless valid_last_run_file?(results_file)
73
74
 
74
- Runtime::Logger.debug("Found initial run results file '#{results_file}', retrying failed specs!")
75
- run_specs(name, retry_process: true, initial_run_results_host_path: results_file)
75
+ Runtime::Logger.debug("Found initial run results file '#{results_file}', retrying failed specs!")
76
+ run_specs(name, retry_process: true, initial_run_results_host_path: results_file)
77
+ end
76
78
  end
77
79
 
78
80
  def suite=(suite)
@@ -156,9 +158,19 @@ module Gitlab
156
158
  end
157
159
 
158
160
  def docker_pull_qa_image_if_needed
159
- @docker.login(**release.login_params) if release.login_params
161
+ if release.login_params
162
+ begin
163
+ @docker.login(**release.login_params)
164
+ rescue Support::ShellCommand::StatusError => e
165
+ raise "Failed to login to Docker registry: #{e.message}"
166
+ end
167
+ end
160
168
 
161
- @docker.pull(image: qa_image) unless Runtime::Env.skip_pull?
169
+ begin
170
+ @docker.pull(image: qa_image) unless Runtime::Env.skip_pull?
171
+ rescue Support::ShellCommand::StatusError => e
172
+ raise "Failed to pull gitlab-qa image: #{e.message}"
173
+ end
162
174
  end
163
175
 
164
176
  def args_with_flags(feature_flag_set, retry_process: false)
@@ -107,7 +107,6 @@ module Gitlab
107
107
  'QA_CAN_TEST_GIT_PROTOCOL_V2' => :qa_can_test_git_protocol_v2,
108
108
  'QA_CAN_TEST_PRAEFECT' => :qa_can_test_praefect,
109
109
  'QA_COOKIES' => :qa_cookie,
110
- 'QA_DEBUG' => :qa_debug,
111
110
  'QA_DOCKER_NETWORK' => :docker_network,
112
111
  'QA_EXPORT_TEST_METRICS' => :qa_export_test_metrics,
113
112
  'QA_GITALY_NON_CLUSTER_STORAGE' => :qa_gitaly_non_cluster_storage,
@@ -167,8 +166,7 @@ module Gitlab
167
166
  'WORKSPACES_OAUTH_SIGNING_KEY' => :workspaces_oauth_signing_key,
168
167
  'WORKSPACES_PROXY_DOMAIN' => :workspaces_proxy_domain,
169
168
  'WORKSPACES_WILDCARD_CERT' => { name: :workspaces_wildcard_cert, type: :file },
170
- 'WORKSPACES_WILDCARD_KEY' => { name: :workspaces_wildcard_key, type: :file },
171
- 'EPIC_SYNC_TEST' => :epic_sync_test
169
+ 'WORKSPACES_WILDCARD_KEY' => { name: :workspaces_wildcard_key, type: :file }
172
170
  }.freeze
173
171
 
174
172
  def variables
@@ -177,14 +175,8 @@ module Gitlab
177
175
  value ||= send(method_name) # rubocop:disable GitlabSecurity/PublicSend
178
176
  vars[env_var_name] = value if value
179
177
  end
180
- qa_variables = ENV.each_with_object({}) do |(name, _value), vars|
181
- next unless name.start_with?('QA_')
182
178
 
183
- var_name = env_var_name_if_defined(name)
184
- vars[name] = var_name if var_name
185
- end
186
-
187
- qa_variables.merge(defined_variables)
179
+ qa_ci_variables.merge(defined_variables)
188
180
  end
189
181
 
190
182
  def admin_password
@@ -199,10 +191,6 @@ module Gitlab
199
191
  variables.select { |k, _| ENV_VARIABLES[k].is_a?(Hash) && ENV_VARIABLES[k][:type] == :file }.values
200
192
  end
201
193
 
202
- def debug?
203
- enabled?(ENV.fetch('QA_DEBUG', nil), default: true)
204
- end
205
-
206
194
  def log_level
207
195
  env_var_value_if_defined('QA_LOG_LEVEL')&.upcase || 'INFO'
208
196
  end
@@ -486,6 +474,16 @@ module Gitlab
486
474
 
487
475
  private
488
476
 
477
+ def qa_ci_variables
478
+ prefixes = %w[QA_ GLCI_]
479
+ ENV.each_with_object({}) do |(name, _value), vars|
480
+ next unless prefixes.any? { |prefix| name.start_with?(prefix) }
481
+
482
+ var_name = env_var_name_if_defined(name)
483
+ vars[name] = var_name if var_name
484
+ end
485
+ end
486
+
489
487
  def enabled?(value, default: true)
490
488
  return default if value.nil?
491
489
 
@@ -14,6 +14,7 @@ module Gitlab
14
14
  Component::Specs.perform do |specs|
15
15
  specs.suite = 'Test::Instance::All'
16
16
  specs.release = QA::Release.new(edition_and_tag)
17
+ specs.network = Runtime::Env.docker_network if ENV['QA_DOCKER_NETWORK']
17
18
  specs.args = [address, *rspec_args]
18
19
  end
19
20
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '15.5.0'
5
+ VERSION = '15.6.0'
6
6
  end
7
7
  end
@@ -38,7 +38,6 @@ module RuboCop
38
38
  'QA_ADDITIONAL_REPOSITORY_STORAGE' => :qa_additional_repository_storage,
39
39
  'QA_PRAEFECT_REPOSITORY_STORAGE' => :qa_praefect_repository_storage,
40
40
  'QA_GITALY_NON_CLUSTER_STORAGE' => :qa_gitaly_non_cluster_storage,
41
- 'QA_DEBUG' => :qa_debug,
42
41
  'QA_CAN_TEST_ADMIN_FEATURES' => :qa_can_test_admin_features,
43
42
  'QA_CAN_TEST_GIT_PROTOCOL_V2' => :qa_can_test_git_protocol_v2,
44
43
  'QA_CAN_TEST_PRAEFECT' => :qa_can_test_praefect,
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: 15.5.0
4
+ version: 15.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab Quality
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-05-15 00:00:00.000000000 Z
11
+ date: 2025-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -427,7 +427,6 @@ files:
427
427
  - lib/gitlab/qa/component/specs.rb
428
428
  - lib/gitlab/qa/component/staging.rb
429
429
  - lib/gitlab/qa/component/staging_ref.rb
430
- - lib/gitlab/qa/component/suggested_reviewer.rb
431
430
  - lib/gitlab/qa/docker/command.rb
432
431
  - lib/gitlab/qa/docker/engine.rb
433
432
  - lib/gitlab/qa/docker/volumes.rb
@@ -496,7 +495,6 @@ files:
496
495
  - lib/gitlab/qa/scenario/test/integration/saml.rb
497
496
  - lib/gitlab/qa/scenario/test/integration/service_ping_disabled.rb
498
497
  - lib/gitlab/qa/scenario/test/integration/smtp.rb
499
- - lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
500
498
  - lib/gitlab/qa/scenario/test/omnibus/image.rb
501
499
  - lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb
502
500
  - lib/gitlab/qa/scenario/test/omnibus/update_from_previous_ai.rb
@@ -519,11 +517,6 @@ files:
519
517
  - scripts/build-package-and-test-env
520
518
  - support/data/admin_access_token_seed.rb
521
519
  - support/data/license_usage_seed.rb
522
- - support/manifests/suggested_reviewer/authenticator.yaml
523
- - support/manifests/suggested_reviewer/postgres.yaml
524
- - support/manifests/suggested_reviewer/pubsub.yaml
525
- - support/manifests/suggested_reviewer/recommender-bot.yaml
526
- - support/manifests/suggested_reviewer/recommender.yaml
527
520
  - support/pipeline/create_for_projectname.rb
528
521
  - support/setup/gitlab_duo_setup.rb
529
522
  - tls_certificates/authority/ca.crt
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gitlab
4
- module QA
5
- module Component
6
- class SuggestedReviewer
7
- include Scenario::Actable
8
-
9
- # Source: https://gitlab.com/gitlab-org/modelops/applied-ml/review-recommender/cluster-management
10
- MANIFESTS_PATH = File.expand_path('../../../../support/manifests/suggested_reviewer', __dir__)
11
-
12
- def initialize
13
- @cluster = Service::KubernetesCluster.new(provider_class: Service::ClusterProvider::K3d)
14
- end
15
-
16
- def name
17
- @name ||= "suggested_reviewer"
18
- end
19
-
20
- def prepare
21
- @cluster.create_registry_mirror
22
- end
23
-
24
- def create_cluster
25
- @cluster.create!
26
- end
27
-
28
- def deploy_services
29
- Dir.glob(File.join(MANIFESTS_PATH, '**/*')).each do |file|
30
- Runtime::Logger.info("Applying manifest #{file}")
31
- @cluster.apply_manifest(File.read(file))
32
- end
33
- end
34
-
35
- def teardown
36
- @cluster.remove!
37
- end
38
-
39
- def wait_until_ready; end
40
-
41
- def teardown?
42
- !Runtime::Scenario.attributes.include?(:teardown) || Runtime::Scenario.teardown
43
- end
44
- end
45
- end
46
- end
47
- end
@@ -1,62 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gitlab
4
- module QA
5
- module Scenario
6
- module Test
7
- module Integration
8
- class SuggestedReviewer < Scenario::Template
9
- attr_reader :spec_suite
10
-
11
- def initialize
12
- @spec_suite = 'Test::Instance::All'
13
- @network = Runtime::Env.docker_network
14
- @env = {}
15
- @tag = 'suggested_reviewer'
16
- @gitlab_name = 'gitlab-suggested-reviewer'
17
- end
18
-
19
- def perform(release, *rspec_args)
20
- Component::Gitlab.perform do |gitlab|
21
- gitlab.release = QA::Release.new(release)
22
- gitlab.name = @gitlab_name
23
- gitlab.network = @network
24
-
25
- gitlab.instance do
26
- # Wait for the suggested reviewer services to be ready before attempting to run specs
27
- @cluster = suggested_reviewer_cluster
28
- @cluster.wait_until_ready
29
-
30
- Runtime::Logger.info('Running Suggested Reviewer specs!')
31
-
32
- if @tag
33
- rspec_args << "--" unless rspec_args.include?('--')
34
- rspec_args << "--tag" << @tag
35
- end
36
-
37
- Component::Specs.perform do |specs|
38
- specs.suite = spec_suite
39
- specs.release = gitlab.release
40
- specs.network = gitlab.network
41
- specs.args = [gitlab.address, *rspec_args]
42
- specs.env = @env
43
- end
44
- end
45
- end
46
- ensure
47
- @cluster&.teardown if @cluster&.teardown?
48
- end
49
-
50
- def suggested_reviewer_cluster
51
- Component::SuggestedReviewer.new.tap do |sr|
52
- sr.prepare
53
- sr.create_cluster
54
- sr.deploy_services
55
- end
56
- end
57
- end
58
- end
59
- end
60
- end
61
- end
62
- end
@@ -1,41 +0,0 @@
1
- ---
2
- apiVersion: apps/v1
3
- kind: Deployment
4
- metadata:
5
- name: authenticator-deployment
6
- labels:
7
- app: authenticator
8
- spec:
9
- replicas: 1
10
- selector:
11
- matchLabels:
12
- app: authenticator
13
- template:
14
- metadata:
15
- labels:
16
- app: authenticator
17
- spec:
18
- imagePullSecrets:
19
- - name: gitlab-registry
20
- containers:
21
- - name: authenticator
22
- image: registry.gitlab.com/gitlab-org/modelops/applied-ml/review-recommender/authenticator:0.1.0
23
- imagePullPolicy: Always
24
- ports:
25
- - containerPort: 8080
26
- args: []
27
- env:
28
- - name: AUTHENTICATOR_SERVICE_PORT
29
- value: "8080"
30
- ---
31
- apiVersion: v1
32
- kind: Service
33
- metadata:
34
- name: authenticator-service
35
- spec:
36
- type: NodePort
37
- ports:
38
- - port: 8080
39
- targetPort: 8080
40
- selector:
41
- app: authenticator
@@ -1,84 +0,0 @@
1
- ---
2
- apiVersion: v1
3
- kind: Secret
4
- metadata:
5
- name: postgres-secret
6
- type: kubernetes.io/basic-auth
7
- stringData:
8
- username: reviewer-recommender
9
- password: ml4dawin
10
-
11
- ---
12
- apiVersion: v1
13
- kind: PersistentVolumeClaim
14
- metadata:
15
- name: postgres-pvc
16
- spec:
17
- storageClassName: local-path
18
- accessModes:
19
- - ReadWriteOnce
20
- resources:
21
- requests:
22
- storage: 1Gi
23
-
24
- ---
25
- apiVersion: apps/v1
26
- kind: Deployment
27
- metadata:
28
- name: postgres-deployment
29
- spec:
30
- replicas: 1
31
- selector:
32
- matchLabels:
33
- app: postgres
34
- template:
35
- metadata:
36
- labels:
37
- app: postgres
38
- spec:
39
- containers:
40
- - name: postgres
41
- image: postgres:13-alpine
42
- imagePullPolicy: IfNotPresent
43
- ports:
44
- - containerPort: 5432
45
- volumeMounts:
46
- - name: postgres-pv
47
- mountPath: /var/lib/postgresql/data
48
- subPath: postgres
49
- resources:
50
- limits:
51
- memory: 256Mi
52
- cpu: 250m
53
- env:
54
- - name: POSTGRES_DB
55
- value: reviewer-recommender
56
- - name: POSTGRES_USER
57
- valueFrom:
58
- secretKeyRef:
59
- name: postgres-secret
60
- key: username
61
- - name: POSTGRES_PASSWORD
62
- valueFrom:
63
- secretKeyRef:
64
- name: postgres-secret
65
- key: password
66
- volumes:
67
- - name: postgres-pv
68
- persistentVolumeClaim:
69
- claimName: postgres-pvc
70
-
71
- ---
72
- apiVersion: v1
73
- kind: Service
74
- metadata:
75
- name: postgres
76
- labels:
77
- app: postgres
78
- spec:
79
- type: ClusterIP
80
- selector:
81
- app: postgres
82
- ports:
83
- - port: 5432
84
- targetPort: 5432
@@ -1,41 +0,0 @@
1
- ---
2
- apiVersion: apps/v1
3
- kind: Deployment
4
- metadata:
5
- name: pubsub-deployment
6
- labels:
7
- app: pubsub
8
- spec:
9
- replicas: 1
10
- selector:
11
- matchLabels:
12
- app: pubsub
13
- template:
14
- metadata:
15
- labels:
16
- app: pubsub
17
- spec:
18
- containers:
19
- - name: pubsub
20
- image: singularities/pubsub-emulator:latest
21
- imagePullPolicy: IfNotPresent
22
- env:
23
- - name: PUBSUB_PROJECT_ID
24
- value: project-test
25
- - name: PUBSUB_LISTEN_ADDRESS
26
- value: 0.0.0.0:8432
27
-
28
- ---
29
- apiVersion: v1
30
- kind: Service
31
- metadata:
32
- name: pubsub
33
- labels:
34
- app: pubsub
35
- spec:
36
- type: ClusterIP
37
- selector:
38
- app: pubsub
39
- ports:
40
- - port: 8432
41
- targetPort: 8432
@@ -1,242 +0,0 @@
1
- ---
2
- apiVersion: v1
3
- kind: Secret
4
- metadata:
5
- name: gcp-credentials
6
- type: Opaque
7
- data:
8
- gcp_json: "ewogICJjbGllbnRfaWQiOiAiMTIzNDU2Nzg5YWJjZGVmZy5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsCiAgImNsaWVudF9zZWNyZXQiOiAiZC1GTHlld3VxeWV1cXciLAogICJxdW90YV9wcm9qZWN0X2lkIjogInN1Z2dlc3RlZC1yZXZpZXdlci0xNTA0MDBlNiIsCiAgInJlZnJlc2hfdG9rZW4iOiAiMS8vMTIzNDU2NzhhYmNkZWZnIiwKICAidHlwZSI6ICJhdXRob3JpemVkX3VzZXIiCn0K"
9
-
10
- ---
11
- apiVersion: v1
12
- kind: ConfigMap
13
- metadata:
14
- name: recommender-bot-envoy-sidecar-config
15
- labels:
16
- app: recommender-bot
17
- data:
18
- envoy.yaml: |
19
- static_resources:
20
- listeners:
21
- - name: "recommender-bot-http-listener"
22
- address:
23
- socket_address: { address: "0.0.0.0", port_value: 8282 }
24
- filter_chains:
25
- - filters:
26
- - name: "envoy.filters.network.http_connection_manager"
27
- typed_config:
28
- "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
29
- stat_prefix: "grpc_json"
30
- codec_type: "AUTO"
31
- route_config:
32
- name: "local_route"
33
- virtual_hosts:
34
- - name: "local_service"
35
- domains: [ "*" ]
36
- routes:
37
- - match: { prefix: "/", grpc: {} }
38
- route: { cluster: "recommender-bot", timeout: 60s }
39
- http_filters:
40
- - name: "envoy.filters.http.grpc_json_transcoder"
41
- typed_config:
42
- "@type": type.googleapis.com/envoy.extensions.filters.http.grpc_json_transcoder.v3.GrpcJsonTranscoder
43
- proto_descriptor: "/data/protos/recommender-bot.protoset.pb"
44
- services: [ "bot.RecommenderService" ]
45
- print_options:
46
- add_whitespace: true
47
- always_print_primitive_fields: true
48
- always_print_enums_as_ints: false
49
- preserve_proto_field_names: false
50
- convert_grpc_status: true
51
- request_validation_options:
52
- reject_unknown_method: true
53
- reject_unknown_query_parameters: true
54
- - name: "envoy.filters.http.router"
55
- - name: "recommender-bot-http-auth-listener"
56
- address:
57
- socket_address: { address: "0.0.0.0", port_value: 8484 }
58
- filter_chains:
59
- - filters:
60
- - name: "envoy.filters.network.http_connection_manager"
61
- typed_config:
62
- "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
63
- stat_prefix: "grpc_json"
64
- codec_type: "AUTO"
65
- route_config:
66
- name: "local_route"
67
- virtual_hosts:
68
- - name: "local_service"
69
- domains: [ "*" ]
70
- routes:
71
- - match: { prefix: "/", grpc: {} }
72
- route: { cluster: "recommender-bot", timeout: 60s }
73
- http_filters:
74
- - name: "envoy.filters.http.grpc_json_transcoder"
75
- typed_config:
76
- "@type": type.googleapis.com/envoy.extensions.filters.http.grpc_json_transcoder.v3.GrpcJsonTranscoder
77
- proto_descriptor: "/data/protos/recommender-bot.protoset.pb"
78
- services: [ "bot.RecommenderService" ]
79
- print_options:
80
- add_whitespace: true
81
- always_print_primitive_fields: true
82
- always_print_enums_as_ints: false
83
- preserve_proto_field_names: false
84
- convert_grpc_status: true
85
- request_validation_options:
86
- reject_unknown_method: true
87
- reject_unknown_query_parameters: true
88
- - name: "envoy.filters.http.ext_authz"
89
- typed_config:
90
- "@type": type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz
91
- http_service:
92
- server_uri:
93
- uri: "http://authenticator-service:8080"
94
- cluster: "ext-auth"
95
- timeout: 60s
96
- authorization_request:
97
- allowed_headers:
98
- patterns:
99
- - { exact: "Job-Token", ignore_case: true }
100
- - { exact: "Project-Id", ignore_case: true }
101
- failure_mode_allow: false
102
- - name: "envoy.filters.http.router"
103
-
104
- clusters:
105
- - name: "recommender-bot"
106
- connect_timeout: "1.25s"
107
- type: "STATIC"
108
- lb_policy: "ROUND_ROBIN"
109
- dns_lookup_family: V4_ONLY
110
- typed_extension_protocol_options:
111
- envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
112
- "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
113
- explicit_http_config:
114
- http2_protocol_options: { }
115
- load_assignment:
116
- cluster_name: "recommender-bot"
117
- endpoints:
118
- - lb_endpoints:
119
- - endpoint:
120
- address:
121
- socket_address:
122
- address: "127.0.0.1"
123
- port_value: 8080
124
- - name: "ext-auth"
125
- connect_timeout: "1.25s"
126
- type: "LOGICAL_DNS"
127
- lb_policy: "ROUND_ROBIN"
128
- load_assignment:
129
- cluster_name: "ext-auth"
130
- endpoints:
131
- - lb_endpoints:
132
- - endpoint:
133
- address:
134
- socket_address:
135
- address: "authenticator-service"
136
- port_value: 8080
137
-
138
- ---
139
- apiVersion: apps/v1
140
- kind: Deployment
141
- metadata:
142
- name: recommender-bot-deployment
143
- labels:
144
- app: recommender-bot
145
- spec:
146
- replicas: 1
147
- selector:
148
- matchLabels:
149
- app: recommender-bot
150
- template:
151
- metadata:
152
- labels:
153
- app: recommender-bot
154
- spec:
155
- initContainers:
156
- - name: protosets
157
- image: recommender-bot-service:dev
158
- imagePullPolicy: Never
159
- command: [sh, -c]
160
- args: [cp /app/recommender-bot.protoset.pb /data/protos]
161
- volumeMounts:
162
- - name: grpc-protosets
163
- mountPath: /data/protos
164
- containers:
165
- - name: recommender-bot-envoy-sidecar
166
- image: envoyproxy/envoy-alpine:v1.19-latest
167
- imagePullPolicy: IfNotPresent
168
- ports:
169
- - containerPort: 8282
170
- - containerPort: 8484
171
- volumeMounts:
172
- - name: recommender-bot-envoy-sidecar-config
173
- mountPath: /etc/envoy
174
- - name: grpc-protosets
175
- mountPath: /data/protos
176
- readOnly: true
177
- - name: recommender-bot
178
- image: recommender-bot-service:dev
179
- imagePullPolicy: Never
180
- ports:
181
- - containerPort: 8080
182
- env:
183
- - name: RECOMMENDER_BOT_SERVICE_PORT
184
- value: "8080"
185
- - name: RECOMMENDER_BOT_GITLAB_TOKEN
186
- valueFrom:
187
- secretKeyRef:
188
- name: recommender-bot-gitlab-token
189
- key: token
190
- - name: RECOMMENDER_BOT_GRPC_SERVICE_URL
191
- value: recommender-service:8080
192
- - name: RECOMMENDER_BOT_PG_CONN_STRING
193
- valueFrom:
194
- secretKeyRef:
195
- name: recommender-bot-pg-conn-string
196
- key: pg-conn
197
- - name: PUBSUB_EMULATOR_HOST
198
- value: pubsub:8432
199
- - name: GOOGLE_APPLICATION_CREDENTIALS
200
- value: /data/gcp/gcp_credentials.json
201
- - name: RECOMMENDER_BOT_PUBSUB_PROJECT_ID
202
- value: project-test
203
- - name: RECOMMENDER_BOT_PUBSUB_TOPIC_RECOMMENDATIONS
204
- value: gitlab.merge-request-recommendations-test.1
205
- volumeMounts:
206
- - name: gcp-secrets
207
- mountPath: /data/gcp
208
- readOnly: true
209
- volumes:
210
- - name: grpc-protosets
211
- emptyDir: {}
212
- - name: recommender-bot-envoy-sidecar-config
213
- configMap:
214
- name: recommender-bot-envoy-sidecar-config
215
- - name: gcp-secrets
216
- secret:
217
- secretName: gcp-credentials
218
- items:
219
- - key: gcp_json
220
- path: gcp_credentials.json
221
-
222
- ---
223
- apiVersion: v1
224
- kind: Service
225
- metadata:
226
- name: recommender-bot-service
227
- labels:
228
- app: recommender-bot
229
- spec:
230
- type: NodePort
231
- ports:
232
- - name: http-plain
233
- port: 8282
234
- targetPort: 8282
235
- - name: http-auth
236
- port: 8484
237
- targetPort: 8484
238
- - name: grpc
239
- port: 8080
240
- targetPort: 8080
241
- selector:
242
- app: recommender-bot
@@ -1,52 +0,0 @@
1
- ---
2
- apiVersion: apps/v1
3
- kind: Deployment
4
- metadata:
5
- name: recommender-deployment
6
- labels:
7
- app: recommender
8
- spec:
9
- replicas: 1
10
- selector:
11
- matchLabels:
12
- app: recommender
13
- template:
14
- metadata:
15
- labels:
16
- app: recommender
17
- spec:
18
- containers:
19
- - name: recommender
20
- image: recommender-service:dev
21
- imagePullPolicy: Never
22
- ports:
23
- - containerPort: 8080
24
- volumeMounts:
25
- - name: models-mount
26
- mountPath: /app/data/models
27
- env:
28
- - name: RECOMMENDER_SERVICE_PORT
29
- value: "8080"
30
- - name: RECOMMENDER_MODELS_STORAGE
31
- value: local
32
- - name: GRPC_VERBOSITY
33
- value: debug
34
- volumes:
35
- - name: models-mount
36
- hostPath:
37
- path: /tmp/gitlab-qa/suggested_reviewer/data/models
38
-
39
- ---
40
- apiVersion: v1
41
- kind: Service
42
- metadata:
43
- name: recommender-service
44
- labels:
45
- app: recommender
46
- spec:
47
- type: ClusterIP
48
- ports:
49
- - port: 8080
50
- targetPort: 8080
51
- selector:
52
- app: recommender