[ARVADOS] updated: fdecbc701188e64dc9e539da2dddbbeded709b42
Git user
git at public.curoverse.com
Fri Jan 27 17:04:09 EST 2017
Summary of changes:
services/keep-balance/main.go | 16 ++++++++--------
services/keepproxy/keepproxy.go | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
discards 28a9d0543c7d6f38695d83f63698171df7a5156d (commit)
discards b9aef91effaa4ddeb115579cff4c1a47b09b606c (commit)
discards a61bee32ac9641c957593b9b25a763f3e95d8da1 (commit)
via fdecbc701188e64dc9e539da2dddbbeded709b42 (commit)
via 28aea3c6b1888c00a041992282c95fe595f85005 (commit)
via 436f5c768dbc97135490b6477efd1ff0482a9dda (commit)
via 71229e23918b698caa7c6c8b62b368d4aef2ab85 (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (28a9d0543c7d6f38695d83f63698171df7a5156d)
\
N -- N -- N (fdecbc701188e64dc9e539da2dddbbeded709b42)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit fdecbc701188e64dc9e539da2dddbbeded709b42
Author: Tom Clegg <tom at curoverse.com>
Date: Fri Jan 27 16:46:51 2017 -0500
10690: Fix conflicting uses of "config" name.
diff --git a/services/keep-balance/main.go b/services/keep-balance/main.go
index 7d734cf..04d3e99 100644
--- a/services/keep-balance/main.go
+++ b/services/keep-balance/main.go
@@ -64,7 +64,7 @@ type RunOptions struct {
var debugf = func(string, ...interface{}) {}
func main() {
- var config Config
+ var cfg Config
var runOptions RunOptions
configPath := flag.String("config", defaultConfigPath,
@@ -84,18 +84,18 @@ func main() {
flag.Usage = usage
flag.Parse()
- mustReadConfig(&config, *configPath)
+ mustReadConfig(&cfg, *configPath)
if *serviceListPath != "" {
- mustReadConfig(&config.KeepServiceList, *serviceListPath)
+ mustReadConfig(&cfg.KeepServiceList, *serviceListPath)
}
if *dumpConfig {
- log.Fatal(config.DumpAndExit(theConfig))
+ log.Fatal(config.DumpAndExit(cfg))
}
if *debugFlag {
debugf = log.Printf
- if j, err := json.Marshal(config); err != nil {
+ if j, err := json.Marshal(cfg); err != nil {
log.Fatal(err)
} else {
log.Printf("config is %s", j)
@@ -104,13 +104,13 @@ func main() {
if *dumpFlag {
runOptions.Dumper = log.New(os.Stdout, "", log.LstdFlags)
}
- err := CheckConfig(config, runOptions)
+ err := CheckConfig(cfg, runOptions)
if err != nil {
// (don't run)
} else if runOptions.Once {
- _, err = (&Balancer{}).Run(config, runOptions)
+ _, err = (&Balancer{}).Run(cfg, runOptions)
} else {
- err = RunForever(config, runOptions, nil)
+ err = RunForever(cfg, runOptions, nil)
}
if err != nil {
log.Fatal(err)
commit 28aea3c6b1888c00a041992282c95fe595f85005
Author: Tom Clegg <tom at curoverse.com>
Date: Fri Jan 27 15:45:27 2017 -0500
10690: Fix missing return after exit().
diff --git a/sdk/go/config/dump.go b/sdk/go/config/dump.go
index 30dbb8a..36c50eb 100644
--- a/sdk/go/config/dump.go
+++ b/sdk/go/config/dump.go
@@ -1,6 +1,7 @@
package config
import (
+ "errors"
"os"
"github.com/ghodss/yaml"
@@ -22,4 +23,5 @@ func DumpAndExit(cfg interface{}) error {
return err
}
os.Exit(0)
+ return errors.New("exit failed!?")
}
commit 436f5c768dbc97135490b6477efd1ff0482a9dda
Author: Tom Clegg <tom at curoverse.com>
Date: Fri Jan 27 15:28:36 2017 -0500
10690: De-duplicate dumpConfig.
diff --git a/sdk/go/config/dump.go b/sdk/go/config/dump.go
new file mode 100644
index 0000000..30dbb8a
--- /dev/null
+++ b/sdk/go/config/dump.go
@@ -0,0 +1,25 @@
+package config
+
+import (
+ "os"
+
+ "github.com/ghodss/yaml"
+)
+
+// DumpAndExit writes the given config to stdout as YAML. If an error
+// occurs, that error is returned. Otherwise, the program exits 0.
+//
+// Example:
+//
+// log.Fatal(DumpAndExit(cfg))
+func DumpAndExit(cfg interface{}) error {
+ y, err := yaml.Marshal(cfg)
+ if err != nil {
+ return err
+ }
+ _, err = os.Stdout.Write(y)
+ if err != nil {
+ return err
+ }
+ os.Exit(0)
+}
diff --git a/services/arv-git-httpd/main.go b/services/arv-git-httpd/main.go
index 3ff1557..5b6ae61 100644
--- a/services/arv-git-httpd/main.go
+++ b/services/arv-git-httpd/main.go
@@ -10,7 +10,6 @@ import (
"git.curoverse.com/arvados.git/sdk/go/arvados"
"git.curoverse.com/arvados.git/sdk/go/config"
"github.com/coreos/go-systemd/daemon"
- "github.com/ghodss/yaml"
)
// Server configuration
@@ -66,12 +65,7 @@ func main() {
}
if *dumpConfig {
- y, err := yaml.Marshal(theConfig)
- if err != nil {
- log.Fatal(err)
- }
- os.Stdout.Write(y)
- os.Exit(0)
+ log.Fatal(config.DumpAndExit(theConfig))
}
srv := &server{}
diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
index b62b24b..f1f5d1e 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
@@ -19,7 +19,6 @@ import (
"git.curoverse.com/arvados.git/sdk/go/config"
"git.curoverse.com/arvados.git/sdk/go/dispatch"
"github.com/coreos/go-systemd/daemon"
- "github.com/ghodss/yaml"
)
// Config used by crunch-dispatch-slurm
@@ -96,12 +95,7 @@ func doMain() error {
}
if *dumpConfig {
- y, err := yaml.Marshal(theConfig)
- if err != nil {
- log.Fatal(err)
- }
- os.Stdout.Write(y)
- os.Exit(0)
+ log.Fatal(config.DumpAndExit(theConfig))
}
arv, err := arvadosclient.MakeArvadosClient()
diff --git a/services/keep-balance/main.go b/services/keep-balance/main.go
index 926a0f2..7d734cf 100644
--- a/services/keep-balance/main.go
+++ b/services/keep-balance/main.go
@@ -11,7 +11,6 @@ import (
"git.curoverse.com/arvados.git/sdk/go/arvados"
"git.curoverse.com/arvados.git/sdk/go/config"
- "github.com/ghodss/yaml"
)
const defaultConfigPath = "/etc/arvados/keep-balance/keep-balance.yml"
@@ -91,12 +90,7 @@ func main() {
}
if *dumpConfig {
- y, err := yaml.Marshal(config)
- if err != nil {
- log.Fatal(err)
- }
- os.Stdout.Write(y)
- os.Exit(0)
+ log.Fatal(config.DumpAndExit(theConfig))
}
if *debugFlag {
diff --git a/services/keep-web/main.go b/services/keep-web/main.go
index cd55355..5f4cb50 100644
--- a/services/keep-web/main.go
+++ b/services/keep-web/main.go
@@ -8,7 +8,6 @@ import (
"git.curoverse.com/arvados.git/sdk/go/arvados"
"git.curoverse.com/arvados.git/sdk/go/config"
"github.com/coreos/go-systemd/daemon"
- "github.com/ghodss/yaml"
)
var (
@@ -82,12 +81,7 @@ func main() {
}
if *dumpConfig {
- y, err := yaml.Marshal(cfg)
- if err != nil {
- log.Fatal(err)
- }
- os.Stdout.Write(y)
- os.Exit(0)
+ log.Fatal(config.DumpAndExit(cfg))
}
os.Setenv("ARVADOS_API_HOST", cfg.Client.APIHost)
diff --git a/services/keepproxy/keepproxy.go b/services/keepproxy/keepproxy.go
index 2376284..76a8a15 100644
--- a/services/keepproxy/keepproxy.go
+++ b/services/keepproxy/keepproxy.go
@@ -85,12 +85,7 @@ func main() {
}
if *dumpConfig {
- y, err := yaml.Marshal(cfg)
- if err != nil {
- log.Fatal(err)
- }
- os.Stdout.Write(y)
- os.Exit(0)
+ log.Fatal(config.DumpAndExit(cfg))
}
arv, err := arvadosclient.New(&cfg.Client)
diff --git a/services/keepstore/keepstore.go b/services/keepstore/keepstore.go
index 5414795..9033de8 100644
--- a/services/keepstore/keepstore.go
+++ b/services/keepstore/keepstore.go
@@ -16,7 +16,6 @@ import (
"git.curoverse.com/arvados.git/sdk/go/keepclient"
log "github.com/Sirupsen/logrus"
"github.com/coreos/go-systemd/daemon"
- "github.com/ghodss/yaml"
)
// A Keep "block" is 64MB.
@@ -105,12 +104,7 @@ func main() {
}
if *dumpConfig {
- y, err := yaml.Marshal(theConfig)
- if err != nil {
- log.Fatal(err)
- }
- os.Stdout.Write(y)
- os.Exit(0)
+ log.Fatal(config.DumpAndExit(theConfig))
}
err = theConfig.Start()
commit 71229e23918b698caa7c6c8b62b368d4aef2ab85
Author: Tom Clegg <tom at curoverse.com>
Date: Thu Jan 12 10:33:16 2017 -0500
10690: Add -dump-config to arv-git-httpd, crunch-dispatch-slurm, keep-balance, keep-web, keepproxy.
diff --git a/services/arv-git-httpd/main.go b/services/arv-git-httpd/main.go
index 75645ff..3ff1557 100644
--- a/services/arv-git-httpd/main.go
+++ b/services/arv-git-httpd/main.go
@@ -10,6 +10,7 @@ import (
"git.curoverse.com/arvados.git/sdk/go/arvados"
"git.curoverse.com/arvados.git/sdk/go/config"
"github.com/coreos/go-systemd/daemon"
+ "github.com/ghodss/yaml"
)
// Server configuration
@@ -44,6 +45,7 @@ func main() {
"Value for GITOLITE_HTTP_HOME environment variable. If not empty, GL_BYPASS_ACCESS_CHECKS=1 will also be set."+deprecated)
cfgPath := flag.String("config", defaultCfgPath, "Configuration file `path`.")
+ dumpConfig := flag.Bool("dump-config", false, "write current configuration to stdout and exit (useful for migrating from command line flags to config file)")
flag.Usage = usage
flag.Parse()
@@ -63,6 +65,15 @@ func main() {
}
}
+ if *dumpConfig {
+ y, err := yaml.Marshal(theConfig)
+ if err != nil {
+ log.Fatal(err)
+ }
+ os.Stdout.Write(y)
+ os.Exit(0)
+ }
+
srv := &server{}
if err := srv.Start(); err != nil {
log.Fatal(err)
diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
index e768b50..b62b24b 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
@@ -5,11 +5,6 @@ package main
import (
"flag"
"fmt"
- "git.curoverse.com/arvados.git/sdk/go/arvados"
- "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
- "git.curoverse.com/arvados.git/sdk/go/config"
- "git.curoverse.com/arvados.git/sdk/go/dispatch"
- "github.com/coreos/go-systemd/daemon"
"io"
"io/ioutil"
"log"
@@ -18,6 +13,13 @@ import (
"os/exec"
"strings"
"time"
+
+ "git.curoverse.com/arvados.git/sdk/go/arvados"
+ "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
+ "git.curoverse.com/arvados.git/sdk/go/config"
+ "git.curoverse.com/arvados.git/sdk/go/dispatch"
+ "github.com/coreos/go-systemd/daemon"
+ "github.com/ghodss/yaml"
)
// Config used by crunch-dispatch-slurm
@@ -56,6 +58,10 @@ func doMain() error {
"config",
defaultConfigPath,
"`path` to JSON or YAML configuration file")
+ dumpConfig := flag.Bool(
+ "dump-config",
+ false,
+ "write current configuration to stdout and exit")
// Parse args; omit the first arg which is the command name
flags.Parse(os.Args[1:])
@@ -89,6 +95,15 @@ func doMain() error {
log.Printf("warning: Client credentials missing from config, so falling back on environment variables (deprecated).")
}
+ if *dumpConfig {
+ y, err := yaml.Marshal(theConfig)
+ if err != nil {
+ log.Fatal(err)
+ }
+ os.Stdout.Write(y)
+ os.Exit(0)
+ }
+
arv, err := arvadosclient.MakeArvadosClient()
if err != nil {
log.Printf("Error making Arvados client: %v", err)
diff --git a/services/keep-balance/main.go b/services/keep-balance/main.go
index 310c77a..926a0f2 100644
--- a/services/keep-balance/main.go
+++ b/services/keep-balance/main.go
@@ -11,6 +11,7 @@ import (
"git.curoverse.com/arvados.git/sdk/go/arvados"
"git.curoverse.com/arvados.git/sdk/go/config"
+ "github.com/ghodss/yaml"
)
const defaultConfigPath = "/etc/arvados/keep-balance/keep-balance.yml"
@@ -78,6 +79,7 @@ func main() {
"send pull requests (make more replicas of blocks that are underreplicated or are not in optimal rendezvous probe order)")
flag.BoolVar(&runOptions.CommitTrash, "commit-trash", false,
"send trash requests (delete unreferenced old blocks, and excess replicas of overreplicated blocks)")
+ dumpConfig := flag.Bool("dump-config", false, "write current configuration to stdout and exit")
dumpFlag := flag.Bool("dump", false, "dump details for each block to stdout")
debugFlag := flag.Bool("debug", false, "enable debug messages")
flag.Usage = usage
@@ -88,6 +90,15 @@ func main() {
mustReadConfig(&config.KeepServiceList, *serviceListPath)
}
+ if *dumpConfig {
+ y, err := yaml.Marshal(config)
+ if err != nil {
+ log.Fatal(err)
+ }
+ os.Stdout.Write(y)
+ os.Exit(0)
+ }
+
if *debugFlag {
debugf = log.Printf
if j, err := json.Marshal(config); err != nil {
diff --git a/services/keep-web/main.go b/services/keep-web/main.go
index df8a0b5..cd55355 100644
--- a/services/keep-web/main.go
+++ b/services/keep-web/main.go
@@ -8,6 +8,7 @@ import (
"git.curoverse.com/arvados.git/sdk/go/arvados"
"git.curoverse.com/arvados.git/sdk/go/config"
"github.com/coreos/go-systemd/daemon"
+ "github.com/ghodss/yaml"
)
var (
@@ -62,6 +63,8 @@ func main() {
"Only serve attachments at the given `host:port`"+deprecated)
flag.BoolVar(&cfg.TrustAllContent, "trust-all-content", false,
"Serve non-public content from a single origin. Dangerous: read docs before using!"+deprecated)
+ dumpConfig := flag.Bool("dump-config", false,
+ "write current configuration to stdout and exit")
flag.Usage = usage
flag.Parse()
@@ -78,6 +81,15 @@ func main() {
cfg.AnonymousTokens = []string{os.Getenv("ARVADOS_API_TOKEN")}
}
+ if *dumpConfig {
+ y, err := yaml.Marshal(cfg)
+ if err != nil {
+ log.Fatal(err)
+ }
+ os.Stdout.Write(y)
+ os.Exit(0)
+ }
+
os.Setenv("ARVADOS_API_HOST", cfg.Client.APIHost)
srv := &server{Config: cfg}
if err := srv.Start(); err != nil {
diff --git a/services/keepproxy/keepproxy.go b/services/keepproxy/keepproxy.go
index 24df531..2376284 100644
--- a/services/keepproxy/keepproxy.go
+++ b/services/keepproxy/keepproxy.go
@@ -1,7 +1,6 @@
package main
import (
- "encoding/json"
"errors"
"flag"
"fmt"
@@ -22,6 +21,7 @@ import (
"git.curoverse.com/arvados.git/sdk/go/config"
"git.curoverse.com/arvados.git/sdk/go/keepclient"
"github.com/coreos/go-systemd/daemon"
+ "github.com/ghodss/yaml"
"github.com/gorilla/mux"
)
@@ -62,6 +62,7 @@ func main() {
var cfgPath string
const defaultCfgPath = "/etc/arvados/keepproxy/keepproxy.yml"
flagset.StringVar(&cfgPath, "config", defaultCfgPath, "Configuration file `path`")
+ dumpConfig := flagset.Bool("dump-config", false, "write current configuration to stdout and exit")
flagset.Parse(os.Args[1:])
err := config.LoadFile(cfg, cfgPath)
@@ -77,12 +78,21 @@ func main() {
if regexp.MustCompile("^(?i:1|yes|true)$").MatchString(os.Getenv("ARVADOS_API_HOST_INSECURE")) {
cfg.Client.Insecure = true
}
- if j, err := json.MarshalIndent(cfg, "", " "); err == nil {
- log.Print("Current configuration:\n", string(j))
+ if y, err := yaml.Marshal(cfg); err == nil && !*dumpConfig {
+ log.Print("Current configuration:\n", string(y))
}
cfg.Timeout = arvados.Duration(time.Duration(*timeoutSeconds) * time.Second)
}
+ if *dumpConfig {
+ y, err := yaml.Marshal(cfg)
+ if err != nil {
+ log.Fatal(err)
+ }
+ os.Stdout.Write(y)
+ os.Exit(0)
+ }
+
arv, err := arvadosclient.New(&cfg.Client)
if err != nil {
log.Fatalf("Error setting up arvados client %s", err.Error())
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list