[ARVADOS] updated: 54819dd75fb929acfab581890dd1c8ee17cccf3e
git at public.curoverse.com
git at public.curoverse.com
Tue Aug 25 14:08:35 EDT 2015
Summary of changes:
.../app/controllers/projects_controller.rb | 6 +++-
apps/workbench/app/views/layouts/body.html.erb | 4 +--
.../app/views/projects/_show_dashboard.html.erb | 17 ++++-----
.../test/controllers/projects_controller_test.rb | 24 +++++--------
doc/_config.yml | 3 --
doc/_includes/_install_git.liquid | 3 ++
doc/install/index.html.textile.liquid | 11 ++----
doc/install/install-api-server.html.textile.liquid | 10 ++++--
.../install-arv-git-httpd.html.textile.liquid | 12 ++++---
.../install-compute-node.html.textile.liquid | 9 +++--
doc/install/install-keepproxy.html.textile.liquid | 38 ++++++++++++--------
sdk/cli/bin/arv-tag | 9 +++--
services/api/lib/salvage_collection.rb | 17 ++++++---
services/api/script/salvage_collection.rb | 7 +---
services/api/test/unit/salvage_collection_test.rb | 42 ++++++++--------------
15 files changed, 110 insertions(+), 102 deletions(-)
create mode 100644 doc/_includes/_install_git.liquid
via 54819dd75fb929acfab581890dd1c8ee17cccf3e (commit)
via 2656de63a9531f23aea840f6cb92e0cdc803599f (commit)
via 2c9b40bdc8acd7fdd906c80e2c7f44abfb720de3 (commit)
via e513251f7b0f6acdc0c0d6df5792c18358030221 (commit)
via b5a7183d43ca4607fdc259267087e7f795d14de2 (commit)
via 9f277b55034436e3a4ed251e4e86ea088adef20e (commit)
via a99c7bb0683175f2e8d365b7439e64a21f6cdb31 (commit)
via 9494d7df964f24d7d8d53a09233d696d4ffcc234 (commit)
via a53d5ecd720cebfe1d81c077996cd2107ed80359 (commit)
via 9f88440df10de6d3d2c2d8b50a802663fec9d0b7 (commit)
via 1cecdfb6fabf47c921e7f422063368621619dcfb (commit)
via f92e43f87f137e00d3e23a2defa5c891da0e8462 (commit)
via ba0bc2f7111c9a783889c29878bf804083248bd2 (commit)
via 77c7b991cfd9eefa42832c14383aa47f4d3ccd8c (commit)
via c62a4ff13d31bf40e8262f4b8b029167fa5e17b0 (commit)
via 6a79f929394e3bf1be12ea892593d13861b65573 (commit)
via 64b5df6b8c744a6a5d7dae5ef57966c9d0cc57f3 (commit)
via 6e5158294c7e19af9031fc43fefc21275e758911 (commit)
via 80d3540193e78a2dfee8373490a0f9e67f9d804a (commit)
via 53ee080ab32335c5b77906fea6c50f7bb9ba837f (commit)
via 748680bc8d517ce69a1fcdcc348b5a72e19e2c7a (commit)
via 590154457cf00df8dc20fcaf2c513b213f59468d (commit)
via 03a84f9276f02e97fe02113c9388652477e3ebbb (commit)
via 21f2d53a70dbf6ae04db07e163f4485e3af47478 (commit)
via 74ea7122c61a81b434e8f258ee104550c2f0b29e (commit)
via 6791c56b529545a191a3e9f714c5493744948ba4 (commit)
via 9a4c7cb68d761329152bf49637c6fd0f8322bbd5 (commit)
via 15696397596dfebd42ebb415772237394ceca978 (commit)
from 647c3bac741b56ce16c7e22ab2d462725a34198d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 54819dd75fb929acfab581890dd1c8ee17cccf3e
Merge: 2656de6 2c9b40b
Author: radhika <radhika at curoverse.com>
Date: Tue Aug 25 14:01:37 2015 -0400
Merge branch 'master' into 6859-fix-invalid-manifests
commit 2656de63a9531f23aea840f6cb92e0cdc803599f
Author: radhika <radhika at curoverse.com>
Date: Tue Aug 25 14:00:35 2015 -0400
6859: script does not catch expections during salvaging; instead they are propagated resulting in exit; update tests.
diff --git a/services/api/lib/salvage_collection.rb b/services/api/lib/salvage_collection.rb
index 9b182cf..3c9b6df 100755
--- a/services/api/lib/salvage_collection.rb
+++ b/services/api/lib/salvage_collection.rb
@@ -10,7 +10,6 @@ module SalvageCollection
# Set portable_data_hash to "d41d8cd98f00b204e9800998ecf8427e+0"
require File.dirname(__FILE__) + '/../config/environment'
- require 'arvados/keep'
include ApplicationHelper
require 'tempfile'
require 'shellwords'
@@ -24,16 +23,26 @@ module SalvageCollection
end
end
+ LOCATOR_REGEXP = /^([[:xdigit:]]{32})(\+(.*))?\z/
def self.salvage_collection_locator_data manifest
# Get all the locators from the original manifest
locators = []
size = 0
manifest.each_line do |line|
line.split(' ').each do |word|
- if match = Keep::Locator::LOCATOR_REGEXP.match(word)
- word = match[1]+match[2] # get rid of any hints
+ if match = LOCATOR_REGEXP.match(word)
+ if match.size > 3 and match[3]
+ size_str = match[3].split('+')[0]
+ if size_str.to_i.to_s == size_str
+ word = match[1] + '+' + size_str # get rid of any hints
+ size += size_str.to_i
+ else
+ word = match[1]
+ end
+ else
+ word = match[1]
+ end
locators << word
- size += match[3].to_i
end
end
end
diff --git a/services/api/script/salvage_collection.rb b/services/api/script/salvage_collection.rb
index 3212d88..b70807b 100755
--- a/services/api/script/salvage_collection.rb
+++ b/services/api/script/salvage_collection.rb
@@ -23,9 +23,4 @@ opts = Trollop::options do
end
# Salvage the collection with the given uuid
-begin
- SalvageCollection.salvage_collection opts.uuid, opts.reason
-rescue => e
- $stderr.puts "Error during arv-put"
- exit 1
-end
+SalvageCollection.salvage_collection opts.uuid, opts.reason
diff --git a/services/api/test/unit/salvage_collection_test.rb b/services/api/test/unit/salvage_collection_test.rb
index 953ce63..4782d01 100644
--- a/services/api/test/unit/salvage_collection_test.rb
+++ b/services/api/test/unit/salvage_collection_test.rb
@@ -64,60 +64,48 @@ class SalvageCollectionMockTest < ActiveSupport::TestCase
end
test "salvage collection with no uuid required argument" do
- raised = false
- begin
+ e = assert_raises RuntimeError do
SalvageCollection.salvage_collection nil
- rescue => e
- assert_equal "Collection UUID is required.", e.message
- raised = true
end
- assert_equal true, raised
end
test "salvage collection with bogus uuid" do
- raised = false
- begin
+ e = assert_raises RuntimeError do
SalvageCollection.salvage_collection 'bogus-uuid'
- rescue => e
- assert_equal "No collection found for bogus-uuid.", e.message
- raised = true
end
- assert_equal true, raised
+ assert_equal "No collection found for bogus-uuid.", e.message
end
test "salvage collection with no env ARVADOS_API_HOST" do
- raised = false
- begin
+ e = assert_raises RuntimeError do
ENV['ARVADOS_API_HOST'] = ''
ENV['ARVADOS_API_TOKEN'] = ''
SalvageCollection.salvage_collection collections('user_agreement').uuid
- rescue => e
- assert_equal "ARVADOS environment variables missing. Please set your admin user credentials as ARVADOS environment variables.", e.message
- raised = true
end
- assert_equal true, raised
+ assert_equal "ARVADOS environment variables missing. Please set your admin user credentials as ARVADOS environment variables.", e.message
end
test "salvage collection with error during arv-put" do
# try to salvage collection while mimicking error during arv-put
- raised = false
- begin
+ e = assert_raises RuntimeError do
SalvageCollection.salvage_collection collections('user_agreement').uuid
- rescue => e
- assert_equal "Error during arv-put", e.message
- raised = true
end
- assert_equal true, raised
+ assert_equal "Error during arv-put", e.message
end
+ # This test has two invalid locators:
+ # 341dabea2bd78ad0d6fc3f5b926b450e+abc
+ # 341dabea2bd78ad0d6fc3f5b926b450e
+ # These locators should be preserved in salvaged_data
test "invalid locators dropped during salvaging" do
- manifest = ". 341dabea2bd78ad0d6fc3f5b926b450e+abc 0:85626:brca2-hg19.fa\n. 341dabea2bd78ad0d6fc3f5b926b450e+1000 0:1000:brca-hg19.fa\n . d7321a918923627c972d8f8080c07d29+2000+A22e0a1d9b9bc85c848379d98bedc64238b0b1532 at 55e076ce 0:2000:brca1-hg19.fa\n"
+ manifest = ". 341dabea2bd78ad0d6fc3f5b926b450e+abc 341dabea2bd78ad0d6fc3f5b926abcdf 0:85626:brca2-hg19.fa\n. 341dabea2bd78ad0d6fc3f5b926b450e+1000 0:1000:brca-hg19.fa\n . d7321a918923627c972d8f8080c07d29+2000+A22e0a1d9b9bc85c848379d98bedc64238b0b1532 at 55e076ce 0:2000:brca1-hg19.fa\n"
# salvage this collection
locator_data = SalvageCollection.salvage_collection_locator_data manifest
-
- assert_equal true, locator_data[0].size.eql?(2)
+ assert_equal true, locator_data[0].size.eql?(4)
assert_equal false, locator_data[0].include?("341dabea2bd78ad0d6fc3f5b926b450e+abc")
+ assert_equal true, locator_data[0].include?("341dabea2bd78ad0d6fc3f5b926b450e")
+ assert_equal true, locator_data[0].include?("341dabea2bd78ad0d6fc3f5b926abcdf")
assert_equal true, locator_data[0].include?("341dabea2bd78ad0d6fc3f5b926b450e+1000")
assert_equal true, locator_data[0].include?("d7321a918923627c972d8f8080c07d29+2000")
assert_equal true, locator_data[1].eql?(1000 + 2000) # size
commit e513251f7b0f6acdc0c0d6df5792c18358030221
Merge: 647c3ba b5a7183
Author: radhika <radhika at curoverse.com>
Date: Tue Aug 25 12:42:40 2015 -0400
Merge branch 'master' into 6859-fix-invalid-manifests
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list