Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Override build user+host+timestamp #397

Merged
merged 1 commit into from Mar 13, 2019

Conversation

bmwiedemann
Copy link
Contributor

@bmwiedemann bmwiedemann commented Mar 12, 2019

Override build user+host+timestamp
to make kata-linux-container package builds reproducible.

See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of the variable.
SOURCE_DATE_EPOCH is unset atm in the .spec file case because no changelog is there to allow rpm to parse the date from it.

Fixes part of issue #394

This PR was done while working on reproducible builds for openSUSE.

Copy link
Contributor

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

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

Thanks @bmwiedemann!!

To keep our CI happy, please could you add a Signed-off-by: comment in your commit (see https://github.com/kata-containers/community/blob/master/CONTRIBUTING.md#general-format).

obs-packaging/linux-container/debian.rules Outdated Show resolved Hide resolved
@bmwiedemann bmwiedemann force-pushed the kernel branch 2 times, most recently from 007f418 to 2714815 Compare March 12, 2019 13:50
Copy link
Contributor

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

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

Thanks very much @bmwiedemann!

lgtm

@jodh-intel
Copy link
Contributor

/test

Copy link

@devimc devimc left a comment

Choose a reason for hiding this comment

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

lgtm

@jodh-intel
Copy link
Contributor

CI is failing with:

[Fail] Update number of CPUs Update CPU constraint [It] should have 1 CPUs 
/tmp/jenkins/workspace/kata-containers-packaging-ubuntu-18-04-PR/go/src/github.com/kata-containers/tests/integration/docker/cpu_test.go:299

/cc @devimc - this seems to be an intermittent failure.

@devimc
Copy link

devimc commented Mar 12, 2019

@jodh-intel yes, and I think the problem is in the agent, I'm thinking that 1 second is not enough time to wait for new vCPUs in nested environments, see https://github.com/kata-containers/agent/blob/master/grpc.go#L69-L71

Copy link
Contributor

@marcov marcov left a comment

Choose a reason for hiding this comment

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

lgtm, just a comment about timestamp.

obs-packaging/linux-container/debian.rules Outdated Show resolved Hide resolved
@egernst
Copy link
Member

egernst commented Mar 12, 2019

@bmwiedemann this is great, thank you. Does this completely address reproducible builds for linux-container ?

@bmwiedemann
Copy link
Contributor Author

@egernst it does for the binaries in the rpm. For fully bit-identical rpm packages, there would need to be a %changelog entry that can be used by rpmbuild to override file mtime and "Build Time" rpm header values.

And then it would be possible that if you add more variations like Debian (varying build-path, umask, timezone, locale) then you could get variations in binaries again.
But those do not matter in the context of OBS builds, which is what I mostly care about.

to make kata-linux-container package builds reproducible.

See https://reproducible-builds.org/ for why this is good.

Uses -u to be independent of timezone.
Uses LANG=C to not have Day-of-Week and Month names vary.

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
@jodh-intel
Copy link
Contributor

Nice - thanks @bmwiedemann.

/retest

@jodh-intel
Copy link
Contributor

18.04 CI fell over with:

not ok 1 Check CPU constraints
# (in test file k8s-cpu-ns.bats, line 35)
#   `[ $total_cpus_container -eq $total_cpus ]' failed

/retest as I can't see this PR would cause that...

@amshinde amshinde merged commit a8c6d94 into kata-containers:master Mar 13, 2019
@bmwiedemann bmwiedemann deleted the kernel branch March 14, 2019 13:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants