X-Git-Url: https://git.arvados.org/lightning.git/blobdiff_plain/1b6d32146cfdbf4c5befbfc5ddd1651d6c63c735..79e0bd0ff72ae1759e8b780e5d8b61b09c9a0399:/arvados.go diff --git a/arvados.go b/arvados.go index d4dcf7819e..e2932a00d2 100644 --- a/arvados.go +++ b/arvados.go @@ -268,7 +268,7 @@ func (runner *arvadosContainerRunner) RunContext(ctx context.Context) (string, e "priority": runner.Priority, "state": arvados.ContainerRequestStateCommitted, "scheduling_parameters": arvados.SchedulingParameters{ - Preemptible: true, + Preemptible: false, Partitions: []string{}, }, "environment": map[string]string{ @@ -392,16 +392,20 @@ func (runner *arvadosContainerRunner) TranslatePaths(paths ...*string) error { if m == nil { return fmt.Errorf("cannot find uuid in path: %q", *path) } - uuid := m[2] - mnt, ok := runner.Mounts["/mnt/"+uuid] + collID := m[2] + mnt, ok := runner.Mounts["/mnt/"+collID] if !ok { mnt = map[string]interface{}{ "kind": "collection", - "uuid": uuid, } - runner.Mounts["/mnt/"+uuid] = mnt + if len(collID) == 27 { + mnt["uuid"] = collID + } else { + mnt["portable_data_hash"] = collID + } + runner.Mounts["/mnt/"+collID] = mnt } - *path = "/mnt/" + uuid + m[3] + *path = "/mnt/" + collID + m[3] } return nil } @@ -532,11 +536,8 @@ func open(fnm string) (file, error) { if m == nil { return os.Open(fnm) } - uuid := m[2] - mnt := "/mnt/" + uuid - if fnm != mnt && !strings.HasPrefix(fnm, mnt+"/") { - return os.Open(fnm) - } + collectionUUID := m[2] + collectionPath := m[3] siteFSMtx.Lock() defer siteFSMtx.Unlock() @@ -556,8 +557,8 @@ func open(fnm string) (file, error) { keepClient.BlockCache.MaxBlocks += 2 } - log.Infof("reading %q from %s using Arvados client", fnm[len(mnt):], uuid) - f, err := siteFS.Open("by_id/" + uuid + fnm[len(mnt):]) + log.Infof("reading %q from %s using Arvados client", collectionPath, collectionUUID) + f, err := siteFS.Open("by_id/" + collectionUUID + collectionPath) if err != nil { return nil, err }