Featured image of post Gitlab CI enable live trace/ realtime trace

Gitlab CI enable live trace/ realtime trace

Enable Gitlab Object Storage for Gitlab CI Artifacts

The stages of Gitlab CI log stream

The gitlab ci log stream contains 4 stages:

StageStatusHealthData flowStorage path
1: PostingLogJob runningGitLab Runner => Puma => File storage#{ROOT_PATH}/gitlab-ci/builds/#{YYYY_mm}/#{project_id}/#{job_id}.log
2: OverwritingLogJob finishedGitLab Runner => Puma => File storage#{ROOT_PATH}/gitlab-ci/builds/#{YYYY_mm}/#{project_id}/#{job_id}.log
3: ArchivingArchived logJob finishedSidekiq moves the log to the artifacts folder#{ROOT_PATH}/gitlab-rails/shared/artifacts/#{disk_hash}/#{YYYY_mm_dd}/#{job_id}/#{job_artifact_id}/job.log
4: UploadingArchived logArchived logSidekiq moves the log to the object storage (if configured)#{bucket_name}/#{disk_hash}/#{YYYY_mm_dd}/#{job_id}/#{job_artifact_id}/job.log

Edit gitlab.rb

1
2
3
4
5
6
7
8
9
--- gitlab_rails['object_store']['enabled'] = false
+++ gitlab_rails['object_store']['enabled'] = true
gitlab_rails['object_store']['connection'] = {
gitlab_rails['object_store']['storage_options'] = {}
gitlab_rails['object_store']['proxy_download'] = false
+++ gitlab_rails['object_store']['objects']['artifacts']['bucket'] = 'gitlab-artifacts'
--- gitlab_rails['object_store']['objects']['lfs']['bucket'] = nil
+++ gitlab_rails['object_store']['objects']['lfs']['enabled'] = false
...

Enable Gitlab CI live trace (realtime trace)

Gitlab CI has a feature to enable live trace (realtime trace) for a job. This feature is disabled by default. To enable it, you need to modify via gitlab-rails console.

1
gitlab-rails console

Then, run the following command to enable live trace (realtime trace).

1
2
3
4
5
## Check if the feature is enabled or not
Feature.enabled?(:ci_enable_live_trace) 

## Enable the feature
Feature.enable(:ci_enable_live_trace)

(1) Gitlab Feature Flags

(2) Gitlab Chinese Document

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
33135a60-master at 2024-03-09 15:10:22 +0000
Built with Hugo
Theme Stack designed by Jimmy