[ARVADOS] updated: 2.1.0-1523-g14d292e23

Git user git at public.arvados.org
Mon Oct 25 14:22:13 UTC 2021


Summary of changes:
 lib/lsf/dispatch.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

  discards  c529a77e2ba2d38db729125601c774d61b35158f (commit)
       via  14d292e230a93ea9cb939fa259b457bbea3f9c0c (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (c529a77e2ba2d38db729125601c774d61b35158f)
            \
             N -- N -- N (14d292e230a93ea9cb939fa259b457bbea3f9c0c)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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 14d292e230a93ea9cb939fa259b457bbea3f9c0c
Author: Ward Vandewege <ward at jhvc.com>
Date:   Mon Oct 25 10:15:21 2021 -0400

    18290: address review comments.
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/lib/config/config.default.yml b/lib/config/config.default.yml
index 8b51a85d9..52e35d83f 100644
--- a/lib/config/config.default.yml
+++ b/lib/config/config.default.yml
@@ -1026,7 +1026,7 @@ Clusters:
         # Template variables starting with % will be substituted as follows:
         #
         # %U uuid
-        # %C number of cpus
+        # %C number of VCPUs
         # %M memory in MB
         # %T tmp in MB
         #
diff --git a/lib/lsf/dispatch.go b/lib/lsf/dispatch.go
index d17c458e8..6e35b7de9 100644
--- a/lib/lsf/dispatch.go
+++ b/lib/lsf/dispatch.go
@@ -270,9 +270,7 @@ func (disp *dispatcher) bkill(ctr arvados.Container) {
 }
 
 func (disp *dispatcher) bsubArgs(container arvados.Container) ([]string, error) {
-	tmpArgs := []string{}
 	args := []string{"bsub"}
-	tmpArgs = append(tmpArgs, disp.Cluster.Containers.LSF.BsubArgumentsList...)
 
 	tmp := int64(math.Ceil(float64(dispatchcloud.EstimateScratchSpace(&container)) / 1048576))
 	vcpus := container.RuntimeConstraints.VCPUs
@@ -280,16 +278,27 @@ func (disp *dispatcher) bsubArgs(container arvados.Container) ([]string, error)
 		container.RuntimeConstraints.KeepCacheRAM+
 		int64(disp.Cluster.Containers.ReserveExtraRAM)) / 1048576))
 
-	r := regexp.MustCompile(`([^%]|^)%([^%])`)
-	undoubleRE := regexp.MustCompile(`%%`)
-	for _, a := range tmpArgs {
-		tmp := r.ReplaceAllStringFunc(a, func(m string) string {
-			parts := r.FindStringSubmatch(m)
-			return parts[1] + disp.substitute(parts[2], container.UUID, vcpus, mem, tmp)
-		})
-		// handle escaped literal % symbols
-		tmp = undoubleRE.ReplaceAllString(tmp, "%")
-		args = append(args, tmp)
+	repl := map[string]string{
+		"%%": "%",
+		"%C": fmt.Sprintf("%d", vcpus),
+		"%M": fmt.Sprintf("%d", mem),
+		"%T": fmt.Sprintf("%d", tmp),
+		"%U": container.UUID,
+	}
+
+	re := regexp.MustCompile(`%.`)
+	var substitutionErrors string
+	for _, a := range disp.Cluster.Containers.LSF.BsubArgumentsList {
+		args = append(args, re.ReplaceAllStringFunc(a, func(s string) string {
+			subst := repl[s]
+			if len(subst) == 0 {
+				substitutionErrors += fmt.Sprintf("Unknown substitution parameter %s in BsubArgumentsList, ", s)
+			}
+			return subst
+		}))
+	}
+	if len(substitutionErrors) != 0 {
+		return nil, fmt.Errorf("%s", substitutionErrors[:len(substitutionErrors)-2])
 	}
 
 	if u := disp.Cluster.Containers.LSF.BsubSudoUser; u != "" {
@@ -298,23 +307,6 @@ func (disp *dispatcher) bsubArgs(container arvados.Container) ([]string, error)
 	return args, nil
 }
 
-func (disp *dispatcher) substitute(l string, uuid string, vcpus int, mem, tmp int64) string {
-	var arg string
-	switch l {
-	case "C":
-		arg = fmt.Sprintf("%d", vcpus)
-	case "T":
-		arg = fmt.Sprintf("%d", tmp)
-	case "M":
-		arg = fmt.Sprintf("%d", mem)
-	case "U":
-		arg = uuid
-	default:
-		arg = "%" + l
-	}
-	return arg
-}
-
 // Check the next bjobs report, and invoke TrackContainer for all the
 // containers in the report. This gives us a chance to cancel existing
 // Arvados LSF jobs (started by a previous dispatch process) that

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list