Project

General

Profile

Actions

Feature #10666

closed

All Arvados components should report their version

Added by Tom Clegg over 7 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Story points:
-

Description

It should be possible to get the version of an arvados-prog via
  • arvados-prog -version
  • curl http://.../status.json | jq -r .Version
  • grep "started" .../log/main/current

Subtasks 1 (0 open1 closed)

Task #12490: Review 10666-report-versionResolvedLucas Di Pentima12/05/2016Actions

Related issues

Related to Arvados - Bug #10587: All Python CLI utilities should report --versionResolvedLucas Di Pentima11/22/2016Actions
Actions #1

Updated by Tom Clegg over 7 years ago

  • Description updated (diff)
Actions #2

Updated by Tom Morris over 6 years ago

  • Target version set to Arvados Future Sprints
Actions #3

Updated by Tom Morris over 6 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?

Actions #4

Updated by Tom Morris over 6 years ago

  • Target version changed from Arvados Future Sprints to 2017-11-08 Sprint
Actions #5

Updated by Nico César over 6 years ago

+1

is hard to tell from the logs if deploys are using the correct version

Actions #6

Updated by Tom Morris over 6 years ago

  • Assigned To set to Tom Clegg
Actions #7

Updated by Tom Clegg over 6 years ago

  • Assigned To deleted (Tom Clegg)
  • Target version changed from 2017-11-08 Sprint to 2017-11-22 Sprint
Actions #8

Updated by Tom Morris over 6 years ago

  • Assigned To set to Lucas Di Pentima
Actions #9

Updated by Lucas Di Pentima over 6 years ago

  • Status changed from New to In Progress
Actions #10

Updated by Lucas Di Pentima over 6 years ago

  • Target version changed from 2017-11-22 Sprint to 2017-12-06 Sprint
Actions #11

Updated by Peter Amstutz over 6 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?

Actions #12

Updated by Lucas Di Pentima over 6 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)

Actions #13

Updated by Lucas Di Pentima over 6 years ago

Updates at 60a60a176
Test run: https://ci.curoverse.com/job/developer-run-tests/521/

Added version information to /status.json endpoint on the following services:
  • keepstore
  • keep-web
  • ws

Also added corresponding tests.

Actions #14

Updated by Tom Clegg over 6 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"
Actions #15

Updated by Tom Clegg over 6 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
Actions #16

Updated by Lucas Di Pentima over 6 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.

Actions #17

Updated by Lucas Di Pentima over 6 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.

Actions #18

Updated by Tom Clegg over 6 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.

Actions #19

Updated by Lucas Di Pentima over 6 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.

Actions #20

Updated by Tom Clegg over 6 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

Actions #21

Updated by Lucas Di Pentima over 6 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.

Actions #22

Updated by Anonymous over 6 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF