SLURM:
PrioritySpread: 0
SbatchArgumentsList: []
+ KeepServices:
+ SAMPLE:
+ InternalURLs: {}
Managed:
# Path to dns server configuration directory
# (e.g. /etc/unbound.d/conf.d). If false, do not write any config
import (
"fmt"
"io/ioutil"
+ "net/url"
"os"
"strings"
cluster.SystemRootToken = client.AuthToken
}
cluster.TLS.Insecure = client.Insecure
+ for _, r := range client.KeepServiceURIs {
+ if cluster.Containers.SLURM.KeepServices == nil {
+ cluster.Containers.SLURM.KeepServices = make(map[string]arvados.Service)
+ }
+ if cluster.Containers.SLURM.KeepServices["00000-bi6l4-000000000000000"].InternalURLs == nil {
+ cluster.Containers.SLURM.KeepServices["00000-bi6l4-000000000000000"].InternalURLs = map[arvados.URL]arvados.ServiceInstance{}
+ }
+ p, err := url.Parse(r)
+ cluster.Containers.SLURM.KeepServices["00000-bi6l4-000000000000000"].InternalURLs[arvados.URL(p)] = struct{}{}
+ }
}
// update config using values from an crunch-dispatch-slurm config file.
SLURM struct {
PrioritySpread int64
SbatchArgumentsList []string
+ KeepServices map[string]Service
Managed struct {
DNSServerConfDir string
DNSServerConfTemplate string
if disp.Client.Insecure {
os.Setenv("ARVADOS_API_HOST_INSECURE", "1")
}
- os.Setenv("ARVADOS_KEEP_SERVICES", strings.Join(disp.Client.KeepServiceURIs, " "))
+ ks := ""
+ if length(disp.cluster.Containers.SLURM.KeepServices) > 0 {
+ for _, svc := range disp.cluster.Containers.SLURM.KeepServices {
+ for k, _ := range svc.InternalURLs {
+ ks += k
+ ks += " "
+ }
+ }
+ }
+ os.Setenv("ARVADOS_KEEP_SERVICES", ks)
os.Setenv("ARVADOS_EXTERNAL_CLIENT", "")
} else {
disp.logger.Warnf("Client credentials missing from config, so falling back on environment variables (deprecated).")
Client:
APIHost: example.com
AuthToken: abcdefg
+ KeepServices:
+ - https://example.com/keep
SbatchArguments: ["--foo", "bar"]
PollPeriod: 12s
PrioritySpread: 42
c.Check(s.disp.cluster.Containers.ReserveExtraRAM, Equals, arvados.ByteSize(12345))
c.Check(s.disp.cluster.Containers.MinRetryPeriod, Equals, arvados.Duration(13*time.Second))
c.Check(s.disp.cluster.API.MaxItemsPerResponse, Equals, 99)
+ c.Check(s.disp.cluster.Containers.SLURM.KeepServices, DeepEquals, map[string]Service{
+ "00000-bi6l4-000000000000000": Service{
+ InternalURLs: map[string]struct{}{
+ "https://example.com/keep": struct{}{},
+ },
+ },
+ })
}