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

Various buildbox/Drone fixes #3982

Merged
merged 43 commits into from
Jul 9, 2020
Merged

Conversation

webvictim
Copy link
Contributor

@webvictim webvictim commented Jul 3, 2020

The main purpose of this PR is to enable pulling and rebuiding the Teleport buildbox before each set of lint/unit test/integration test runs in the same way as Jenkins currently does. This is useful for us to be able to test Dockerfile changes, plus change the Go runtime and have that tested as part of PRs. It uses --cache-from to aim for some bonus docker build speed/layer caching.

This PR also disables reuse of the Go build cache inside containers. The benefit to this is that tests seem to be more reliable. The downside is that test runs will take longer.

I also took out uses of the $REPO variable as we weren't using it properly anyway. If we change from quay.io to another repository then we'll likely need to update the image names/paths anyway.

I added a load of other miscellaneous changes too:

  • Integrate buildbox-base Dockerfile code into build.assets Dockerfile (for simplicity/keeping everything in one place)
  • Change references to bbox to buildbox throughout Makefile for clarity
  • Move most Docker logic to the build.assets Makefile rather than explicitly laying it out in .drone.yml
  • Change buildbox-base from debian:stretch to ubuntu:20.04 (to keep everything up to date/free of vulnerabilities, plus a requirement to get a sufficiently recent BPF library version for tests)
  • Install BPF libraries into buildbox so we can build binaries containing BPF functionality using Drone
  • Change /gopath to /go throughout Dockerfiles, for consistency with Drone and the golang Docker images
  • Various Dockerfile changes for consistency
  • Integrate @awly's changes for PAM code in build.assets

@webvictim webvictim self-assigned this Jul 3, 2020
@webvictim webvictim force-pushed the gus/one-dockerfile-to-rule-them-all branch from 114756f to 3558b9c Compare July 7, 2020 20:38
@webvictim
Copy link
Contributor Author

retest this please

@webvictim webvictim marked this pull request as ready for review July 7, 2020 22:09
@webvictim webvictim requested review from awly and russjones as code owners July 7, 2020 22:09
Copy link
Contributor

@awly awly left a comment

Choose a reason for hiding this comment

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

@webvictim
Copy link
Contributor Author

Can you also add PAM changes from https://github.com/gravitational/teleport/pull/3966/files#diff-e60f083cfee151a61e71f27ba4c92a0c ?

Done - https://github.com/gravitational/teleport/pull/3982/files/31e40338a38e2f51d9658cbde7617acc06dfc2a2..37c52c4055c4f15a369f210301d17ffe4802e4fc

I've moved the PAM copy steps to the end of the Dockerfile so we can still make use of layer caching for the earlier stages. It also requires that we install a number of extra packages into the alpine container that's running make because the PAM builds aren't done in Docker.

@webvictim
Copy link
Contributor Author

retest this please

Copy link
Contributor

@awly awly left a comment

Choose a reason for hiding this comment

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

retest this please

@webvictim
Copy link
Contributor Author

retest this please

@webvictim webvictim requested a review from benarent as a code owner July 8, 2020 20:26
@webvictim webvictim removed the request for review from benarent July 8, 2020 20:49
@webvictim webvictim force-pushed the gus/one-dockerfile-to-rule-them-all branch 2 times, most recently from 1f23872 to 2c186b2 Compare July 8, 2020 21:33
@webvictim webvictim force-pushed the gus/one-dockerfile-to-rule-them-all branch from 8a25e26 to 8dfb154 Compare July 8, 2020 22:35
@webvictim
Copy link
Contributor Author

retest this please

1 similar comment
@webvictim
Copy link
Contributor Author

retest this please

@webvictim webvictim merged commit 943e0d0 into master Jul 9, 2020
webvictim added a commit that referenced this pull request Jul 10, 2020
webvictim added a commit that referenced this pull request Jul 10, 2020
* Various buildbox/Drone fixes (#3982)
* Re-sign .drone.yml
* Update CODEOWNERS
@webvictim webvictim deleted the gus/one-dockerfile-to-rule-them-all branch August 18, 2020 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants