Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
3a0f9003
Commit
3a0f9003
authored
Apr 02, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove OS changes
parent
3a87bfb2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
129 deletions
+0
-129
lib/gitlab/ci/trace/chunked_file/chunk_store/object_storage.rb
...itlab/ci/trace/chunked_file/chunk_store/object_storage.rb
+0
-84
lib/gitlab/ci/trace/chunked_file/http_io.rb
lib/gitlab/ci/trace/chunked_file/http_io.rb
+0
-45
No files found.
lib/gitlab/ci/trace/chunked_file/chunk_store/object_storage.rb
deleted
100644 → 0
View file @
3a87bfb2
module
Gitlab
module
Ci
class
Trace
module
ChunkedFile
module
ChunkStore
class
ObjectStorage
<
Base
class
<<
self
def
open
(
job_id
,
chunk_index
,
**
params
)
raise
ArgumentError
unless
job_id
&&
chunk_index
relative_path
=
relative_path
(
job_id
,
chunk_index
)
store
=
self
.
new
(
relative_path
,
params
)
yield
store
ensure
store
&
.
close
end
def
exist?
(
job_id
,
chunk_index
)
raise
NotImplementedError
end
def
chunks_count
(
job_id
)
raise
NotImplementedError
end
def
relative_path
(
job_id
,
chunk_index
)
"
#{
job_id
}
/
#{
chunk_index
}
.chunk"
end
end
FailedToGetChunkError
=
Class
.
new
(
StandardError
)
attr_reader
:relative_path
def
initialize
(
relative_path
,
**
params
)
super
@relative_path
=
relative_path
end
def
close
@relative_path
=
nil
end
## TODO: Carrierwave::Fog integration
def
get
response
=
Net
::
HTTP
.
start
(
uri
.
hostname
,
uri
.
port
,
use_ssl:
uri
.
scheme
==
'https'
)
do
|
http
|
request
=
Net
::
HTTP
::
Get
.
new
(
uri
)
request
.
set_range
(
chunk_start
,
buffer_size
)
http
.
request
(
request
)
end
raise
FailedToGetChunkError
unless
response
.
code
==
'200'
||
response
.
code
==
'206'
response
.
body
.
force_encoding
(
Encoding
::
BINARY
)
end
def
size
raise
NotImplementedError
end
def
write!
(
data
)
raise
NotImplementedError
,
'Partial write is not supported'
unless
buffer_size
==
data
.
length
raise
NotImplementedError
end
def
append!
(
data
)
raise
NotImplementedError
end
def
truncate!
(
offset
)
raise
NotImplementedError
end
def
delete!
raise
NotImplementedError
end
end
end
end
end
end
end
lib/gitlab/ci/trace/chunked_file/http_io.rb
deleted
100644 → 0
View file @
3a87bfb2
module
Gitlab
module
Ci
class
Trace
module
ChunkedFile
class
HttpIO
<
ChunkedIO
BUFFER_SIZE
=
128
.
kilobytes
InvalidURLError
=
Class
.
new
(
StandardError
)
attr_reader
:uri
def
initialize
(
job_id
,
url
,
size
,
mode
)
raise
InvalidURLError
unless
::
Gitlab
::
UrlSanitizer
.
valid?
(
url
)
@uri
=
URI
(
url
)
super
(
job_id
,
size
,
mode
)
end
def
write
(
data
)
raise
NotImplementedError
end
def
truncate
(
offset
)
raise
NotImplementedError
end
def
flush
raise
NotImplementedError
end
private
def
chunk_store
ChunkStores
::
ObjectStorage
end
def
params_for_store
super
.
merge
(
{
uri:
uri
}
)
end
end
end
end
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