projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
17344: Remove client code setting X-External-Client header.
[arvados.git]
/
services
/
crunch-dispatch-local
/
crunch-dispatch-local.go
diff --git
a/services/crunch-dispatch-local/crunch-dispatch-local.go
b/services/crunch-dispatch-local/crunch-dispatch-local.go
index c9cbdd01fec15ca340d0e9342f8a1e24c42f1942..e45598189107261401930126cc1e04235211b798 100644
(file)
--- a/
services/crunch-dispatch-local/crunch-dispatch-local.go
+++ b/
services/crunch-dispatch-local/crunch-dispatch-local.go
@@
-31,15
+31,15
@@
var (
runningCmds map[string]*exec.Cmd
runningCmdsMutex sync.Mutex
waitGroup sync.WaitGroup
runningCmds map[string]*exec.Cmd
runningCmdsMutex sync.Mutex
waitGroup sync.WaitGroup
- crunchRunCommand
*
string
+ crunchRunCommand string
)
func main() {
)
func main() {
-
l
ogger := logrus.StandardLogger()
+
baseL
ogger := logrus.StandardLogger()
if os.Getenv("DEBUG") != "" {
if os.Getenv("DEBUG") != "" {
-
l
ogger.SetLevel(logrus.DebugLevel)
+
baseL
ogger.SetLevel(logrus.DebugLevel)
}
}
-
l
ogger.Formatter = &logrus.JSONFormatter{
+
baseL
ogger.Formatter = &logrus.JSONFormatter{
TimestampFormat: "2006-01-02T15:04:05.000000000Z07:00",
}
TimestampFormat: "2006-01-02T15:04:05.000000000Z07:00",
}
@@
-50,7
+50,7
@@
func main() {
10,
"Interval in seconds to poll for queued containers")
10,
"Interval in seconds to poll for queued containers")
- crunchRunCommand = flags.String(
+ flags.StringVar(&crunchRunCommand,
"crunch-run-command",
"/usr/bin/crunch-run",
"Crunch command to run container")
"crunch-run-command",
"/usr/bin/crunch-run",
"Crunch command to run container")
@@
-70,7
+70,7
@@
func main() {
return
}
return
}
- loader := config.NewLoader(nil,
l
ogger)
+ loader := config.NewLoader(nil,
baseL
ogger)
cfg, err := loader.Load()
if err != nil {
fmt.Fprintf(os.Stderr, "error loading config: %s\n", err)
cfg, err := loader.Load()
if err != nil {
fmt.Fprintf(os.Stderr, "error loading config: %s\n", err)
@@
-82,6
+82,7
@@
func main() {
os.Exit(1)
}
os.Exit(1)
}
+ logger := baseLogger.WithField("ClusterID", cluster.ClusterID)
logger.Printf("crunch-dispatch-local %s started", version)
runningCmds = make(map[string]*exec.Cmd)
logger.Printf("crunch-dispatch-local %s started", version)
runningCmds = make(map[string]*exec.Cmd)
@@
-101,7
+102,6
@@
func main() {
if client.Insecure {
os.Setenv("ARVADOS_API_HOST_INSECURE", "1")
}
if client.Insecure {
os.Setenv("ARVADOS_API_HOST_INSECURE", "1")
}
- os.Setenv("ARVADOS_EXTERNAL_CLIENT", "")
} else {
logger.Warnf("Client credentials missing from config, so falling back on environment variables (deprecated).")
}
} else {
logger.Warnf("Client credentials missing from config, so falling back on environment variables (deprecated).")
}
@@
-197,7
+197,7
@@
func (lr *LocalRun) run(dispatcher *dispatch.Dispatcher,
waitGroup.Add(1)
defer waitGroup.Done()
waitGroup.Add(1)
defer waitGroup.Done()
- cmd := exec.Command(
*
crunchRunCommand, "--runtime-engine="+lr.cluster.Containers.RuntimeEngine, uuid)
+ cmd := exec.Command(crunchRunCommand, "--runtime-engine="+lr.cluster.Containers.RuntimeEngine, uuid)
cmd.Stdin = nil
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stderr
cmd.Stdin = nil
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stderr
@@
-210,7
+210,7
@@
func (lr *LocalRun) run(dispatcher *dispatch.Dispatcher,
runningCmdsMutex.Lock()
if err := lr.startCmd(container, cmd); err != nil {
runningCmdsMutex.Unlock()
runningCmdsMutex.Lock()
if err := lr.startCmd(container, cmd); err != nil {
runningCmdsMutex.Unlock()
- dispatcher.Logger.Warnf("error starting %q for %s: %s",
*
crunchRunCommand, uuid, err)
+ dispatcher.Logger.Warnf("error starting %q for %s: %s", crunchRunCommand, uuid, err)
dispatcher.UpdateState(uuid, dispatch.Cancelled)
} else {
runningCmds[uuid] = cmd
dispatcher.UpdateState(uuid, dispatch.Cancelled)
} else {
runningCmds[uuid] = cmd
@@
-260,7
+260,7
@@
Finish:
}
if container.State == dispatch.Locked || container.State == dispatch.Running {
dispatcher.Logger.Warnf("after %q process termination, container state for %v is %q; updating it to %q",
}
if container.State == dispatch.Locked || container.State == dispatch.Running {
dispatcher.Logger.Warnf("after %q process termination, container state for %v is %q; updating it to %q",
-
*
crunchRunCommand, uuid, container.State, dispatch.Cancelled)
+ crunchRunCommand, uuid, container.State, dispatch.Cancelled)
dispatcher.UpdateState(uuid, dispatch.Cancelled)
}
dispatcher.UpdateState(uuid, dispatch.Cancelled)
}