diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-27 00:10:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-27 00:10:49 +0300 |
commit | 84d72a5660ac1f3c55026b8781152a9bcbe13fa2 (patch) | |
tree | 34e4bbdcbb91f6c67f99f5f69b52be140f9c8763 /lib | |
parent | 4c47bc5ec6420ab3a4ef629010e89de45b2776b9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/ci/runner.rb | 3 | ||||
-rw-r--r-- | lib/api/helpers/runner.rb | 7 | ||||
-rw-r--r-- | lib/gitlab/ci/features.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/cluster/lifecycle_events.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/runtime.rb | 10 |
5 files changed, 12 insertions, 15 deletions
diff --git a/lib/api/ci/runner.rb b/lib/api/ci/runner.rb index 33980b38e2b..035711da1a0 100644 --- a/lib/api/ci/runner.rb +++ b/lib/api/ci/runner.rb @@ -98,6 +98,9 @@ module API optional :architecture, type: String, desc: %q(Runner's architecture) optional :executor, type: String, desc: %q(Runner's executor) optional :features, type: Hash, desc: %q(Runner's features) + optional :config, type: Hash, desc: %q(Runner's config) do + optional :gpus, type: String, desc: %q(GPUs enabled) + end end optional :session, type: Hash, desc: %q(Runner's session data) do optional :url, type: String, desc: %q(Session's url) diff --git a/lib/api/helpers/runner.rb b/lib/api/helpers/runner.rb index 6f25cf507bc..e141abeef91 100644 --- a/lib/api/helpers/runner.rb +++ b/lib/api/helpers/runner.rb @@ -25,6 +25,7 @@ module API return get_runner_ip unless params['info'].present? attributes_for_keys(%w(name version revision platform architecture), params['info']) + .merge(get_runner_config_from_request) .merge(get_runner_ip) end @@ -91,6 +92,12 @@ module API def track_ci_minutes_usage!(_build, _runner) # noop: overridden in EE end + + private + + def get_runner_config_from_request + { config: attributes_for_keys(%w(gpus), params.dig('info', 'config')) } + end end end end diff --git a/lib/gitlab/ci/features.rb b/lib/gitlab/ci/features.rb index 37700131346..d1c1a4ecbde 100644 --- a/lib/gitlab/ci/features.rb +++ b/lib/gitlab/ci/features.rb @@ -18,10 +18,6 @@ module Gitlab Feature.enabled?(:ci_pipeline_status_omit_commit_sha_in_cache_key, project, default_enabled: true) end - def self.merge_base_pipeline_for_metrics_comparison?(project) - Feature.enabled?(:merge_base_pipeline_for_metrics_comparison, project, default_enabled: :yaml) - end - # NOTE: The feature flag `disallow_to_create_merge_request_pipelines_in_target_project` # is a safe switch to disable the feature for a particular project when something went wrong, # therefore it's not supposed to be enabled by default. diff --git a/lib/gitlab/cluster/lifecycle_events.rb b/lib/gitlab/cluster/lifecycle_events.rb index 6b7b9b09269..6159fb0a811 100644 --- a/lib/gitlab/cluster/lifecycle_events.rb +++ b/lib/gitlab/cluster/lifecycle_events.rb @@ -162,9 +162,6 @@ module Gitlab # Sidekiq doesn't fork return false if Gitlab::Runtime.sidekiq? - # Unicorn always forks - return true if Gitlab::Runtime.unicorn? - # Puma sometimes forks return true if in_clustered_puma? diff --git a/lib/gitlab/runtime.rb b/lib/gitlab/runtime.rb index b0bcea0ca69..f60cac0aff0 100644 --- a/lib/gitlab/runtime.rb +++ b/lib/gitlab/runtime.rb @@ -15,8 +15,7 @@ module Gitlab :rails_runner, :rake, :sidekiq, - :test_suite, - :unicorn + :test_suite ].freeze class << self @@ -36,11 +35,6 @@ module Gitlab !!defined?(::Puma) end - # For unicorn, we need to check for actual server instances to avoid false positives. - def unicorn? - !!(defined?(::Unicorn) && defined?(::Unicorn::HttpServer)) - end - def sidekiq? !!(defined?(::Sidekiq) && Sidekiq.server?) end @@ -66,7 +60,7 @@ module Gitlab end def web_server? - puma? || unicorn? + puma? end def action_cable? |