X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b205525d0b7c7b9042513fe77d2e8061534208ae..e3f324c979fe45803e2bd42aa8f6d715ea23edb5:/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go index 30e88bf925..889e41095e 100644 --- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go +++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go @@ -23,8 +23,8 @@ import ( "git.curoverse.com/arvados.git/sdk/go/arvadosclient" "git.curoverse.com/arvados.git/sdk/go/config" "git.curoverse.com/arvados.git/sdk/go/dispatch" - "github.com/Sirupsen/logrus" "github.com/coreos/go-systemd/daemon" + "github.com/sirupsen/logrus" ) type logger interface { @@ -229,12 +229,7 @@ func (disp *Dispatcher) checkSqueueForOrphans() { func (disp *Dispatcher) slurmConstraintArgs(container arvados.Container) []string { mem := int64(math.Ceil(float64(container.RuntimeConstraints.RAM+container.RuntimeConstraints.KeepCacheRAM+disp.ReserveExtraRAM) / float64(1048576))) - var disk int64 - for _, m := range container.Mounts { - if m.Kind == "tmp" { - disk += m.Capacity - } - } + disk := dispatchcloud.EstimateScratchSpace(&container) disk = int64(math.Ceil(float64(disk) / float64(1048576))) return []string{ fmt.Sprintf("--mem=%d", mem), @@ -246,7 +241,7 @@ func (disp *Dispatcher) slurmConstraintArgs(container arvados.Container) []strin func (disp *Dispatcher) sbatchArgs(container arvados.Container) ([]string, error) { var args []string args = append(args, disp.SbatchArguments...) - args = append(args, "--job-name="+container.UUID, fmt.Sprintf("--nice=%d", initialNiceValue)) + args = append(args, "--job-name="+container.UUID, fmt.Sprintf("--nice=%d", initialNiceValue), "--no-requeue") if disp.cluster == nil { // no instance types configured