Skip to content

Commit 243c166

Browse files
pedropombeirobalasankarc
authored andcommitted
Add settings to configure cronjob to sync finished builds to ClickHouse
Changelog: added
1 parent cb9ceb7 commit 243c166

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

files/gitlab-config-template/gitlab.rb.template

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ external_url 'GENERATED_EXTERNAL_URL'
935935

936936
### Registry database
937937
###! Docs: https://docs.gitlab.com/ee/administration/packages/container_registry.html?tab=Linux+package+%28Omnibus%29#configure-a-metadata-database-for-the-container-registry
938-
# registry['database'] = {
938+
# registry['database'] = {
939939
# 'enabled' => true,
940940
# 'host' => 'localhost',
941941
# 'port' => 5432,
@@ -953,7 +953,7 @@ external_url 'GENERATED_EXTERNAL_URL'
953953
# 'maxidle' => 25,
954954
# 'maxopen' => 25,
955955
# 'maxlifetime' => '5m'
956-
# }
956+
# }
957957
# }
958958

959959
### Registry notifications endpoints
@@ -2704,6 +2704,8 @@ external_url 'GENERATED_EXTERNAL_URL'
27042704
# gitlab_rails['elastic_index_bulk_cron'] = "*/1 * * * *"
27052705
# gitlab_rails['analytics_devops_adoption_create_all_snapshots_worker_cron'] = "0 4 * * 0"
27062706
# gitlab_rails['ci_runners_stale_group_runners_prune_worker_cron'] = "30 * * * *"
2707+
# gitlab_rails['click_house_ci_finished_builds_sync_worker_cron'] = "*/3 * * * *"
2708+
# gitlab_rails['click_house_ci_finished_builds_sync_worker_args'] = [1]
27072709

27082710
################################################################################
27092711
## Kerberos (EE Only)

files/gitlab-cookbooks/gitlab/attributes/default.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@
149149
default['gitlab']['gitlab_rails']['incoming_email_inbox_options'] = nil
150150
default['gitlab']['gitlab_rails']['incoming_email_delivery_method'] = "webhook"
151151
default['gitlab']['gitlab_rails']['incoming_email_auth_token'] = nil
152+
default['gitlab']['gitlab_rails']['click_house_ci_finished_builds_sync_worker_cron'] = nil
153+
default['gitlab']['gitlab_rails']['click_house_ci_finished_builds_sync_worker_args'] = nil
152154

153155
default['gitlab']['gitlab_rails']['service_desk_email_enabled'] = false
154156
default['gitlab']['gitlab_rails']['service_desk_email_address'] = nil

files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,15 @@ production: &base
700700
cron: "<%= @ci_runners_stale_group_runners_prune_worker_cron %>"
701701
<% end %>
702702

703+
# Periodically sync finished builds from p_ci_finished_build_ch_sync_events to ClickHouse
704+
<% unless @click_house_ci_finished_builds_sync_worker_cron.nil? %>
705+
click_house_ci_finished_builds_sync_worker:
706+
cron: "<%= @click_house_ci_finished_builds_sync_worker_cron %>"
707+
<% unless @click_house_ci_finished_builds_sync_worker_args.nil? %>
708+
args: <%= @click_house_ci_finished_builds_sync_worker_args %>
709+
<% end %>
710+
<% end %>
711+
703712
## Geo
704713
# NOTE: These settings will only take effect if Geo is enabled
705714
geo:

spec/chef/cookbooks/gitlab/recipes/gitlab-rails/gitlab_yml/cron_jobs_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
'ci_runners_stale_group_runners_prune_worker_cron' | 'ci_runners_stale_group_runners_prune_worker_cron'
5353
'ci_runner_versions_reconciliation_worker' | 'ci_runner_versions_reconciliation_worker_cron'
5454
'ci_runners_stale_machines_cleanup_worker' | 'ci_runners_stale_machines_cleanup_worker_cron'
55+
'click_house_ci_finished_builds_sync_worker' | 'click_house_ci_finished_builds_sync_worker_cron'
5556
end
5657

5758
with_them do

0 commit comments

Comments
 (0)