[ARVADOS] updated: 1.1.2-13-g456b1c4

Git user git at public.curoverse.com
Tue Jan 2 14:24:15 EST 2018


Summary of changes:
 build/run-tests.sh                    |  2 +-
 services/crunch-run/crunchrun.go      | 19 +++++++++----------
 services/crunch-run/crunchrun_test.go |  2 +-
 services/crunch-run/logging.go        |  6 ++----
 4 files changed, 13 insertions(+), 16 deletions(-)

       via  456b1c4ef6229c15d80f704647a396da7819139b (commit)
      from  6ac835d8869876955d85a86a4b6d35c12b0d63ac (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 456b1c4ef6229c15d80f704647a396da7819139b
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Tue Jan 2 14:17:16 2018 -0500

    Drop superfluous "node-info" prefix in node-info.txt log file.
    
    No issue #
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/build/run-tests.sh b/build/run-tests.sh
index 7d6cb9e..f6c6e8f 100755
--- a/build/run-tests.sh
+++ b/build/run-tests.sh
@@ -475,7 +475,7 @@ export PERLLIB="$PERLINSTALLBASE/lib/perl5:${PERLLIB:+$PERLLIB}"
 export GOPATH
 mkdir -p "$GOPATH/src/git.curoverse.com"
 rmdir --parents "$GOPATH/src/git.curoverse.com/arvados.git/tmp/GOPATH"
-ln -sfT "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git" \
+ln -snfT "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git" \
     || fatal "symlink failed"
 go get -v github.com/kardianos/govendor \
     || fatal "govendor install failed"
diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index 8fd5801..e5e0ea0 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -664,7 +664,6 @@ type infoCommand struct {
 // purposes.
 func (runner *ContainerRunner) LogNodeInfo() (err error) {
 	w := runner.NewLogWriter("node-info")
-	logger := log.New(w, "node-info", 0)
 
 	commands := []infoCommand{
 		{
@@ -690,17 +689,17 @@ func (runner *ContainerRunner) LogNodeInfo() (err error) {
 	}
 
 	// Run commands with informational output to be logged.
-	var out []byte
 	for _, command := range commands {
-		out, err = exec.Command(command.cmd[0], command.cmd[1:]...).CombinedOutput()
-		if err != nil {
-			return fmt.Errorf("While running command %q: %v",
-				command.cmd, err)
-		}
-		logger.Println(command.label)
-		for _, line := range strings.Split(string(out), "\n") {
-			logger.Println(" ", line)
+		fmt.Fprintln(w, command.label)
+		cmd := exec.Command(command.cmd[0], command.cmd[1:]...)
+		cmd.Stdout = w
+		cmd.Stderr = w
+		if err := cmd.Run(); err != nil {
+			err = fmt.Errorf("While running command %q: %v", command.cmd, err)
+			fmt.Fprintln(w, err)
+			return err
 		}
+		fmt.Fprintln(w, "")
 	}
 
 	err = w.Close()
diff --git a/services/crunch-run/crunchrun_test.go b/services/crunch-run/crunchrun_test.go
index 652b50d..ab7417e 100644
--- a/services/crunch-run/crunchrun_test.go
+++ b/services/crunch-run/crunchrun_test.go
@@ -951,7 +951,7 @@ func (s *TestSuite) testStopContainer(c *C, setup func(cr *ContainerRunner)) {
 
 	c.Check(api.CalledWith("container.log", nil), NotNil)
 	c.Check(api.CalledWith("container.state", "Cancelled"), NotNil)
-	c.Check(strings.HasSuffix(api.Logs["stdout"].String(), "foo\n"), Equals, true)
+	c.Check(api.Logs["stdout"].String(), Matches, "(?ms).*foo\n$")
 }
 
 func (s *TestSuite) TestFullRunSetEnv(c *C) {
diff --git a/services/crunch-run/logging.go b/services/crunch-run/logging.go
index 0083f09..ce0a661 100644
--- a/services/crunch-run/logging.go
+++ b/services/crunch-run/logging.go
@@ -221,7 +221,7 @@ type ArvLogWriter struct {
 	closing                      bool
 }
 
-func (arvlog *ArvLogWriter) Write(p []byte) (n int, err error) {
+func (arvlog *ArvLogWriter) Write(p []byte) (int, error) {
 	// Write to the next writer in the chain (a file in Keep)
 	var err1 error
 	if arvlog.writeCloser != nil {
@@ -230,7 +230,6 @@ func (arvlog *ArvLogWriter) Write(p []byte) (n int, err error) {
 
 	// write to API after checking rate limit
 	now := time.Now()
-	bytesWritten := 0
 
 	if now.After(arvlog.logThrottleResetTime) {
 		// It has been more than throttle_period seconds since the last
@@ -275,7 +274,6 @@ func (arvlog *ArvLogWriter) Write(p []byte) (n int, err error) {
 			"properties":  map[string]string{"text": arvlog.bufToFlush.String()}}}
 		err2 := arvlog.ArvClient.Create("logs", lr, nil)
 
-		bytesWritten = arvlog.bufToFlush.Len()
 		arvlog.bufToFlush = bytes.Buffer{}
 		arvlog.bufFlushedAt = now
 
@@ -284,7 +282,7 @@ func (arvlog *ArvLogWriter) Write(p []byte) (n int, err error) {
 		}
 	}
 
-	return bytesWritten, nil
+	return len(p), nil
 }
 
 // Close the underlying writer

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list