linkerd2/controller
Oliver Gould a786089fd6
docker: Cache versionless builds before building versioned go binaries (#921)
The way that git-related version information is linked into go binaries
busts Docker's cache such that every commit causes all binaries to
rebuilt.

In order to ameliorate this, we can build each binary once without
version information first so that its artifacts are cached. When Go
sources are not changed and only the version information changes, builds
are 4.3x faster than before (from 5+ minutes to <90s).

On `master`

Branch off of master and build (mostly cached):

```
:; time DOCKER_TRACE=1 bin/docker-build
...
DOCKER_TRACE=1 bin/docker-build  9.10s user 6.30s system 5% cpu 4:26.47 total
```

Rebuild without changing anything (highly cached):

```
:; time DOCKER_TRACE=1 bin/docker-build
...
DOCKER_TRACE=1 bin/docker-build  9.23s user 6.04s system 47% cpu 32.017 total
```

Update only the git sha and rebuild:

```
:; git ci -am 'bump it' --allow-empty
[ver/eg 2749eb3] bump it
:; time DOCKER_TRACE=1 bin/docker-build
...
DOCKER_TRACE=1 bin/docker-build  8.55s user 6.08s system 4% cpu 5:22.25 total
```

On this branch:

Rebuild without changing anything (highly cached):

```
:; time DOCKER_TRACE=1 bin/docker-build
...
DOCKER_TRACE=1 bin/docker-build  8.94s user 5.97s system 46% cpu 32.257 total
```

Update only the git sha and rebuild:

```
:; git ci -am 'bump it' --allow-empty
[ver/go-docker-cache-versionless 77a80b5] bump it
:; time DOCKER_TRACE=1 bin/docker-build
...
DOCKER_TRACE=1 bin/docker-build-cli-bin  2.02s user 1.34s system 9% cpu 34.144 total
```
2018-05-10 10:22:09 -07:00
..
api Modify the Stat endpoint to also return the number of failed conduit pods (#895) 2018-05-08 10:35:21 -07:00
cmd Deprecate Tap, rename TapByResource to Tap (#844) 2018-04-25 12:24:46 -07:00
destination Remove special support for ExternalName services (#764) 2018-04-25 11:53:33 -10:00
gen Modify the Stat endpoint to also return the number of failed conduit pods (#895) 2018-05-08 10:35:21 -07:00
k8s Fix bug where GetPodsFor(pod) was returning all pods in a namespace (#900) 2018-05-08 13:52:49 -07:00
script Modify the Stat endpoint to also return the number of failed conduit pods (#895) 2018-05-08 10:35:21 -07:00
tap Modify the Stat endpoint to also return the number of failed conduit pods (#895) 2018-05-08 10:35:21 -07:00
util Reuse code for metrics serving in controller (#585) 2018-03-19 10:33:25 -07:00
Dockerfile docker: Cache versionless builds before building versioned go binaries (#921) 2018-05-10 10:22:09 -07:00