[ARVADOS] created: 3c5183b3a2b895e238b0e824a684787a56c155b4
Git user
git at public.curoverse.com
Fri Aug 5 11:44:41 EDT 2016
at 3c5183b3a2b895e238b0e824a684787a56c155b4 (commit)
commit 3c5183b3a2b895e238b0e824a684787a56c155b4
Author: Tom Clegg <tom at curoverse.com>
Date: Fri Aug 5 11:44:29 2016 -0400
9745: Load API host and token from crunch-dispatch-slurm config file.
diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
index b11963c..1d9015d 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
@@ -21,6 +21,8 @@ import (
// Config used by crunch-dispatch-slurm
type Config struct {
+ arvados.Client
+
SbatchArguments []string
PollPeriod arvados.Duration
@@ -71,6 +73,22 @@ func doMain() error {
config.PollPeriod = arvados.Duration(10 * time.Second)
}
+ if config.Client.APIHost != "" || config.Client.AuthToken != "" {
+ // Copy real configs into env vars so [a]
+ // MakeArvadosClient() uses them, and [b] they get
+ // propagated to crunch-run via SLURM.
+ os.Setenv("ARVADOS_API_HOST", config.Client.APIHost)
+ os.Setenv("ARVADOS_API_TOKEN", config.Client.AuthToken)
+ os.Setenv("ARVADOS_API_INSECURE", "")
+ if config.Client.Insecure {
+ os.Setenv("ARVADOS_API_INSECURE", "1")
+ }
+ os.Setenv("ARVADOS_KEEP_SERVICES", "")
+ os.Setenv("ARVADOS_EXTERNAL_CLIENT", "")
+ } else {
+ log.Printf("warning: Client credentials missing from config, so falling back on environment variables (deprecated).")
+ }
+
arv, err := arvadosclient.MakeArvadosClient()
if err != nil {
log.Printf("Error making Arvados client: %v", err)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list