-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add build scripts to run tests under a privileged container #5246
Description
Title: Add build scripts to run tests under a privileged container
Description:
We want to be able to run some of the integration tests with CAP_NET_ADMIN. The only way to do that right now in circleci is to either use a "machine" executor running docker locally, or use a remote docker. A major challenge with those approaches is that they only have a 2CPU 8GB machine. Building all tests and running them there is slow. We don't want to add yet another slow process to the pipeline.
So, what do we want?
- Fast build with our large machines.
- The ability to run some tests on a privileged docker container.
- The ability for devs to easily run their tests locally via docker without giving privileges to their local bazel execution environment.
I have proven that you can run a privileged docker container from a normal executor using remote docker here: https://github.com/klarose/test-circle-permissions/blob/master/.circleci/config.yml.
I think a reasonable approach to solving the problem is to put together some scripts which allow us to copy over the necessary binaries/etc to a remote docker container, then start it with the privileges we want. I have prototyped this locally, and it worked quite nicely.