[ARVADOS] created: 1.3.0-1590-g6b43b14a3
Git user
git at public.curoverse.com
Tue Sep 10 14:08:31 UTC 2019
at 6b43b14a374f217ddf5870c2ed9cd90152d8e6e2 (commit)
commit 6b43b14a374f217ddf5870c2ed9cd90152d8e6e2
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Mon Sep 9 15:37:32 2019 -0400
15499: Create additional unmodified log collection on finalize!
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/services/api/app/models/container_request.rb b/services/api/app/models/container_request.rb
index c412e4b85..7aa82335f 100644
--- a/services/api/app/models/container_request.rb
+++ b/services/api/app/models/container_request.rb
@@ -153,7 +153,25 @@ class ContainerRequest < ArvadosModel
# Finalize the container request after the container has
# finished/cancelled.
def finalize!
- update_collections(container: Container.find_by_uuid(container_uuid))
+ container = Container.find_by_uuid(container_uuid)
+ update_collections(container: container)
+
+ log_col = Collection.where(portable_data_hash: container.log).first
+ if log_col
+ # Need to save collection
+ completed_coll = Collection.new(
+ owner_uuid: self.owner_uuid,
+ name: "Container log for container #{container_uuid}",
+ properties: {
+ 'type' => 'log',
+ 'container_request' => self.uuid,
+ 'container_uuid' => container_uuid,
+ },
+ portable_data_hash: log_col.portable_data_hash,
+ manifest_text: log_col.manifest_text)
+ completed_coll.save_with_unique_name!
+ end
+
update_attributes!(state: Final)
end
@@ -187,6 +205,7 @@ class ContainerRequest < ArvadosModel
end
if out_type == "log"
+ # Copy the log into a merged collection
src = Arv::Collection.new(manifest)
dst = Arv::Collection.new(coll.manifest_text)
dst.cp_r("./", ".", src)
diff --git a/services/api/test/unit/container_request_test.rb b/services/api/test/unit/container_request_test.rb
index 4087a8878..b04bae864 100644
--- a/services/api/test/unit/container_request_test.rb
+++ b/services/api/test/unit/container_request_test.rb
@@ -852,12 +852,18 @@ class ContainerRequestTest < ActiveSupport::TestCase
def run_container(cr)
act_as_system_user do
+ logc = Collection.new(owner_uuid: system_user_uuid,
+ manifest_text: ". ef772b2f28e2c8ca84de45466ed19ee9+7815 0:0:arv-mount.txt\n")
+ logc.save!
+
c = Container.find_by_uuid(cr.container_uuid)
c.update_attributes!(state: Container::Locked)
c.update_attributes!(state: Container::Running)
c.update_attributes!(state: Container::Complete,
exit_code: 0,
- output: '1f4b0bc7583c2a7f9102c395f4ffc5e3+45')
+ output: '1f4b0bc7583c2a7f9102c395f4ffc5e3+45',
+ log: logc.portable_data_hash)
+ logc.destroy
c
end
end
commit 3ee696c6485008044b1a54c351d0035ef485305e
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Fri Sep 6 18:28:39 2019 -0300
15499: Make reuse tests fail to expose the bug.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/services/api/test/unit/container_request_test.rb b/services/api/test/unit/container_request_test.rb
index 2637e7793..4087a8878 100644
--- a/services/api/test/unit/container_request_test.rb
+++ b/services/api/test/unit/container_request_test.rb
@@ -630,6 +630,8 @@ class ContainerRequestTest < ActiveSupport::TestCase
set_user_from_auth :active
cr1 = create_minimal_req!(common_attrs.merge({state: ContainerRequest::Committed,
environment: env1}))
+ run_container(cr1)
+ cr1.reload
if use_existing.nil?
# Testing with use_existing default value
cr2 = create_minimal_req!(common_attrs.merge({state: ContainerRequest::Uncommitted,
@@ -855,8 +857,7 @@ class ContainerRequestTest < ActiveSupport::TestCase
c.update_attributes!(state: Container::Running)
c.update_attributes!(state: Container::Complete,
exit_code: 0,
- output: '1f4b0bc7583c2a7f9102c395f4ffc5e3+45',
- log: 'fa7aeb5140e2848d39b416daeef4ffc5+45')
+ output: '1f4b0bc7583c2a7f9102c395f4ffc5e3+45')
c
end
end
diff --git a/services/login-sync/Gemfile.lock b/services/login-sync/Gemfile.lock
index f0283b611..70b666af8 100644
--- a/services/login-sync/Gemfile.lock
+++ b/services/login-sync/Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- arvados-login-sync (1.4.0.20190709140013)
+ arvados-login-sync (1.4.0.20190729193732)
arvados (~> 1.3.0, >= 1.3.0)
GEM
@@ -60,9 +60,9 @@ GEM
mocha (1.8.0)
metaclass (~> 0.0.1)
multi_json (1.13.1)
- multipart-post (2.0.0)
- os (1.0.0)
- public_suffix (3.0.3)
+ multipart-post (2.1.1)
+ os (1.0.1)
+ public_suffix (3.1.1)
rake (12.3.2)
retriable (1.4.1)
signet (0.11.0)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list