[ARVADOS] updated: 1.1.2-157-g23baab3
Git user
git at public.curoverse.com
Thu Feb 1 11:02:36 EST 2018
Summary of changes:
services/crunch-run/crunchrun.go | 45 ++++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 23 deletions(-)
via 23baab324564d36322b265c7fd904a0b4548c195 (commit)
via 03c82ef2950a25085e8d8ec0dc5d261fa1ca7963 (commit)
from 2eb85f70168d331e49e9d38bfbd2292d586dfcc1 (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 23baab324564d36322b265c7fd904a0b4548c195
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Thu Feb 1 10:59:53 2018 -0500
12764: Explicitly set desired permissions on copied files/dirs
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index 63697b6..3230ca9 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -584,10 +584,19 @@ func (runner *ContainerRunner) SetupMounts() (err error) {
if walkerr != nil {
return walkerr
}
+ target := path.Join(cp.bind, walkpath[len(cp.src):])
if walkinfo.Mode().IsRegular() {
- return copyfile(walkpath, path.Join(cp.bind, walkpath[len(cp.src):]))
+ copyerr := copyfile(walkpath, target)
+ if copyerr != nil {
+ return copyerr
+ }
+ return os.Chmod(target, walkinfo.Mode()|0777)
} else if walkinfo.Mode().IsDir() {
- return os.MkdirAll(path.Join(cp.bind, walkpath[len(cp.src):]), 0777)
+ mkerr := os.MkdirAll(target, 0777)
+ if mkerr != nil {
+ return mkerr
+ }
+ return os.Chmod(target, walkinfo.Mode()|os.ModeSetgid|0777)
} else {
return fmt.Errorf("Source %q is not a regular file or directory", cp.src)
}
commit 03c82ef2950a25085e8d8ec0dc5d261fa1ca7963
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Wed Jan 31 16:59:50 2018 -0500
12764: Remove CleanupTempDir. Better name for parent temp.
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index 8d93560..63697b6 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -103,17 +103,16 @@ type ContainerRunner struct {
LogsPDH *string
RunArvMount
MkTempDir
- ArvMount *exec.Cmd
- ArvMountPoint string
- HostOutputDir string
- CleanupTempDir []string
- Binds []string
- Volumes map[string]struct{}
- OutputPDH *string
- SigChan chan os.Signal
- ArvMountExit chan error
- finalState string
- parentTemp string
+ ArvMount *exec.Cmd
+ ArvMountPoint string
+ HostOutputDir string
+ Binds []string
+ Volumes map[string]struct{}
+ OutputPDH *string
+ SigChan chan os.Signal
+ ArvMountExit chan error
+ finalState string
+ parentTemp string
statLogger io.WriteCloser
statReporter *crunchstat.Reporter
@@ -503,7 +502,6 @@ func (runner *ContainerRunner) SetupMounts() (err error) {
if staterr != nil {
return fmt.Errorf("While Chmod temp dir: %v", err)
}
- runner.CleanupTempDir = append(runner.CleanupTempDir, tmpdir)
runner.Binds = append(runner.Binds, fmt.Sprintf("%s:%s", tmpdir, bind))
if bind == runner.Container.OutputPath {
runner.HostOutputDir = tmpdir
@@ -523,7 +521,6 @@ func (runner *ContainerRunner) SetupMounts() (err error) {
if err != nil {
return fmt.Errorf("creating temp dir: %v", err)
}
- runner.CleanupTempDir = append(runner.CleanupTempDir, tmpdir)
tmpfn := filepath.Join(tmpdir, "mountdata.json")
err = ioutil.WriteFile(tmpfn, jsondata, 0644)
if err != nil {
@@ -536,7 +533,6 @@ func (runner *ContainerRunner) SetupMounts() (err error) {
if err != nil {
return fmt.Errorf("creating temp dir: %v", err)
}
- runner.CleanupTempDir = append(runner.CleanupTempDir, tmpdir)
err = gitMount(mnt).extractTree(runner.ArvClient, tmpdir, token)
if err != nil {
return err
@@ -1428,12 +1424,6 @@ func (runner *ContainerRunner) CleanupDirs() {
}
}
- for _, tmpdir := range runner.CleanupTempDir {
- if rmerr := os.RemoveAll(tmpdir); rmerr != nil {
- runner.CrunchLog.Printf("While cleaning up temporary directory %s: %v", tmpdir, rmerr)
- }
- }
-
if rmerr := os.RemoveAll(runner.parentTemp); rmerr != nil {
runner.CrunchLog.Printf("While cleaning up temporary directory %s: %v", runner.parentTemp, rmerr)
}
@@ -1774,7 +1764,7 @@ func main() {
os.Exit(1)
}
- parentTemp, tmperr := cr.MkTempDir("", "crunch-run")
+ parentTemp, tmperr := cr.MkTempDir("", "crunch-run."+containerId+".")
if tmperr != nil {
log.Fatalf("%s: %v", containerId, tmperr)
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list