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

[YUNIKORN-2420] Shim: create reproducible binaries #790

Closed
wants to merge 1 commit into from

Conversation

craigcondit
Copy link
Contributor

What is this PR for?

Ensure that binaries produced in the shim use consistent build ID and build date so that builds are reproducible.

The git commit timestamp is used (if possible) for the build date, and cached in the build.date file so that it can be included in release tarballs. The go-generated build ID is set to an empty string.

What type of PR is it?

  • - Bug Fix
  • - Improvement
  • - Feature
  • - Documentation
  • - Hot Fix
  • - Refactoring

Todos

  • - Task

What is the Jira issue?

https://issues.apache.org/jira/browse/YUNIKORN-2420

How should this be tested?

Verified identical build output when generating linux/arm64 binaries from the following platforms:

  • linux/amd64
  • linux/arm64
  • macos/amd64
  • macos/arm64

For all 4 platforms (using HOST_ARCH=arm64 and go 1.21.7), the output is as follows:

$ sha512sum build/bin/*
4c53b142ebe0661a01ca7ac873f6e12e8552ad63360d218b369022192c1f0bc96638c9e8990560b970614579e41489eeba45042b1e681f753e7b036000450ce0  build/bin/yunikorn-admission-controller
477255b81456c6abd0fb2dd45012015c393b25264a7d71e089a61d77f4b59135924126859a81ba07a7f2da26f96c12cef273f4f584b75eb80973a8347b76234b  build/bin/yunikorn-scheduler
26a4dcd0f810e10b4f008ce578c108805e4fae0b9930748a692a97978b7603c51a5809f54f96e198b7c9c562e2fb262c6d172a685dcc71c633711be384379ef5  build/bin/yunikorn-scheduler-plugin

Screenshots (if appropriate)

Questions:

  • - The licenses files need update.
  • - There is breaking changes for older versions.
  • - It needs documentation.

Ensure that binaries produced in the shim use consistent build ID
and build date so that builds are reproducible.
Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d4d7497) 71.58% compared to head (4669d6f) 71.65%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #790      +/-   ##
==========================================
+ Coverage   71.58%   71.65%   +0.06%     
==========================================
  Files          43       43              
  Lines        6332     6332              
==========================================
+ Hits         4533     4537       +4     
+ Misses       1597     1594       -3     
+ Partials      202      201       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

one question: the vocabulary used by the label is BuildTimeStamp, and it seems to me it should be equal to the "time" of running the build. Should we pick up other more suitable vocabulary for label?

@craigcondit
Copy link
Contributor Author

one question: the vocabulary used by the label is BuildTimeStamp, and it seems to me it should be equal to the "time" of running the build. Should we pick up other more suitable vocabulary for label?

I think it's best to keep it as is for backwards compatibility. Logically, it's still the best timestamp associated with the build -- it's just that it will reflect the date of the latest commit (or if you like, the earliest possible build timestamp).

@craigcondit craigcondit deleted the YUNIKORN-2420 branch February 15, 2024 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants