Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stamp Stratum release binaries #516

Merged
merged 12 commits into from
Jul 16, 2021
Merged

Stamp Stratum release binaries #516

merged 12 commits into from
Jul 16, 2021

Conversation

pudelkoM
Copy link
Member

@pudelkoM pudelkoM commented Jan 19, 2021

Print a INFO log message on startup with the stamping information like commit, user, build host and timestamp. Also sets the version for gflags --version.

Stamping is only enabled for release builds, but disabled for tests to allow better caching.

This change automatically applies to all binaries calling InitStratumLogging, which includes all of our tools as well.

Examples

# start-stratum.sh -v=1 ...

bf_kdrv_mod found! Unloading first...
loading bf_kdrv_mod...
I20210119 20:36:00.767335 13548 logging.cc:62] Stratum version 55d522f799c379fe4409a4813a9f0ecf5f63f12d built at 2021-07-15T15:31:20-07:00 on host menlo-pdp-lotta-nics by user max.
bf_sysfs_fname /sys/class/bf/bf0/device/dev_add
...
# start-stratum.sh --version
bf_kdrv_mod found! Unloading first...
loading bf_kdrv_mod...
stratum_bf version 51a48a1a24d76e2ebe6ea543c664289f314260e4

Known issues

Our CI process modifies the git tree by patching the bazel config. This means all published build artifacts will report (Modified) in their version. Since having any version information right now is more valuable than 100% correct info, this is an acceptable tradeoff and can be addressed in a later issue.

Closes #500

@codecov
Copy link

codecov bot commented Jan 19, 2021

Codecov Report

Merging #516 (7eb25d8) into main (e92fba2) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #516   +/-   ##
=======================================
  Coverage   78.01%   78.01%           
=======================================
  Files         333      333           
  Lines       29953    29953           
=======================================
  Hits        23369    23369           
  Misses       6584     6584           

stratum/glue/logging.cc Outdated Show resolved Hide resolved
stratum/lib/BUILD Outdated Show resolved Hide resolved
stratum/glue/logging.cc Outdated Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
.bazelrc Outdated Show resolved Hide resolved
Base automatically changed from master to main February 18, 2021 21:10
@pudelkoM pudelkoM force-pushed the version-in-logs branch 2 times, most recently from c3f3cab to e2f36e7 Compare March 12, 2021 20:45
@bocon13
Copy link
Member

bocon13 commented Jul 15, 2021

supersedes #500

@bocon13 bocon13 added the enhancement New feature or request label Jul 15, 2021
@bocon13 bocon13 added this to the 2021-09 Release milestone Jul 15, 2021
@pudelkoM pudelkoM force-pushed the version-in-logs branch 2 times, most recently from dbb709b to 718c037 Compare July 15, 2021 22:31
pudelkoM and others added 5 commits July 15, 2021 16:34
Print a INFO log message on startup with the stamping information
like commit, user, build host and timestamp. Also sets the version for gflags
--version.
Co-authored-by: Brian O'Connor <bocon@opennetworking.org>
@pudelkoM
Copy link
Member Author

CI caching seems to be happy with the stamp config. I'll merge this change and monitor the situation over the next couple of PRs.

@pudelkoM pudelkoM changed the title Stamp Stratum binaries Stamp Stratum release binaries Jul 16, 2021
@pudelkoM pudelkoM merged commit 588516f into main Jul 16, 2021
@pudelkoM pudelkoM deleted the version-in-logs branch July 16, 2021 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants