Enable Gitlab Object Storage for Gitlab CI Artifacts
The stages of Gitlab CI log stream
The gitlab ci log stream contains 4 stages:
Stage | Status | Health | Data flow | Storage path |
---|---|---|---|---|
1: Posting | Log | Job running | GitLab Runner => Puma => File storage | #{ROOT_PATH}/gitlab-ci/builds/#{YYYY_mm}/#{project_id}/#{job_id}.log |
2: Overwriting | Log | Job finished | GitLab Runner => Puma => File storage | #{ROOT_PATH}/gitlab-ci/builds/#{YYYY_mm}/#{project_id}/#{job_id}.log |
3: Archiving | Archived log | Job finished | Sidekiq 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: Uploading | Archived log | Archived log | Sidekiq 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
--- 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.
gitlab-rails console
Then, run the following command to enable live trace (realtime trace).
## Check if the feature is enabled or not
Feature.enabled?(:ci_enable_live_trace)
## Enable the feature
Feature.enable(:ci_enable_live_trace)