Feature #10666
closedAll Arvados components should report their version
Description
arvados-prog
via
arvados-prog -version
curl http://.../status.json | jq -r .Version
grep "started" .../log/main/current
Updated by Tom Morris over 7 years ago
- Target version set to Arvados Future Sprints
Updated by Tom Morris about 7 years ago
- Subject changed from Packaged go binaries should report their own version numbers to All Arvados components should report their version
This isn't specific to Go programs. I thought we'd already decided that all programs should return their version numbers (although I think we said --version, not -version).
Besides crunch-dispatch-slurm, what other components are we missing?
Updated by Tom Morris about 7 years ago
- Target version changed from Arvados Future Sprints to 2017-11-08 Sprint
Updated by Nico César about 7 years ago
+1
is hard to tell from the logs if deploys are using the correct version
Updated by Tom Clegg about 7 years ago
- Assigned To deleted (
Tom Clegg) - Target version changed from 2017-11-08 Sprint to 2017-11-22 Sprint
Updated by Lucas Di Pentima about 7 years ago
- Status changed from New to In Progress
Updated by Lucas Di Pentima about 7 years ago
- Target version changed from 2017-11-22 Sprint to 2017-12-06 Sprint
Updated by Peter Amstutz about 7 years ago
For crunch-run, can we please also log the version number either to either the "crunch-run" (cr.CrunchLog) or "node-info" (LogNodeInfo()) logger?
Updated by Lucas Di Pentima about 7 years ago
Updates at 7209d0ade - branch 10666-report-version
Test run: https://ci.curoverse.com/job/developer-run-tests/520/
Added a version package to Go SDK holding a variable that can be assigned the version number from the linker flags (taken from https://medium.com/@joshroppo/setting-go-1-5-variables-at-compile-time-for-versioning-5b30a965d33e)
Added a --version
param and version logging to the following go programs:
- Tools
- arv-sync-groups
- keep-block-check
- keep-exercise
- keep-rsync
- Services
- arv-git-httpd
- crunch-dispatch-local
- crunch-dispatch-slurm
- arvados-health
- keep-balance
- crunchstat
- crunch-run
- keep-web
- keepproxy
- keepstore
- arvados-ws
There are some services that should also be reporting their version on their /status.json
endpoint (pending)
Updated by Lucas Di Pentima about 7 years ago
Updates at 60a60a176
Test run: https://ci.curoverse.com/job/developer-run-tests/521/
/status.json
endpoint on the following services:
- keepstore
- keep-web
- ws
Also added corresponding tests.
Updated by Tom Clegg about 7 years ago
Isn't the version package superfluous? Seems like adding
var version = "dev"
to each program would achieve the same thing with less code...?
I suppose package_go_binary() in source:build/run-library.sh needs to learn how to pass the appropriate flags to go get, in order for this to be effective? Something like
go get -ldflags "-X main.version=${version}" "git.curoverse.com/arvados.git/$src_path"
Updated by Tom Clegg about 7 years ago
$ cat <<EOF >main.go package main import "fmt" var version="foo" func main(){ fmt.Println(version) } EOF $ go run main.go foo $ go run -ldflags "-X main.version=bar" main.go bar
Updated by Lucas Di Pentima about 7 years ago
Updates at 92656b214
Test run: https://ci.curoverse.com/job/developer-run-tests/523/
Removed the version
package, replaced it with version
var on every program.
Updated by Lucas Di Pentima about 7 years ago
Updates at c24ca3f71
Test run: https://ci.curoverse.com/job/developer-run-tests/524/
Add version information to arv-mount startup logging, and nodemanager logging & /status.json
endpoint.
Updated by Tom Clegg about 7 years ago
Suggest %s rather than %q when logging version numbers at startup (hopefully we won't have version numbers that need quoting, right?)
"arvados health %q started" → "arvados-health %s started"
Should probably change the "--version" output from "Version: 1.2.3" → "arvados-health 1.2.3".
In arvados-ws the existing "started" log is now superfluous and should be removed.
log.Printf("arvados-ws %q started", version) log.Info("started")
When you're in func main(), os.Exit(0) can also be written as "return", which might be a better habit since it runs any deferred statements on the way out.
Updated by Lucas Di Pentima about 7 years ago
Updates at 0c3b77f800
Test run: https://ci.curoverse.com/job/developer-run-tests/526/
Addressed comments from note-18, and also updated the build script to pass the version as linker flags on go programs.
Started to work on passing the version info to api & workbench but realized both already have that feature.
Updated by Tom Clegg about 7 years ago
Looks like the bits in "tools" dir didn't get updated from "Version: X" to "progname: X": arv-sync-groups, keep-block-check, etc.
with that, LGTM
Updated by Lucas Di Pentima about 7 years ago
Updates at 0c888bcc93b559339c8abbce784bdcc44746bca2
Test run: https://ci.curoverse.com/job/developer-run-tests/528/
Fixed missing tools && merged master. Will merge after a successful test run.
Updated by Anonymous about 7 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Applied in changeset arvados|d7db1f0877015228835fac67d4ad08789d39c520.