Container request priority flag.
[lightning.git] / arvados.go
index 6550a643af2b4a9d5b50beedb6aa1f4cc4d637ee..55d96bde0109500e43efc95f46c0af096912d55a 100644 (file)
@@ -28,6 +28,7 @@ type arvadosContainerRunner struct {
        Prog        string // if empty, run /proc/self/exe
        Args        []string
        Mounts      map[string]map[string]interface{}
+       Priority    int
 }
 
 func (runner *arvadosContainerRunner) Run() (string, error) {
@@ -60,6 +61,10 @@ func (runner *arvadosContainerRunner) Run() (string, error) {
        }
        command := append([]string{prog}, runner.Args...)
 
+       priority := runner.Priority
+       if priority < 1 {
+               priority = 500
+       }
        rc := arvados.RuntimeConstraints{
                VCPUs:        runner.VCPUs,
                RAM:          runner.RAM,
@@ -76,7 +81,7 @@ func (runner *arvadosContainerRunner) Run() (string, error) {
                        "use_existing":        true,
                        "output_path":         "/mnt/output",
                        "runtime_constraints": rc,
-                       "priority":            1,
+                       "priority":            runner.Priority,
                        "state":               arvados.ContainerRequestStateCommitted,
                },
        })