gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
17.48k stars 1.75k forks source link

Default all make targets to run in docker #4211

Closed awly closed 1 year ago

awly commented 4 years ago

Currently, we have the root Makefile with a bunch of targets that all run locally. We also have build.assets/Makefile that runs these targets inside docker.

Since everyone has a different local setup, we constantly have friction as people figure out how to tweak their environment to work with our root Makefile.

Instead I propose we make all make targets in the root of the repo run inside docker. And if you really really want to run locally, build.assets should provide those targets.

One caveat here is performance - we must carefully build the docker run commands to reuse all the local caches and avoid excessive disk writes not in volumes.

webvictim commented 4 years ago

I think I would advise that if we're going to do this (and I think we should) then it should be like this:

The reason is that build.assets is currently very overloaded as a directory name and many things assume that it exists. Removing the Makefile will make those targets fail, rather than have them unexpectedly start building locally vs in Docker and create weird issues for us.

We should also look to consolidate the Makefile in the e submodule into the root Makefile. Having two similar-but-not-quite-the-same Makefiles with duplicated targets, variables and other parts is needlessly confusing.

(Also, perhaps weirdly, I'm not a huge fan of having Docker as a hard requirement to simply run make and quickly build a binary for testing. With that said, we can add some checks which will validate that Docker is installed and working, and having a standardised build environment for anyone trying to build Teleport will help a lot, especially as we scale)

russjones commented 4 years ago

This would make development on macOS or (potentially Windows) really slow.

webvictim commented 3 years ago

A lot of our make scripts assume the GNU versions of utilities like sed, find etc which means that they don't work as intended on MacOS anyway. I actually have a much better time mounting my git checkouts into a Vagrant VM which runs Linux - this is way faster than Docker on MacOS (because of its weird hypervisor implementation)