I want to get some sense of how people would feel about this - note I'd advocate keep an open mind, as if this scares you, it probably won't after using it for a bit, but want to get some feedback here.
I want to move all development commands to run within a Docker container. An example of what a development command running within Docker looks like: https://github.com/uber-go/fx/blob/bfd1ec9d803271fb4c37d8ba5a4300259034b522/Makefile#L143 (but in this case, we wouldn't have separate make test and make dockertest commands, just a make test that does what make dockertest does here).
This would mean make build, lint, test, examples, cover would all run within a Docker image built from the contents of the repository. make generate would also run within the same Docker image, and use volumes to link the repository into the container, so that the diff from generation is propagated back to the host - for now, this would mean make generate could only run when the Docker host is local (if you don't know what that means, your Docker host is local lol), but there are some cute things I can do with tarballs and diffs to make this not a requirement in the future (and note that right now, you have to be local to run make generate anyways, we can't run any of our development commands remotely). make crossdock will remain the same.
If we did this, we get a lot of benefits:
The Makefile will become MUCH simpler - all the dependencies will be installed and cached as part of the Docker build, so we don't need to do them in the Makefile. This also makes it easier to make sure that the same version of a dependency is always used.
Travis will be faster, and we can then more easily move to other CI platforms - right now with protobuf, we have another ~3m added to the build because we have to install protobuf each time.
Builds will not differ at all on anyones' machines, and we can guarantee that a make test etc call will pass anywhere.
If we set up a remote docker host on a powerful machine, development commands will be much faster.
There aren't many downsides - for very fast make commands, they might be a few seconds slower because docker build has to be called, but docker build will generally be quick since most of the build will be cached, and we don't have many quick make commands. And for most commands, we can make them much faster using a remote Docker host.
I can write the Makefile to support both local development and docker development, but it's a lot of complication and actually could lead to inconsistent builds across developers.
I want to get some sense of how people would feel about this - note I'd advocate keep an open mind, as if this scares you, it probably won't after using it for a bit, but want to get some feedback here.
I want to move all development commands to run within a Docker container. An example of what a development command running within Docker looks like: https://github.com/uber-go/fx/blob/bfd1ec9d803271fb4c37d8ba5a4300259034b522/Makefile#L143 (but in this case, we wouldn't have separate
make test
andmake dockertest
commands, just amake test
that does whatmake dockertest
does here).This would mean
make build, lint, test, examples, cover
would all run within a Docker image built from the contents of the repository.make generate
would also run within the same Docker image, and use volumes to link the repository into the container, so that the diff from generation is propagated back to the host - for now, this would meanmake generate
could only run when the Docker host is local (if you don't know what that means, your Docker host is local lol), but there are some cute things I can do with tarballs and diffs to make this not a requirement in the future (and note that right now, you have to be local to runmake generate
anyways, we can't run any of our development commands remotely).make crossdock
will remain the same.If we did this, we get a lot of benefits:
make test
etc call will pass anywhere.There aren't many downsides - for very fast make commands, they might be a few seconds slower because
docker build
has to be called, butdocker build
will generally be quick since most of the build will be cached, and we don't have many quick make commands. And for most commands, we can make them much faster using a remote Docker host.I can write the Makefile to support both local development and docker development, but it's a lot of complication and actually could lead to inconsistent builds across developers.
Thoughts? @breerly @abhinav @akshayjshah @kriskowal