diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-06 17:18:32 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-28 22:59:25 +0300 |
commit | 999118f0ec6edabc9e13c089381ad664970a080a (patch) | |
tree | 4201e2944efb5379c9355999fc3750d0b0710566 /app/workers | |
parent | b14c484bb1d174c7c355de2258be1a4414b2cf78 (diff) |
Merge branch 'feature/sm/artifacts-trace-ee' into 'master'
EE: Trace as artifacts (FileStorage and ObjectStorage)
Closes #4171
See merge request gitlab-org/gitlab-ee!4258
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/all_queues.yml | 1 | ||||
-rw-r--r-- | app/workers/build_finished_worker.rb | 8 | ||||
-rw-r--r-- | app/workers/create_trace_artifact_worker.rb | 10 |
3 files changed, 17 insertions, 2 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 50e876b1d19..f2c20114534 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -43,6 +43,7 @@ - pipeline_creation:run_pipeline_schedule - pipeline_default:build_coverage - pipeline_default:build_trace_sections +- pipeline_default:create_trace_artifact - pipeline_default:pipeline_metrics - pipeline_default:pipeline_notification - pipeline_default:update_head_pipeline_for_merge_request diff --git a/app/workers/build_finished_worker.rb b/app/workers/build_finished_worker.rb index 97d80305bec..b5ed8d607b3 100644 --- a/app/workers/build_finished_worker.rb +++ b/app/workers/build_finished_worker.rb @@ -6,9 +6,13 @@ class BuildFinishedWorker def perform(build_id) Ci::Build.find_by(id: build_id).try do |build| - BuildTraceSectionsWorker.perform_async(build.id) + # We execute that in sync as this access the files in order to access local file, and reduce IO + BuildTraceSectionsWorker.new.perform(build.id) BuildCoverageWorker.new.perform(build.id) - BuildHooksWorker.new.perform(build.id) + + # We execute that async as this are two indepentent operations that can be executed after TraceSections and Coverage + BuildHooksWorker.perform_async(build.id) + CreateTraceArtifactWorker.perform_async(build.id) end end end diff --git a/app/workers/create_trace_artifact_worker.rb b/app/workers/create_trace_artifact_worker.rb new file mode 100644 index 00000000000..11cda58021e --- /dev/null +++ b/app/workers/create_trace_artifact_worker.rb @@ -0,0 +1,10 @@ +class CreateTraceArtifactWorker + include ApplicationWorker + include PipelineQueue + + def perform(job_id) + Ci::Build.preload(:project, :user).find_by(id: job_id).try do |job| + Ci::CreateTraceArtifactService.new(job.project, job.user).execute(job) + end + end +end |