An error occurred while fetching the assigned iteration of the selected issue.
ArtifactUploader copies files across filesystems
ZD: https://gitlab.zendesk.com/agent/tickets/80838
We have a bug similar to gitlab-org/gitlab-ce#33218 where artifacts are being copied to /var/opt/gitlab/gitlab-rails/tmp
before copied to their final destination. I suspect it was introduced in 9.4 with the refactor of ArtifactUploader
to ObjectStoreUploader
. This appears to be happening:
- Workhorse saves the file to something like
/var/opt/gitlab/gitlab-rails/shared/artifacts/tmp/uploads/multipart-846747258/artifacts.zip
- CarrierWave then copies the files to a temporary dir in
/opt/gitlab/embedded/service/gitlab-rails/tmp/1501626847-11955-0001-0912/artifacts.zip
(see https://github.com/carrierwaveuploader/carrierwave/blob/v1.1.0/lib/carrierwave/uploader/cache.rb#L134) - CarrierWave then saves the final destination to
/var/opt/gitlab/gitlab-rails/shared/artifacts/2017_08/113/1279/artifacts.zip
I think we want to do the following:
- Enable CarrierWave cache so that the file is moved, not copied
- Extract the
workfile_path
method fromGitlabUploader
intoObjectStoreUploader
/cc: @zj, @ayufan, @dblessing