on every go program.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>
sdk/go/blockdigest
sdk/go/streamer
sdk/go/stats
-sdk/go/version
sdk/go/crunchrunner
sdk/cwl
tools/arv-sync-groups
sdk/go/streamer
sdk/go/crunchrunner
sdk/go/stats
- sdk/go/version
lib/crunchstat
services/arv-git-httpd
services/crunchstat
+++ /dev/null
-package version
-
-var (
- // Version will get assigned the release number at compile time
- Version string
-)
-
-// GetVersion returns the release number if it was assigned by the compiler
-// or "dev" otherwise.
-func GetVersion() string {
- if Version != "" {
- return Version
- }
- return "dev"
-}
+++ /dev/null
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: Apache-2.0
-
-package version
-
-import (
- "testing"
-
- . "gopkg.in/check.v1"
-)
-
-// Gocheck boilerplate
-func Test(t *testing.T) {
- TestingT(t)
-}
-
-type TestSuite struct {
-}
-
-var _ = Suite(&TestSuite{})
-
-func (s *TestSuite) TestVersion(c *C) {
- // Default version string when Version is not set
- c.Assert(Version, Equals, "")
- c.Assert(GetVersion(), Equals, "dev")
- // Simulate linker flag setting Version var
- Version = "1.0.0"
- c.Assert(GetVersion(), Equals, "1.0.0")
-}
"git.curoverse.com/arvados.git/sdk/go/arvados"
"git.curoverse.com/arvados.git/sdk/go/config"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
"github.com/coreos/go-systemd/daemon"
)
+var version = "dev"
+
// Server configuration
type Config struct {
Client arvados.Client
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
if _, err := daemon.SdNotify(false, "READY=1"); err != nil {
log.Printf("Error notifying init daemon: %v", err)
}
- log.Printf("arv-git-httpd %q started", arvadosVersion.GetVersion())
+ log.Printf("arv-git-httpd %q started", version)
log.Println("Listening at", srv.Addr)
log.Println("Repository root", theConfig.RepoRoot)
if err := srv.Wait(); err != nil {
"git.curoverse.com/arvados.git/sdk/go/arvados"
"git.curoverse.com/arvados.git/sdk/go/arvadosclient"
"git.curoverse.com/arvados.git/sdk/go/dispatch"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
)
+var version = "dev"
+
func main() {
err := doMain()
if err != nil {
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
- log.Printf("crunch-dispatch-local %q started", arvadosVersion.GetVersion())
+ log.Printf("crunch-dispatch-local %q started", version)
runningCmds = make(map[string]*exec.Cmd)
"git.curoverse.com/arvados.git/sdk/go/arvadosclient"
"git.curoverse.com/arvados.git/sdk/go/config"
"git.curoverse.com/arvados.git/sdk/go/dispatch"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
"github.com/coreos/go-systemd/daemon"
)
+var version = "dev"
+
// Config used by crunch-dispatch-slurm
type Config struct {
Client arvados.Client
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
- log.Printf("crunch-dispatch-slurm %q started", arvadosVersion.GetVersion())
+ log.Printf("crunch-dispatch-slurm %q started", version)
err := readConfig(&theConfig, *configPath)
if err != nil {
"git.curoverse.com/arvados.git/sdk/go/arvadosclient"
"git.curoverse.com/arvados.git/sdk/go/keepclient"
"git.curoverse.com/arvados.git/sdk/go/manifest"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
dockertypes "github.com/docker/docker/api/types"
dockercontainer "github.com/docker/docker/api/types/container"
dockerclient "github.com/docker/docker/client"
)
+var version = "dev"
+
// IArvadosClient is the minimal Arvados API methods used by crunch-run.
type IArvadosClient interface {
Create(resourceType string, parameters arvadosclient.Dict, output interface{}) error
// Run the full container lifecycle.
func (runner *ContainerRunner) Run() (err error) {
- runner.CrunchLog.Printf("crunch-run %q started", arvadosVersion.GetVersion())
+ runner.CrunchLog.Printf("crunch-run %q started", version)
runner.CrunchLog.Printf("Executing container '%s'", runner.Container.UUID)
hostname, hosterr := os.Hostname()
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
- log.Printf("crunch-run %q started", arvadosVersion.GetVersion())
+ log.Printf("crunch-run %q started", version)
containerId := flag.Arg(0)
"time"
"git.curoverse.com/arvados.git/lib/crunchstat"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
)
const MaxLogLine = 1 << 14 // Child stderr lines >16KiB will be split
var (
signalOnDeadPPID int = 15
ppidCheckInterval = time.Second
+ version = "dev"
)
func main() {
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
- reporter.Logger.Printf("crunchstat %q started", arvadosVersion.GetVersion())
+ reporter.Logger.Printf("crunchstat %q started", version)
if reporter.CgroupRoot == "" {
reporter.Logger.Fatal("error: must provide -cgroup-root")
"git.curoverse.com/arvados.git/sdk/go/arvados"
"git.curoverse.com/arvados.git/sdk/go/health"
"git.curoverse.com/arvados.git/sdk/go/httpserver"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
log "github.com/Sirupsen/logrus"
)
+var version = "dev"
+
func main() {
configFile := flag.String("config", arvados.DefaultConfigFile, "`path` to arvados configuration file")
getVersion := flag.Bool("version", false, "Print version information and exit.")
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
log.SetFormatter(&log.JSONFormatter{
TimestampFormat: "2006-01-02T15:04:05.000000000Z07:00",
})
- log.Printf("arvados health %q started", arvadosVersion.GetVersion())
+ log.Printf("arvados health %q started", version)
cfg, err := arvados.GetConfig(*configFile)
if err != nil {
"git.curoverse.com/arvados.git/sdk/go/arvados"
"git.curoverse.com/arvados.git/sdk/go/config"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
)
+var version = "dev"
+
const defaultConfigPath = "/etc/arvados/keep-balance/keep-balance.yml"
// Config specifies site configuration, like API credentials and the
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
log.Fatal(config.DumpAndExit(cfg))
}
- log.Printf("keep-balance %q started", arvadosVersion.GetVersion())
+ log.Printf("keep-balance %q started", version)
if *debugFlag {
debugf = log.Printf
"git.curoverse.com/arvados.git/sdk/go/health"
"git.curoverse.com/arvados.git/sdk/go/httpserver"
"git.curoverse.com/arvados.git/sdk/go/keepclient"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
"golang.org/x/net/webdav"
)
Version string
}{
cacheStats: h.Config.Cache.Stats(),
- Version: arvadosVersion.GetVersion(),
+ Version: version,
}
json.NewEncoder(w).Encode(status)
}
"git.curoverse.com/arvados.git/sdk/go/arvados"
"git.curoverse.com/arvados.git/sdk/go/config"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
"github.com/coreos/go-systemd/daemon"
)
var (
defaultConfigPath = "/etc/arvados/keep-web/keep-web.yml"
+ version = "dev"
)
// Config specifies server configuration.
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
log.Fatal(config.DumpAndExit(cfg))
}
- log.Printf("keep-web %q started", arvadosVersion.GetVersion())
+ log.Printf("keep-web %q started", version)
os.Setenv("ARVADOS_API_HOST", cfg.Client.APIHost)
srv := &server{Config: cfg}
"git.curoverse.com/arvados.git/sdk/go/config"
"git.curoverse.com/arvados.git/sdk/go/health"
"git.curoverse.com/arvados.git/sdk/go/keepclient"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
"github.com/coreos/go-systemd/daemon"
"github.com/ghodss/yaml"
"github.com/gorilla/mux"
)
+var version = "dev"
+
type Config struct {
Client arvados.Client
Listen string
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
log.Fatal(config.DumpAndExit(cfg))
}
- log.Printf("keepproxy %q started", arvadosVersion.GetVersion())
+ log.Printf("keepproxy %q started", version)
arv, err := arvadosclient.New(&cfg.Client)
if err != nil {
"git.curoverse.com/arvados.git/sdk/go/health"
"git.curoverse.com/arvados.git/sdk/go/httpserver"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
log "github.com/Sirupsen/logrus"
)
// populate the given NodeStatus struct with current values.
func (rtr *router) readNodeStatus(st *NodeStatus) {
- st.Version = arvadosVersion.GetVersion()
+ st.Version = version
vols := KeepVM.AllReadable()
if cap(st.Volumes) < len(vols) {
st.Volumes = make([]*volumeStatusEnt, len(vols))
"git.curoverse.com/arvados.git/sdk/go/config"
"git.curoverse.com/arvados.git/sdk/go/httpserver"
"git.curoverse.com/arvados.git/sdk/go/keepclient"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
log "github.com/Sirupsen/logrus"
"github.com/coreos/go-systemd/daemon"
)
+var version = "dev"
+
// A Keep "block" is 64MB.
const BlockSize = 64 * 1024 * 1024
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
log.Fatal(config.DumpAndExit(theConfig))
}
- log.Printf("keepstore %q started", arvadosVersion.GetVersion())
+ log.Printf("keepstore %q started", version)
err = theConfig.Start()
if err != nil {
"git.curoverse.com/arvados.git/sdk/go/config"
"git.curoverse.com/arvados.git/sdk/go/ctxlog"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
)
var logger = ctxlog.FromContext
+var version = "dev"
func main() {
log := logger(nil)
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
return
}
- log.Printf("arvados-ws %q started", arvadosVersion.GetVersion())
+ log.Printf("arvados-ws %q started", version)
log.Info("started")
srv := &server{wsConfig: &cfg}
"git.curoverse.com/arvados.git/sdk/go/ctxlog"
"git.curoverse.com/arvados.git/sdk/go/health"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
"github.com/Sirupsen/logrus"
"golang.org/x/net/websocket"
)
func (rtr *router) Status() interface{} {
return map[string]interface{}{
"Clients": atomic.LoadInt64(&rtr.status.ReqsActive),
- "Version": arvadosVersion.GetVersion(),
+ "Version": version,
}
}
"strings"
"git.curoverse.com/arvados.git/sdk/go/arvados"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
)
+var version = "dev"
+
type resourceList interface {
Len() int
GetItems() []interface{}
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
}
defer f.Close()
- log.Printf("arv-sync-groups %q started. Using %q as users id and parent group UUID %q", arvadosVersion.GetVersion(), cfg.UserID, cfg.ParentGroupUUID)
+ log.Printf("arv-sync-groups %q started. Using %q as users id and parent group UUID %q", version, cfg.UserID, cfg.ParentGroupUUID)
// Get the complete user list to minimize API Server requests
allUsers := make(map[string]arvados.User)
"git.curoverse.com/arvados.git/sdk/go/arvadosclient"
"git.curoverse.com/arvados.git/sdk/go/keepclient"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
)
+var version = "dev"
+
func main() {
err := doMain(os.Args[1:])
if err != nil {
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
"git.curoverse.com/arvados.git/sdk/go/arvadosclient"
"git.curoverse.com/arvados.git/sdk/go/keepclient"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
)
+var version = "dev"
+
// Command line config knobs
var (
BlockSize = flag.Int("block-size", keepclient.BLOCKSIZE, "bytes per read/write op")
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}
- log.Printf("keep-exercise %q started", arvadosVersion.GetVersion())
+ log.Printf("keep-exercise %q started", version)
arv, err := arvadosclient.MakeArvadosClient()
if err != nil {
"git.curoverse.com/arvados.git/sdk/go/arvadosclient"
"git.curoverse.com/arvados.git/sdk/go/keepclient"
- arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
)
+var version = "dev"
+
func main() {
err := doMain()
if err != nil {
// Print version information if requested
if *getVersion {
- fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
+ fmt.Printf("Version: %s\n", version)
os.Exit(0)
}