[arvados] updated: 2.6.0-381-g31779a06b

git repository hosting git at public.arvados.org
Fri Jul 21 23:09:26 UTC 2023


Summary of changes:
 lib/crunchrun/crunchrun.go | 12 ++++++++++--
 lib/crunchrun/docker.go    |  2 +-
 lib/crunchrun/executor.go  |  5 ++---
 3 files changed, 13 insertions(+), 6 deletions(-)

       via  31779a06b28e21a9409ec7c6310f0871b65d13ff (commit)
      from  c1eec87832f8a01ecb4dc9747079bb5db9ac588e (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 31779a06b28e21a9409ec7c6310f0871b65d13ff
Author: Tom Clegg <tom at curii.com>
Date:   Fri Jul 21 19:05:33 2023 -0400

    17244: Use crunch-run's cgroup, not init's, for "host" stats.
    
    This gets much closer to "everything on the host" with minimal
    effort.
    
    Tracking the furthest ancestor of crunch-run's cgroup might be even
    better, but will require additional support in crunchstat.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/crunchrun/crunchrun.go b/lib/crunchrun/crunchrun.go
index 1c0cf621d..9add35335 100644
--- a/lib/crunchrun/crunchrun.go
+++ b/lib/crunchrun/crunchrun.go
@@ -742,8 +742,16 @@ func (runner *ContainerRunner) startHoststat() error {
 	}
 	runner.hoststatLogger = NewThrottledLogger(w)
 	runner.hoststatReporter = &crunchstat.Reporter{
-		Logger:     log.New(runner.hoststatLogger, "", 0),
-		Pid:        func() int { return 1 },
+		Logger: log.New(runner.hoststatLogger, "", 0),
+		// Our own cgroup is the "host" cgroup, in the sense
+		// that it accounts for resource usage outside the
+		// container. It doesn't count _all_ resource usage on
+		// the system.
+		//
+		// TODO?: Use the furthest ancestor of our own cgroup
+		// that has stats available. (Currently crunchstat
+		// does not have that capability.)
+		Pid:        os.Getpid,
 		PollPeriod: runner.statInterval,
 	}
 	runner.hoststatReporter.Start()
diff --git a/lib/crunchrun/docker.go b/lib/crunchrun/docker.go
index 4adc680d9..1fd8c4fd2 100644
--- a/lib/crunchrun/docker.go
+++ b/lib/crunchrun/docker.go
@@ -202,7 +202,7 @@ func (e *dockerExecutor) Pid() int {
 	if err != nil && ctr.State != nil {
 		return ctr.State.Pid
 	} else {
-		return -1
+		return 0
 	}
 }
 
diff --git a/lib/crunchrun/executor.go b/lib/crunchrun/executor.go
index 29abab631..308b05cde 100644
--- a/lib/crunchrun/executor.go
+++ b/lib/crunchrun/executor.go
@@ -51,9 +51,8 @@ type containerExecutor interface {
 	// Start the container
 	Start() error
 
-	// Process ID of a process in the container (return 0 or
-	// negative if container is finished or no process has started
-	// yet)
+	// Process ID of a process in the container.  Return 0 if
+	// container is finished or no process has started yet.
 	Pid() int
 
 	// Stop the container immediately

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list