gitlab-qa 12.3.0 → 12.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e4cc0696035cf54be7b10e0153ffb42d59a5da480b4f87b8e313fc19ac50d96
4
- data.tar.gz: d773ed2ef468d85328eee38811f03738c97cb8b6679a1e65d6c22d3a91a76936
3
+ metadata.gz: 367b59ae508a9c2c33e9703ef5838f654326938179b0fff4e9854394dec28566
4
+ data.tar.gz: 72498fa54bd13f7ea378bc74307b9d08a8078f75ac185893e36a6ed2717f5f72
5
5
  SHA512:
6
- metadata.gz: eef1ff7b5b65693659df80f4bfb78891238b07a0bdba06d1348d068c780bf52cd6f2b65faf753a700511f0fb28a4bfe2cc6dead51cc8873933bc5fa420445fe3
7
- data.tar.gz: bb30bec072843a3939966e1beda00b2468f85f4bf201cd32c4f8d80c42824440d24884f86447b885d687fd627b75f7cf93d74cf20c778ada16986a5c51282d92
6
+ metadata.gz: 920ac1c0445f1ba5cecb1864e759df9c5cf5c48fbb89ba24ff04fc1960b8a21c771d7d6f981205125ac7cea882d15ab533ec906a90478da3336ddc345a795a2c
7
+ data.tar.gz: e48d7d55d2ccb5dfcf280a4626f1e2c798af68afaeea345c248b14947951942229d3a23add3e408dcd2faa68e0a5f0b7230333d7e6d5b6eefb6fc74d37193c8c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-qa (12.3.0)
4
+ gitlab-qa (12.4.1)
5
5
  activesupport (>= 6.1, < 7.1)
6
6
  gitlab (~> 4.19)
7
7
  http (~> 5.0)
@@ -112,6 +112,14 @@ All environment variables used by GitLab QA should be defined in [`lib/gitlab/qa
112
112
  | `RELEASE_REGISTRY_URL` | - | The registry url to fetch the release image for an orchestrated GitLab. | No |
113
113
  | `RELEASE_REGISTRY_USERNAME` | - | The username to log in to the registry for pulling the release image for orchestrated GitLab. | No |
114
114
  | `RELEASE_REGISTRY_PASSWORD` | - | The password to log in to the registry for pulling the release image for orchestrated GitLab. | No |
115
+ | `WORKSPACES_OAUTH_APP_ID` | - | Client ID for Gitlab-workspaces-proxy OAuth app used for the authentication and authorization of the workspaces running in the cluster. See https://gitlab.com/gitlab-org/remote-development/gitlab-workspaces-proxy for instructions. | No |
116
+ | `WORKSPACES_OAUTH_APP_SECRET` | - | Client Secret for Gitlab-workspaces-proxy OAuth app used for the authentication and authorization of the workspaces running in the cluster. See https://gitlab.com/gitlab-org/remote-development/gitlab-workspaces-proxy for instructions. | No |
117
+ | `WORKSPACES_OAUTH_SIGNING_KEY` | - | Client Signing key for Gitlab-workspaces-proxy OAuth app used for the authentication and authorization of the workspaces running in the cluster. | No |
118
+ | `WORKSPACES_PROXY_DOMAIN` | - | The domain on which gitlab-workspaces-proxy will listen on and it is used to create workspaces url. | No |
119
+ | `WORKSPACES_DOMAIN_CERT` | - | The fullchain.pem SSL Certificates for the `WORKSPACES_PROXY_DOMAIN`. See https://gitlab.com/gitlab-org/remote-development/gitlab-workspaces-proxy for instructions. | No |
120
+ | `WORKSPACES_DOMAIN_KEY` | - | The privkey.pem SSL Certificates for the `WORKSPACES_PROXY_DOMAIN`. See https://gitlab.com/gitlab-org/remote-development/gitlab-workspaces-proxy for instructions. | No |
121
+ | `WORKSPACES_WILDCARD_CERT` | - | The fullchain.pem SSL Certificates for the Wildcard `WORKSPACES_PROXY_DOMAIN`. See https://gitlab.com/gitlab-org/remote-development/gitlab-workspaces-proxy for instructions.| No |
122
+ | `WORKSPACES_WILDCARD_KEY` | - | The privkey.pem SSL Certificates for the Wildcard `WORKSPACES_PROXY_DOMAIN`. See https://gitlab.com/gitlab-org/remote-development/gitlab-workspaces-proxy for instructions. | No |
115
123
 
116
124
  ## [Supported Remote Grid environment variables](./running_against_remote_grid.md)
117
125
 
@@ -10,7 +10,7 @@ module Gitlab
10
10
  # and has to be performed before main component containers are started
11
11
  #
12
12
  class Alpine < Base
13
- DOCKER_IMAGE = "alpine"
13
+ DOCKER_IMAGE = "alpine/curl"
14
14
  DOCKER_IMAGE_TAG = "latest"
15
15
 
16
16
  def name
@@ -21,6 +21,7 @@ module Gitlab
21
21
  docker.run(image: image, tag: tag, args: ["tail", "-f", "/dev/null"]) do |command|
22
22
  command << "-d"
23
23
  command << "--name #{name}"
24
+ command << "--network #{network}" if network
24
25
 
25
26
  volumes.each { |to, from| command.volume(to, from, 'Z') }
26
27
  environment.each { |key, value| command.env(key, value) }
@@ -8,7 +8,7 @@ module Gitlab
8
8
 
9
9
  CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates', __dir__)
10
10
 
11
- attr_reader :docker
11
+ attr_reader :docker, :logger
12
12
  attr_writer :name, :exec_commands
13
13
  attr_accessor :volumes,
14
14
  :ports,
@@ -21,6 +21,7 @@ module Gitlab
21
21
 
22
22
  def initialize
23
23
  @docker = Docker::Engine.new
24
+ @logger = Runtime::Logger.logger
24
25
  @environment = {}
25
26
  @volumes = {}
26
27
  @ports = []
@@ -18,23 +18,24 @@ module Gitlab
18
18
  @tls_path = "/etc/smocker/tls"
19
19
  @ports = [80, 8081]
20
20
  @environment = { "SMOCKER_MOCK_SERVER_LISTEN_PORT" => 80 }
21
- @log_volume = {}
21
+ @tls_volume = { "smocker-ssl" => @tls_path }
22
22
  end
23
23
 
24
- attr_reader :name
24
+ attr_reader :name, :tls_volume
25
25
  attr_writer :tls
26
26
 
27
27
  def prepare
28
28
  super
29
29
 
30
+ alpine_service_container.start_instance
30
31
  setup_tls if tls
31
32
  end
32
33
 
33
- # Print smocker log output by using docker logs command because smocker only logs to stdout
34
- #
35
- # @return [void]
36
34
  def teardown!
35
+ # Print smocker log output by using docker logs command because smocker only logs to stdout
37
36
  Docker::Command.execute("logs #{name}")
37
+ # Remove alpine service container
38
+ alpine_service_container.teardown!
38
39
 
39
40
  super
40
41
  end
@@ -43,26 +44,64 @@ module Gitlab
43
44
 
44
45
  attr_reader :tls_path, :tls
45
46
 
47
+ # Run healthcheck validate startup of mock server
48
+ #
49
+ # @return [void]
50
+ def wait_until_ready
51
+ logger.info("Waiting for mock server to start!")
52
+ poll_mock_healthcheck(3)
53
+ logger.info("Mock server container is healthy!")
54
+ end
55
+
56
+ # Poll healthcheck endpoint
57
+ #
58
+ # @param [Integer] max_tries
59
+ # @return [void]
60
+ def poll_mock_healthcheck(max_tries)
61
+ url = "#{tls ? 'https' : 'http'}://#{hostname}:8081/version"
62
+ curl_cmd = "curl --cacert #{tls_path}/smocker.crt -s -f -o /dev/null -w '%{http_code}' #{url}"
63
+ tries = 0
64
+
65
+ loop do
66
+ # Poll healthcheck endpoint and remove service container if it passes
67
+ if docker.exec(alpine_service_container.name, curl_cmd, shell: "sh")
68
+ alpine_service_container.teardown!
69
+ break
70
+ end
71
+ rescue Support::ShellCommand::StatusError => e
72
+ # re-raise StatusError so that built in startup retry is used in case of failure
73
+ raise e if tries >= max_tries
74
+
75
+ tries += 1
76
+ sleep 1
77
+ end
78
+ end
79
+
46
80
  # Set up tls certs
47
81
  #
48
82
  # @return [void]
49
83
  def setup_tls
50
- @volumes = { "smocker-ssl" => tls_path }
84
+ @volumes = tls_volume
51
85
  @ports = [443, 8081]
52
86
  @environment = {
53
87
  "SMOCKER_MOCK_SERVER_LISTEN_PORT" => 443,
54
88
  "SMOCKER_TLS_ENABLE" => "true",
55
- "SMOCKER_TLS_CERT_FILE" => "#{@tls_path}/smocker.crt",
56
- "SMOCKER_TLS_PRIVATE_KEY_FILE" => "#{@tls_path}/smocker.key"
89
+ "SMOCKER_TLS_CERT_FILE" => "#{tls_path}/smocker.crt",
90
+ "SMOCKER_TLS_PRIVATE_KEY_FILE" => "#{tls_path}/smocker.key"
57
91
  }
58
92
 
59
- Alpine.perform do |alpine|
60
- alpine.volumes = volumes
93
+ docker.copy(alpine_service_container.name, "#{CERTIFICATES_PATH}/smocker/.", tls_path)
94
+ end
61
95
 
62
- alpine.start_instance
63
- docker.copy(alpine.name, "#{CERTIFICATES_PATH}/smocker/.", tls_path)
64
- ensure
65
- alpine.teardown! # always remove container, even when global `--no-tests` flag was provided
96
+ # Helper container to run tls cert copy and curl healthcheck command
97
+ # Separate container is required because tls certs have to be copied before smocker startup and smocker
98
+ # container itself doesn't ship with curl to perform healthcheck requests
99
+ #
100
+ # @return [Component::Alpine]
101
+ def alpine_service_container
102
+ @alpine_service_container ||= Alpine.new.tap do |alpine|
103
+ alpine.volumes = tls_volume
104
+ alpine.network = network
66
105
  end
67
106
  end
68
107
  end
@@ -81,10 +81,10 @@ module Gitlab
81
81
  ), mask_secrets: mask_secrets)
82
82
  end
83
83
 
84
- def exec(name, command, mask_secrets: nil)
84
+ def exec(name, command, mask_secrets: nil, shell: "bash")
85
85
  cmd = ['exec']
86
86
  cmd << '--privileged' if privileged_command?(command)
87
- Docker::Command.execute(%(#{cmd.join(' ')} #{name} bash -c "#{command.gsub('"', '\\"')}"),
87
+ Docker::Command.execute(%(#{cmd.join(' ')} #{name} #{shell} -c "#{command.gsub('"', '\\"')}"),
88
88
  mask_secrets: mask_secrets)
89
89
  end
90
90
 
@@ -156,7 +156,15 @@ module Gitlab
156
156
  'RELEASE_REGISTRY_PASSWORD' => :release_registry_password,
157
157
  'SELENOID_DIRECTORY' => :selenoid_directory,
158
158
  'USE_SELENOID' => :use_selenoid,
159
- 'SCHEDULE_TYPE' => :schedule_type
159
+ 'SCHEDULE_TYPE' => :schedule_type,
160
+ 'WORKSPACES_OAUTH_APP_ID' => :workspaces_oauth_app_id,
161
+ 'WORKSPACES_OAUTH_APP_SECRET' => :workspaces_oauth_app_secret,
162
+ 'WORKSPACES_OAUTH_SIGNING_KEY' => :workspaces_oauth_signing_key,
163
+ 'WORKSPACES_PROXY_DOMAIN' => :workspaces_proxy_domain,
164
+ 'WORKSPACES_DOMAIN_CERT' => :workspaces_domain_cert,
165
+ 'WORKSPACES_DOMAIN_KEY' => :workspaces_domain_key,
166
+ 'WORKSPACES_WILDCARD_CERT' => :workspaces_wildcard_cert,
167
+ 'WORKSPACES_WILDCARD_KEY' => :workspaces_wildcard_key
160
168
  }.freeze
161
169
 
162
170
  ENV_VARIABLES.each do |env_name, method_name|
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '12.3.0'
5
+ VERSION = '12.4.1'
6
6
  end
7
7
  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: 12.3.0
4
+ version: 12.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab Quality
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-18 00:00:00.000000000 Z
11
+ date: 2023-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control