[ARVADOS] created: 72873affa7f249faa16d5d21200e935d27aea911
Git user
git at public.curoverse.com
Thu Feb 16 13:14:33 EST 2017
at 72873affa7f249faa16d5d21200e935d27aea911 (commit)
commit 72873affa7f249faa16d5d21200e935d27aea911
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Feb 16 12:51:38 2017 -0500
9277: Include trashed collections when creating copy collection for container
request.
diff --git a/services/api/app/models/container_request.rb b/services/api/app/models/container_request.rb
index 6122c34..b8cadb2 100644
--- a/services/api/app/models/container_request.rb
+++ b/services/api/app/models/container_request.rb
@@ -96,7 +96,7 @@ class ContainerRequest < ArvadosModel
else
coll_name = "Container #{out_type} for request #{uuid}"
end
- manifest = Collection.where(portable_data_hash: pdh).first.manifest_text
+ manifest = Collection.unscoped.where(portable_data_hash: pdh).first.manifest_text
begin
coll = Collection.create!(owner_uuid: owner_uuid,
manifest_text: manifest,
commit 2d80bb7d83bda777181542afcb0b7293cb53eefd
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Feb 16 12:00:30 2017 -0500
9277: crunch-run Log and output collections set is_trashed to true instead of
setting trash_at.
diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index 5f4de14..0b59f7d 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -95,7 +95,6 @@ type ContainerRunner struct {
SigChan chan os.Signal
ArvMountExit chan error
finalState string
- trashLifetime time.Duration
statLogger io.WriteCloser
statReporter *crunchstat.Reporter
@@ -708,7 +707,7 @@ func (runner *ContainerRunner) CaptureOutput() error {
err = runner.ArvClient.Create("collections",
arvadosclient.Dict{
"collection": arvadosclient.Dict{
- "trash_at": time.Now().Add(runner.trashLifetime).Format(time.RFC3339),
+ "is_trashed": true,
"name": "output for " + runner.Container.UUID,
"manifest_text": manifestText}},
&response)
@@ -760,14 +759,6 @@ func (runner *ContainerRunner) getCollectionManifestForPath(mnt arvados.Mount, b
return extracted.Text, nil
}
-func (runner *ContainerRunner) loadDiscoveryVars() {
- tl, err := runner.ArvClient.Discovery("defaultTrashLifetime")
- if err != nil {
- log.Fatalf("getting defaultTrashLifetime from discovery document: %s", err)
- }
- runner.trashLifetime = time.Duration(tl.(float64)) * time.Second
-}
-
func (runner *ContainerRunner) CleanupDirs() {
if runner.ArvMount != nil {
umount := exec.Command("fusermount", "-z", "-u", runner.ArvMountPoint)
@@ -820,7 +811,7 @@ func (runner *ContainerRunner) CommitLogs() error {
err = runner.ArvClient.Create("collections",
arvadosclient.Dict{
"collection": arvadosclient.Dict{
- "trash_at": time.Now().Add(runner.trashLifetime).Format(time.RFC3339),
+ "is_trashed": true,
"name": "logs for " + runner.Container.UUID,
"manifest_text": mt}},
&response)
@@ -1015,7 +1006,6 @@ func NewContainerRunner(api IArvadosClient,
cr.Container.UUID = containerUUID
cr.CrunchLog = NewThrottledLogger(cr.NewLogWriter("crunch-run"))
cr.CrunchLog.Immediate = log.New(os.Stderr, containerUUID+" ", 0)
- cr.loadDiscoveryVars()
return cr
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list