[ARVADOS] created: 1.4.1-10-g8aeb62546
Git user
git at public.curoverse.com
Wed Nov 6 23:36:11 UTC 2019
at 8aeb62546fbf9e5febd837400d6b5c0d22281d34 (commit)
commit 8aeb62546fbf9e5febd837400d6b5c0d22281d34
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Mon Oct 21 16:59:58 2019 -0400
Merge branch '15699-update-gem'
refs #15699
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile
index 986e0f7a2..1ef84619a 100644
--- a/apps/workbench/Gemfile
+++ b/apps/workbench/Gemfile
@@ -114,3 +114,7 @@ gem 'logstash-event'
gem 'safe_yaml'
gem 'npm-rails'
+
+# arvados-google-api-client and googleauth (and thus arvados) gems
+# depend on signet, but signet 0.12 is incompatible with ruby 2.3.
+gem 'signet', '< 0.12'
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index cbf47f830..79d4f1712 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -134,13 +134,13 @@ GEM
flamegraph (0.9.5)
globalid (0.4.2)
activesupport (>= 4.2.0)
- googleauth (0.10.0)
+ googleauth (0.9.0)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
- signet (~> 0.12)
+ signet (~> 0.7)
headless (1.0.2)
highline (2.0.2)
httpclient (2.8.3)
@@ -282,7 +282,7 @@ GEM
selenium-webdriver (3.141.0)
childprocess (~> 0.5)
rubyzip (~> 1.2, >= 1.2.2)
- signet (0.12.0)
+ signet (0.11.0)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
@@ -366,6 +366,7 @@ DEPENDENCIES
sass
sassc-rails
selenium-webdriver (~> 3)
+ signet (< 0.12)
simplecov (~> 0.7)
simplecov-rcov
sshkey
diff --git a/services/api/Gemfile b/services/api/Gemfile
index b106ab199..f166505bc 100644
--- a/services/api/Gemfile
+++ b/services/api/Gemfile
@@ -75,6 +75,10 @@ gem 'rails-controller-testing'
gem 'sass-rails'
+# arvados-google-api-client and googleauth depend on signet, but
+# signet 0.12 is incompatible with ruby 2.3.
+gem 'signet', '< 0.12'
+
# Install any plugin gems
Dir.glob(File.join(File.dirname(__FILE__), 'lib', '**', "Gemfile")) do |f|
eval(IO.read(f), binding)
diff --git a/services/api/Gemfile.lock b/services/api/Gemfile.lock
index a61b5932d..88fcdcfed 100644
--- a/services/api/Gemfile.lock
+++ b/services/api/Gemfile.lock
@@ -121,13 +121,13 @@ GEM
ffi (1.9.25)
globalid (0.4.2)
activesupport (>= 4.2.0)
- googleauth (0.10.0)
+ googleauth (0.9.0)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
- signet (~> 0.12)
+ signet (~> 0.7)
hashie (3.6.0)
highline (2.0.1)
httpclient (2.8.3)
@@ -254,7 +254,7 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
- signet (0.12.0)
+ signet (0.11.0)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
@@ -324,6 +324,7 @@ DEPENDENCIES
rvm-capistrano
safe_yaml
sass-rails
+ signet (< 0.12)
simplecov (~> 0.7.1)
simplecov-rcov
sshkey
commit 8cab259adbc7286de25fabe6caf07c14a16e5823
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Mon Oct 21 10:38:48 2019 -0400
Merge branch '15699-update-gem'
refs #15699
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile
index ce2a1377d..986e0f7a2 100644
--- a/apps/workbench/Gemfile
+++ b/apps/workbench/Gemfile
@@ -5,7 +5,7 @@
source 'https://rubygems.org'
gem 'rails', '~> 5.0.0'
-gem 'arvados', '>= 0.1.20150511150219'
+gem 'arvados', git: 'https://github.com/curoverse/arvados.git', glob: 'sdk/ruby/arvados.gemspec'
gem 'activerecord-nulldb-adapter', git: 'https://github.com/curoverse/nulldb'
gem 'multi_json'
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index 548da1dc0..cbf47f830 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -1,4 +1,18 @@
GIT
+ remote: https://github.com/curoverse/arvados.git
+ revision: dd9f2403f43bcb93da5908ddde57d8c0491bb4c2
+ glob: sdk/ruby/arvados.gemspec
+ specs:
+ arvados (1.4.1.20191019025325)
+ activesupport (>= 3)
+ andand (~> 1.3, >= 1.3.3)
+ arvados-google-api-client (>= 0.7, < 0.8.9)
+ faraday (< 0.16)
+ i18n (~> 0)
+ json (>= 1.7.7, < 3)
+ jwt (>= 0.1.5, < 2)
+
+GIT
remote: https://github.com/curoverse/nulldb
revision: d8e0073b665acdd2537c5eb15178a60f02f4b413
specs:
@@ -58,14 +72,7 @@ GEM
andand (1.3.3)
angularjs-rails (1.3.15)
arel (7.1.4)
- arvados (1.3.1.20190320201707)
- activesupport (>= 3)
- andand (~> 1.3, >= 1.3.3)
- arvados-google-api-client (>= 0.7, < 0.8.9)
- i18n (~> 0)
- json (>= 1.7.7, < 3)
- jwt (>= 0.1.5, < 2)
- arvados-google-api-client (0.8.7.2)
+ arvados-google-api-client (0.8.7.3)
activesupport (>= 3.2, < 5.1)
addressable (~> 2.3)
autoparse (~> 0.3)
@@ -127,13 +134,13 @@ GEM
flamegraph (0.9.5)
globalid (0.4.2)
activesupport (>= 4.2.0)
- googleauth (0.8.1)
+ googleauth (0.10.0)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
- signet (~> 0.7)
+ signet (~> 0.12)
headless (1.0.2)
highline (2.0.2)
httpclient (2.8.3)
@@ -178,8 +185,8 @@ GEM
metaclass (~> 0.0.1)
morrisjs-rails (0.5.1.2)
railties (> 3.1, < 6)
- multi_json (1.13.1)
- multipart-post (2.0.0)
+ multi_json (1.14.1)
+ multipart-post (2.1.1)
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
net-sftp (2.1.2)
@@ -275,7 +282,7 @@ GEM
selenium-webdriver (3.141.0)
childprocess (~> 0.5)
rubyzip (~> 1.2, >= 1.2.2)
- signet (0.11.0)
+ signet (0.12.0)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
@@ -320,7 +327,7 @@ DEPENDENCIES
activerecord-nulldb-adapter!
andand
angularjs-rails (~> 1.3.8)
- arvados (>= 0.1.20150511150219)
+ arvados!
bootstrap-sass (~> 3.4.1)
bootstrap-tab-history-rails
bootstrap-x-editable-rails
diff --git a/services/api/Gemfile b/services/api/Gemfile
index 804d2a479..b106ab199 100644
--- a/services/api/Gemfile
+++ b/services/api/Gemfile
@@ -25,9 +25,6 @@ group :test, :development do
gem 'byebug'
end
-# We need this dependency because of crunchv1
-gem 'arvados-cli'
-
gem 'pg', '~> 1.0'
gem 'multi_json'
@@ -58,7 +55,12 @@ gem 'faye-websocket'
gem 'themes_for_rails', git: 'https://github.com/curoverse/themes_for_rails'
-gem 'arvados', '>= 1.3.1.20190301212059'
+# We need arvados-cli because of crunchv1. Note: bundler can't handle
+# two gems with the same "git" url but different "glob" values, hence
+# the use of a wildcard here instead of literal paths
+# (sdk/cli/arvados-cli.gem and sdk/ruby/arvados.gem).
+gem 'arvados-cli', git: 'https://github.com/curoverse/arvados.git', glob: 'sdk/*/*.gemspec'
+gem 'arvados', git: 'https://github.com/curoverse/arvados.git', glob: 'sdk/*/*.gemspec'
gem 'httpclient'
gem 'sshkey'
diff --git a/services/api/Gemfile.lock b/services/api/Gemfile.lock
index 078b2b7f4..a61b5932d 100644
--- a/services/api/Gemfile.lock
+++ b/services/api/Gemfile.lock
@@ -1,4 +1,28 @@
GIT
+ remote: https://github.com/curoverse/arvados.git
+ revision: dd9f2403f43bcb93da5908ddde57d8c0491bb4c2
+ glob: sdk/*/*.gemspec
+ specs:
+ arvados (1.4.1.20191019025325)
+ activesupport (>= 3)
+ andand (~> 1.3, >= 1.3.3)
+ arvados-google-api-client (>= 0.7, < 0.8.9)
+ faraday (< 0.16)
+ i18n (~> 0)
+ json (>= 1.7.7, < 3)
+ jwt (>= 0.1.5, < 2)
+ arvados-cli (1.4.1.20191017145711)
+ activesupport (>= 3.2.13, < 5.1)
+ andand (~> 1.3, >= 1.3.3)
+ arvados (>= 1.4.1.20190320201707)
+ arvados-google-api-client (~> 0.6, >= 0.6.3, < 0.8.9)
+ curb (~> 0.8)
+ faraday (< 0.16)
+ json (>= 1.7.7, < 3)
+ oj (~> 3.0)
+ optimist (~> 3.0)
+
+GIT
remote: https://github.com/curoverse/themes_for_rails
revision: ddf6e592b3b6493ea0c2de7b5d3faa120ed35be0
specs:
@@ -49,27 +73,11 @@ GEM
activemodel (>= 3.0.0)
activesupport (>= 3.0.0)
rack (>= 1.1.0)
- addressable (2.6.0)
- public_suffix (>= 2.0.2, < 4.0)
+ addressable (2.7.0)
+ public_suffix (>= 2.0.2, < 5.0)
andand (1.3.3)
arel (7.1.4)
- arvados (1.3.1.20190320201707)
- activesupport (>= 3)
- andand (~> 1.3, >= 1.3.3)
- arvados-google-api-client (>= 0.7, < 0.8.9)
- i18n (~> 0)
- json (>= 1.7.7, < 3)
- jwt (>= 0.1.5, < 2)
- arvados-cli (1.3.1.20190320201707)
- activesupport (>= 3.2.13, < 5.1)
- andand (~> 1.3, >= 1.3.3)
- arvados (~> 1.3.0, >= 1.3.0)
- arvados-google-api-client (~> 0.6, >= 0.6.3, < 0.8.9)
- curb (~> 0.8)
- json (>= 1.7.7, < 3)
- oj (~> 3.0)
- optimist (~> 3.0)
- arvados-google-api-client (0.8.7.2)
+ arvados-google-api-client (0.8.7.3)
activesupport (>= 3.2, < 5.1)
addressable (~> 2.3)
autoparse (~> 0.3)
@@ -94,7 +102,7 @@ GEM
net-ssh-gateway (>= 1.1.0)
concurrent-ruby (1.1.5)
crass (1.0.4)
- curb (0.9.9)
+ curb (0.9.10)
database_cleaner (1.7.0)
erubis (2.7.0)
eventmachine (1.2.7)
@@ -113,13 +121,13 @@ GEM
ffi (1.9.25)
globalid (0.4.2)
activesupport (>= 4.2.0)
- googleauth (0.8.0)
+ googleauth (0.10.0)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
- signet (~> 0.7)
+ signet (~> 0.12)
hashie (3.6.0)
highline (2.0.1)
httpclient (2.8.3)
@@ -153,9 +161,9 @@ GEM
minitest (5.10.3)
mocha (1.8.0)
metaclass (~> 0.0.1)
- multi_json (1.13.1)
+ multi_json (1.14.1)
multi_xml (0.6.0)
- multipart-post (2.0.0)
+ multipart-post (2.1.1)
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
net-sftp (2.1.2)
@@ -172,7 +180,7 @@ GEM
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
- oj (3.7.11)
+ oj (3.9.2)
omniauth (1.4.3)
hashie (>= 1.2, < 4)
rack (>= 1.6.2, < 3)
@@ -180,13 +188,13 @@ GEM
oauth2 (~> 1.1)
omniauth (~> 1.2)
optimist (3.0.0)
- os (1.0.0)
+ os (1.0.1)
passenger (6.0.2)
rack
rake (>= 0.8.1)
pg (1.1.4)
power_assert (1.1.4)
- public_suffix (3.0.3)
+ public_suffix (4.0.1)
rack (2.0.7)
rack-test (0.6.3)
rack (>= 1.0)
@@ -246,7 +254,7 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
- signet (0.11.0)
+ signet (0.12.0)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
@@ -288,8 +296,8 @@ PLATFORMS
DEPENDENCIES
acts_as_api
andand
- arvados (>= 1.3.1.20190301212059)
- arvados-cli
+ arvados!
+ arvados-cli!
byebug
database_cleaner
factory_bot_rails
commit b7b966bc21d646e0cffcf43fdd0d2a506fc6047e
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Fri Oct 18 22:53:25 2019 -0400
15699: Fix fencepost error at end of stream.
refs #15699
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/sdk/ruby/lib/arvados/collection.rb b/sdk/ruby/lib/arvados/collection.rb
index 29c7663f7..e29deba6c 100644
--- a/sdk/ruby/lib/arvados/collection.rb
+++ b/sdk/ruby/lib/arvados/collection.rb
@@ -207,7 +207,7 @@ module Arv
loop do
ii = (lo + hi) / 2
range = @ranges[ii]
- if range.include?(target) && (target < range.end || ii == hi)
+ if range.include?(target) && (target < range.end || ii == hi-1)
return ii
elsif ii == lo
raise RangeError.new("%i not in segment" % target)
diff --git a/sdk/ruby/test/test_collection.rb b/sdk/ruby/test/test_collection.rb
index 197944373..8b747c365 100644
--- a/sdk/ruby/test/test_collection.rb
+++ b/sdk/ruby/test/test_collection.rb
@@ -36,6 +36,29 @@ class CollectionTest < Minitest::Test
end
end
+ def test_range_edge_cases
+ [
+ ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1\n",
+ ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1 0:0:file2\n",
+ ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1 0:0:file1\n",
+ ". d41d8cd98f00b204e9800998ecf8427e+0 0:0:file1 0:0:file2 0:0:file1\n",
+ ". 0cc175b9c0f1b6a831c399e269772661+1 0:0:file1 1:0:file2 1:0:file1\n",
+ ].each do |txt|
+ coll = Arv::Collection.new(txt)
+ coll.normalize
+ assert_match(/ 0:0:file1/, coll.manifest_text)
+ end
+ [
+ ". d41d8cd98f00b204e9800998ecf8427e+0 1:0:file1\n",
+ ". 0cc175b9c0f1b6a831c399e269772661+1 0:0:file1 2:0:file2 1:0:file1\n",
+ ].each do |txt|
+ assert_raises(RangeError) do
+ coll = Arv::Collection.new(txt)
+ coll.normalize
+ end
+ end
+ end
+
def test_non_manifest_construction_error
["word", ". abc def", ". #{random_block} 0:", ". / !"].each do |m_text|
assert_raises(ArgumentError,
commit 8dd057757be19a103695155f8bec9ae2155ea2ff
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Thu Oct 17 10:57:11 2019 -0400
15699: Update arvados-cli to latest arvados gem.
refs #15699
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/sdk/cli/arvados-cli.gemspec b/sdk/cli/arvados-cli.gemspec
index f21c3e421..efb3cae9d 100644
--- a/sdk/cli/arvados-cli.gemspec
+++ b/sdk/cli/arvados-cli.gemspec
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
s.executables << "arv-crunch-job"
s.executables << "arv-tag"
s.required_ruby_version = '>= 2.1.0'
- s.add_runtime_dependency 'arvados', '~> 1.3.0', '>= 1.3.0'
+ s.add_runtime_dependency 'arvados', '>= 1.4.1.20190320201707'
# Our google-api-client dependency used to be < 0.9, but that could be
# satisfied by the buggy 0.9.pre*. https://dev.arvados.org/issues/9213
s.add_runtime_dependency 'arvados-google-api-client', '~> 0.6', '>= 0.6.3', '<0.8.9'
commit c6c5e83e6d7dfe7ee757e0cc0fa468a191cff4eb
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Tue Oct 15 15:21:55 2019 -0400
Merge branch '15699-workbench-copy-fail'
refs #15699
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/sdk/ruby/lib/arvados/collection.rb b/sdk/ruby/lib/arvados/collection.rb
index f236ce83a..29c7663f7 100644
--- a/sdk/ruby/lib/arvados/collection.rb
+++ b/sdk/ruby/lib/arvados/collection.rb
@@ -207,7 +207,7 @@ module Arv
loop do
ii = (lo + hi) / 2
range = @ranges[ii]
- if range.include?(target)
+ if range.include?(target) && (target < range.end || ii == hi)
return ii
elsif ii == lo
raise RangeError.new("%i not in segment" % target)
@@ -481,14 +481,13 @@ module Arv
def initialize(name)
@name = name
- @loc_ranges = {}
+ @loc_ranges = []
@loc_range_start = 0
@file_specs = []
end
def add_file(coll_file)
coll_file.each_segment do |segment|
- extend_locator_ranges(segment.locators)
extend_file_specs(coll_file.name, segment)
end
end
@@ -498,48 +497,51 @@ module Arv
""
else
"%s %s %s\n" % [escape_name(@name),
- @loc_ranges.keys.join(" "),
+ @loc_ranges.collect(&:locator).join(" "),
@file_specs.join(" ")]
end
end
private
- def extend_locator_ranges(locators)
- locators.
- select { |loc_s| not @loc_ranges.include?(loc_s) }.
- each do |loc_s|
- @loc_ranges[loc_s] = LocatorRange.new(loc_s, @loc_range_start)
- @loc_range_start = @loc_ranges[loc_s].end
+ def extend_file_specs(filename, segment)
+ found_overlap = false
+ # Find the longest prefix of segment.locators that's a suffix
+ # of the existing @loc_ranges. If we find one, drop those
+ # locators (they'll be added back below, when we're handling
+ # the normal/no-overlap case).
+ (1..segment.locators.length).each do |overlap|
+ if @loc_ranges.length >= overlap && @loc_ranges[-overlap..-1].collect(&:locator) == segment.locators[0..overlap-1]
+ (1..overlap).each do
+ discarded = @loc_ranges.pop
+ @loc_range_start -= (discarded.end - discarded.begin)
+ end
+ found_overlap = true
+ break
+ end
end
- end
- def extend_file_specs(filename, segment)
- # Given a filename and a LocatorSegment, add the smallest
- # possible array of file spec strings to @file_specs that
- # builds the file from available locators.
- filename = escape_name(filename)
- start_pos = segment.start_pos
- length = segment.length
- start_loc = segment.locators.first
- prev_loc = start_loc
- # Build a list of file specs by iterating through the segment's
- # locators and preparing a file spec for each contiguous range.
- segment.locators[1..-1].each do |loc_s|
- range = @loc_ranges[loc_s]
- if range.begin != @loc_ranges[prev_loc].end
- range_start, range_length =
- start_and_length_at(start_loc, prev_loc, start_pos, length)
- @file_specs << "#{range_start}:#{range_length}:#{filename}"
- start_pos = 0
- length -= range_length
- start_loc = loc_s
+ # If there was no overlap at the end of our existing
+ # @loc_ranges, check whether the full set of segment.locators
+ # appears earlier in @loc_ranges. If so, use those instead of
+ # appending the same locators again.
+ if !found_overlap && segment.locators.length < @loc_ranges.length
+ segment_start = 0
+ (0.. at loc_ranges.length-1).each do |ri|
+ if @loc_ranges[ri..ri+segment.locators.length-1].collect(&:locator) == segment.locators
+ @file_specs << "#{segment.start_pos + @loc_ranges[ri].begin}:#{segment.length}:#{escape_name(filename)}"
+ return
+ end
end
- prev_loc = loc_s
end
- range_start, range_length =
- start_and_length_at(start_loc, prev_loc, start_pos, length)
- @file_specs << "#{range_start}:#{range_length}:#{filename}"
+
+ segment_start = @loc_range_start
+ segment.locators.each do |loc_s|
+ r = LocatorRange.new(loc_s, @loc_range_start)
+ @loc_ranges << r
+ @loc_range_start = r.end
+ end
+ @file_specs << "#{segment.start_pos + segment_start}:#{segment.length}:#{escape_name(filename)}"
end
def escape_name(name)
@@ -547,12 +549,6 @@ module Arv
s.each_byte.map { |c| "\\%03o" % c }.join("")
end
end
-
- def start_and_length_at(start_key, end_key, start_pos, length)
- range_begin = @loc_ranges[start_key].begin + start_pos
- range_length = [@loc_ranges[end_key].end - range_begin, length].min
- [range_begin, range_length]
- end
end
end
end
diff --git a/sdk/ruby/test/test_collection.rb b/sdk/ruby/test/test_collection.rb
index 288fd263f..197944373 100644
--- a/sdk/ruby/test/test_collection.rb
+++ b/sdk/ruby/test/test_collection.rb
@@ -15,6 +15,10 @@ class CollectionTest < Minitest::Test
"./s1 #{TWO_BY_TWO_BLOCKS.last} 0:5:f1 5:4:f3\n"]
TWO_BY_TWO_MANIFEST_S = TWO_BY_TWO_MANIFEST_A.join("")
+ def abcde_blocks
+ ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa+9", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb+9", "cccccccccccccccccccccccccccccccc+9", "dddddddddddddddddddddddddddddddd+9", "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee+9"]
+ end
+
### .new
def test_empty_construction
@@ -145,12 +149,12 @@ class CollectionTest < Minitest::Test
test_normalization_file_spans_two_whole_blocks("2:3:f1 2:3:f1", 1)
end
- def test_normalization_dedups_locators
+ def test_normalization_handles_duplicate_locator
blocks = random_blocks(2, 5)
coll = Arv::Collection.new(". %s %s 1:8:f1 11:8:f1\n" %
[blocks.join(" "), blocks.reverse.join(" ")])
coll.normalize
- assert_equal(". #{blocks.join(' ')} 1:8:f1 6:4:f1 0:4:f1\n",
+ assert_equal(". #{blocks.join(' ')} #{blocks[0]} 1:8:f1 6:8:f1\n",
coll.manifest_text)
end
@@ -395,6 +399,24 @@ class CollectionTest < Minitest::Test
dst_coll.manifest_text)
end
+ def test_copy_with_repeated_blocks
+ blocks = abcde_blocks
+ src_coll = Arv::Collection.new(". #{blocks[0]} #{blocks[1]} #{blocks[2]} #{blocks[0]} #{blocks[1]} #{blocks[2]} #{blocks[3]} #{blocks[4]} 27:27:f1\n")
+ dst_coll = Arv::Collection.new()
+ dst_coll.cp_r("f1", "./", src_coll)
+ assert_equal(". #{blocks[0]} #{blocks[1]} #{blocks[2]} 0:27:f1\n", dst_coll.manifest_text, "mangled by cp_r")
+ end
+
+ def test_copy_with_repeated_split_blocks
+ blocks = abcde_blocks
+ src_coll = Arv::Collection.new(". #{blocks[0]} #{blocks[1]} #{blocks[2]} #{blocks[0]} #{blocks[1]} #{blocks[2]} #{blocks[3]} #{blocks[4]} 20:27:f1\n")
+ dst_coll = Arv::Collection.new()
+ src_coll.normalize
+ assert_equal(". #{blocks[2]} #{blocks[0]} #{blocks[1]} #{blocks[2]} 2:27:f1\n", src_coll.manifest_text, "mangled by normalize()")
+ dst_coll.cp_r("f1", "./", src_coll)
+ assert_equal(". #{blocks[2]} #{blocks[0]} #{blocks[1]} #{blocks[2]} 2:27:f1\n", dst_coll.manifest_text, "mangled by cp_r")
+ end
+
def test_copy_empty_source_path_raises_ArgumentError(src="", dst="./s1")
coll = Arv::Collection.new(SIMPLEST_MANIFEST)
assert_raises(ArgumentError) do
commit 3f1b10bbaa0aa35a3fc03a4580b5068c68b26633
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Tue Oct 1 10:29:07 2019 -0400
Merge branch '15656-user-delete-container'
refs #15656
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/doc/api/methods/containers.html.textile.liquid b/doc/api/methods/containers.html.textile.liquid
index d59c66edc..5ec95cee6 100644
--- a/doc/api/methods/containers.html.textile.liquid
+++ b/doc/api/methods/containers.html.textile.liquid
@@ -110,7 +110,9 @@ table(table table-bordered table-condensed).
h3. delete
-Delete an existing Container.
+Delete a Container.
+
+This API requires admin privileges. In normal operation, it should not be used at all. API clients like Workbench might not work correctly when a container request references a container that has been deleted.
Arguments:
diff --git a/services/api/app/models/container.rb b/services/api/app/models/container.rb
index 2bbdd0a07..97f2cf1c7 100644
--- a/services/api/app/models/container.rb
+++ b/services/api/app/models/container.rb
@@ -426,6 +426,10 @@ class Container < ArvadosModel
current_user.andand.is_admin
end
+ def permission_to_destroy
+ current_user.andand.is_admin
+ end
+
def ensure_owner_uuid_is_permitted
# validate_change ensures owner_uuid can't be changed at all --
# except during create, which requires admin privileges. Checking
diff --git a/services/api/test/unit/container_test.rb b/services/api/test/unit/container_test.rb
index 88fd5feb6..5f17efc44 100644
--- a/services/api/test/unit/container_test.rb
+++ b/services/api/test/unit/container_test.rb
@@ -980,6 +980,15 @@ class ContainerTest < ActiveSupport::TestCase
end
end
+ test "user cannot delete" do
+ set_user_from_auth :active
+ c, _ = minimal_new
+ assert_raises ArvadosModel::PermissionDeniedError do
+ c.destroy
+ end
+ assert Container.find_by_uuid(c.uuid)
+ end
+
[
{state: Container::Complete, exit_code: 0, output: '1f4b0bc7583c2a7f9102c395f4ffc5e3+45'},
{state: Container::Cancelled},
commit bf6b69741e14f5f700f2afe43a232f8e4ccd7b22
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date: Wed Oct 9 09:31:06 2019 -0400
Merge branch '15655-logtail-encoding'
refs #15655
Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
diff --git a/sdk/cwl/arvados_cwl/done.py b/sdk/cwl/arvados_cwl/done.py
index 9b26ad706..806819afe 100644
--- a/sdk/cwl/arvados_cwl/done.py
+++ b/sdk/cwl/arvados_cwl/done.py
@@ -70,7 +70,7 @@ def logtail(logcollection, logfunc, header, maxlen=25):
logname = log[:-4]
logt = deque([], maxlen)
mergelogs[logname] = logt
- with logcollection.open(log) as f:
+ with logcollection.open(log, encoding="utf-8") as f:
for l in f:
if containersapi:
g = timestamp_re.match(l)
commit 3fececec1fbcb1a71e2dd7de4bc4687df984cdb6
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Fri Jul 26 17:17:26 2019 -0300
Merge branch '15496-wb1-group-membership-admin'
Closes #15496
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/apps/workbench/app/views/users/_show_admin.html.erb b/apps/workbench/app/views/users/_show_admin.html.erb
index 89156aaf8..ddff79be0 100644
--- a/apps/workbench/app/views/users/_show_admin.html.erb
+++ b/apps/workbench/app/views/users/_show_admin.html.erb
@@ -76,7 +76,7 @@ SPDX-License-Identifier: AGPL-3.0 %>
disabled: (group.owner_uuid == @object.uuid),
data: {
permission_head: group.uuid,
- permission_uuid: permitted_group_perms[group.uuid]}) %>
+ permission_uuid: permitted_group_perms[group.uuid] || 'x'}) %>
<small>user→group</small>
</label>
<label class="checkbox-inline" data-toggle-permission="true" data-permission-head="<%= @object.uuid %>" data-permission-name="can_read">
@@ -87,7 +87,7 @@ SPDX-License-Identifier: AGPL-3.0 %>
disabled: (group.owner_uuid == @object.uuid),
data: {
permission_tail: group.uuid,
- permission_uuid: member_group_perms[group.uuid]}) %>
+ permission_uuid: member_group_perms[group.uuid] || 'x'}) %>
<small>group→user</small>
</label>
<label class="checkbox-inline">
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list