yarpc / yarpc-go

A message passing platform for Go
MIT License
412 stars 103 forks source link

Proposal: Move all development commands to Docker-only #826

Closed bufdev closed 7 years ago

bufdev commented 7 years ago

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:

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.

Thoughts? @breerly @abhinav @akshayjshah @kriskowal

akshayjshah commented 7 years ago

Sure, let's give it a try. This seems like a reasonable way to keep our CI and local development efforts in sync.

HelloGrayson commented 7 years ago

You'll get no resistance from me. Let's do it 👍