X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/fbc6c71ef67461cde5ba914e61f3f3b8740a4045..8ed521f7fd1e48e1e415125745ed8c6627a62c91:/services/crunch-run/crunchrun.go diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go index 5f4de1409f..0b59f7df91 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 }