BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
f00cec60
Commit
f00cec60
authored
Mar 01, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert logic of calculating checksum
parent
99b0542c
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
0 additions
and
91 deletions
+0
-91
job_artifact.rb
app/models/ci/job_artifact.rb
+0
-5
gitlab_uploader.rb
app/uploaders/gitlab_uploader.rb
+0
-8
job_artifact_uploader.rb
app/uploaders/job_artifact_uploader.rb
+0
-12
all_queues.yml
app/workers/all_queues.yml
+0
-3
object_storage_queue.rb
app/workers/concerns/object_storage_queue.rb
+0
-8
update_artifact_checksum_worker.rb
app/workers/update_artifact_checksum_worker.rb
+0
-11
20180228121020_update_checksum_for_ci_job_artifacts.rb
...te/20180228121020_update_checksum_for_ci_job_artifacts.rb
+0
-25
object_storage_queue_spec.rb
spec/workers/concerns/object_storage_queue_spec.rb
+0
-19
No files found.
app/models/ci/job_artifact.rb
View file @
f00cec60
...
...
@@ -6,7 +6,6 @@ module Ci
belongs_to
:job
,
class_name:
"Ci::Build"
,
foreign_key: :job_id
before_save
:set_size
,
if: :file_changed?
before_save
:set_checksum
,
if: :file_changed?
mount_uploader
:file
,
JobArtifactUploader
...
...
@@ -26,10 +25,6 @@ module Ci
self
.
size
=
file
.
size
end
def
set_checksum
self
.
checksum
=
file
.
checksum
end
def
expire_in
expire_at
-
Time
.
now
if
expire_at
end
...
...
app/uploaders/gitlab_uploader.rb
View file @
f00cec60
...
...
@@ -71,14 +71,6 @@ class GitlabUploader < CarrierWave::Uploader::Base
!!
model
end
##
# ObjectStorage::Concern extends this method for remote files
def
use_file
if
file_storage?
return
yield
path
end
end
private
# Designed to be overridden by child uploaders that have a dynamic path
...
...
app/uploaders/job_artifact_uploader.rb
View file @
f00cec60
...
...
@@ -9,12 +9,6 @@ class JobArtifactUploader < GitlabUploader
model
.
size
end
def
checksum
return
calc_checksum
if
model
.
checksum
.
nil?
model
.
checksum
end
def
store_dir
dynamic_segment
end
...
...
@@ -27,12 +21,6 @@ class JobArtifactUploader < GitlabUploader
private
def
calc_checksum
use_file
do
|
file_path
|
return
Digest
::
SHA256
.
file
(
file_path
).
hexdigest
end
end
def
dynamic_segment
creation_date
=
model
.
created_at
.
utc
.
strftime
(
'%Y_%m_%d'
)
...
...
app/workers/all_queues.yml
View file @
f00cec60
...
...
@@ -104,5 +104,3 @@
-
update_user_activity
-
upload_checksum
-
web_hook
-
object_storage:update_artifact_checksum_worker
\ No newline at end of file
app/workers/concerns/object_storage_queue.rb
deleted
100644 → 0
View file @
99b0542c
# Concern for setting Sidekiq settings for the various GitLab ObjectStorage workers.
module
ObjectStorageQueue
extend
ActiveSupport
::
Concern
included
do
queue_namespace
:object_storage
end
end
app/workers/update_artifact_checksum_worker.rb
deleted
100644 → 0
View file @
99b0542c
class
UpdateArtifactChecksumWorker
include
ApplicationWorker
include
ObjectStorageQueue
def
perform
(
job_artifact_id
)
Ci
::
JobArtifact
.
find_by
(
id:
job_artifact_id
).
try
do
|
job_artifact
|
job_artifact
.
set_checksum
job_artifact
.
save!
end
end
end
db/post_migrate/20180228121020_update_checksum_for_ci_job_artifacts.rb
deleted
100644 → 0
View file @
99b0542c
class
UpdateChecksumForCiJobArtifacts
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
BATCH_SIZE
=
2500
class
JobArtifact
<
ActiveRecord
::
Base
include
EachBatch
self
.
table_name
=
'ci_job_artifacts'
end
def
up
UpdateChecksumForCiJobArtifacts
::
JobArtifact
.
where
(
'checksum IS NULL'
)
.
each_batch
(
of:
BATCH_SIZE
)
do
|
relation
|
ids
=
relation
.
pluck
(
:id
).
map
{
|
id
|
[
id
]
}
UpdateArtifactChecksumWorker
.
bulk_perform_async
(
ids
)
end
end
def
down
# no-op
end
end
spec/workers/concerns/object_storage_queue_spec.rb
deleted
100644 → 0
View file @
99b0542c
require
'spec_helper'
describe
ObjectStorageQueue
do
let
(
:worker
)
do
Class
.
new
do
def
self
.
name
'DummyWorker'
end
include
ApplicationWorker
include
ObjectStorageQueue
end
end
it
'sets a default object storage queue automatically'
do
expect
(
worker
.
sidekiq_options
[
'queue'
])
.
to
eq
'object_storage:dummy'
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment