projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
13493: Update CORS OPTIONS test.
[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 22f7d8b6469bfdd65497a18eff738850d94bc1c6..279327ba18811ba8ad6339600cc124460f2fc35c 100644
(file)
--- a/
services/crunch-dispatch-local/crunch-dispatch-local.go
+++ b/
services/crunch-dispatch-local/crunch-dispatch-local.go
@@
-1,3
+1,7
@@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
package main
// Dispatcher service for Crunch that runs containers locally.
package main
// Dispatcher service for Crunch that runs containers locally.
@@
-5,6
+9,7
@@
package main
import (
"context"
"flag"
import (
"context"
"flag"
+ "fmt"
"log"
"os"
"os/exec"
"log"
"os"
"os/exec"
@@
-18,6
+23,8
@@
import (
"git.curoverse.com/arvados.git/sdk/go/dispatch"
)
"git.curoverse.com/arvados.git/sdk/go/dispatch"
)
+var version = "dev"
+
func main() {
err := doMain()
if err != nil {
func main() {
err := doMain()
if err != nil {
@@
-45,9
+52,22
@@
func doMain() error {
"/usr/bin/crunch-run",
"Crunch command to run container")
"/usr/bin/crunch-run",
"Crunch command to run container")
+ getVersion := flags.Bool(
+ "version",
+ false,
+ "Print version information and exit.")
+
// Parse args; omit the first arg which is the command name
flags.Parse(os.Args[1:])
// Parse args; omit the first arg which is the command name
flags.Parse(os.Args[1:])
+ // Print version information if requested
+ if *getVersion {
+ fmt.Printf("crunch-dispatch-local %s\n", version)
+ return nil
+ }
+
+ log.Printf("crunch-dispatch-local %s started", version)
+
runningCmds = make(map[string]*exec.Cmd)
arv, err := arvadosclient.MakeArvadosClient()
runningCmds = make(map[string]*exec.Cmd)
arv, err := arvadosclient.MakeArvadosClient()