[docker] Use a multi-stage build for base-cipd

This saves ~300MB by stripping out the packages/files needed by intermediate
stages. Unfortunately, it's still around 400MB, but most of that is the CIPD
packages themselves. I think the best way forward is to have our apps
explicitly request the packages they need, rather than use a single base image
containing all possible packages. I've organized the Dockerfile so that the
"cipd" stage could act as the base for those specialized images.

Change-Id: If95aa48afc75d7e6108df6aac005e11aaea9488a
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/264557
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
1 file changed
tree: 6d8e2cf4d08429b44d9c82128362f8855d380de6
  1. .gitattributes
  2. .gitignore
  4. DEPS
  6. Makefile
  9. README.md
  11. am/
  12. android_compile/
  13. android_ingest/
  14. android_stats/
  15. api/
  16. appengine_scripts/
  17. autoroll/
  18. bash/
  19. blamer/
  20. build_infra_prod.sh
  21. chromeextensions/
  22. cipd.ensure
  23. codereview.settings
  25. common-sk/
  26. contestk/
  27. cq_watcher/
  28. ct/
  29. datahopper/
  30. debugger-assets/
  31. debugger/
  32. docker/
  33. docker_pushes_watcher/
  34. docs/
  35. docserverk/
  36. dot/
  37. ds/
  38. fiddlek/
  39. firestore/
  40. get_service_account/
  41. git_cookie_authdaemon/
  42. gitsync/
  43. go.mod
  44. go.sum
  45. go/
  46. gold-client/
  47. golden/
  48. hashtag/
  49. html-template-minifier/
  50. infra-sk/
  51. infra/
  52. jsdoc/
  53. jsfiddle/
  54. k8s-checker/
  55. kube/
  56. launch.md
  57. leasing/
  58. licenses/
  59. make/
  60. named-fiddles/
  61. particles/
  62. perdiff/
  63. perf/
  64. periodic-trigger/
  65. power/
  66. proberk/
  67. promk/
  68. pulld/
  69. push/
  70. res/
  71. run_unittests
  72. run_unittests.go
  73. scripts/
  74. sheriff_emails/
  75. sk8s/
  76. skbug/
  77. skfe/
  78. skolo/
  79. skottie/
  80. status/
  81. task_driver/
  82. task_scheduler/
  83. tools/
  84. velero/
  85. webtools/
  86. whitespace.txt

Skia-Buildbot Repository

This repo contains infrastructure code for Skia.

Getting the Source Code

The main source code repository is a Git repository hosted at https://skia.googlesource.com/buildbot.git. It is possible to check out this repository directly with git clone or via go get.

Using git clone allows you to work in whatever directory you want. You will still need to set GOPATH in order to build some apps (recommended to put this in a cache dir). E.g.:

$ cd ${WORKDIR}
$ git clone https://skia.googlesource.com/buildbot.git
$ export GOPATH=${HOME}/.cache/gopath/$(basename ${WORKDIR})
$ mkdir $GOPATH
$ cd buildbot

Using go get will fetch the repository into your GOPATH directory along with all the Go dependencies. You will need to set GOPATH and GO111MODULE=on. E.g.:

$ export GOPATH=${WORKDIR}
$ export GO111MODULE=on
$ go get -u -t go.skia.org/infra/...
$ cd ${GOPATH}/src/go.skia.org/infra/

Note: go.skia.org is a custom import path and will only work if used like the examples here.

Install Node.js (not as root) and add the bin dir to your path. Optionally run npm install npm -g, as suggested by the npm getting started doc.

Install other dependencies:

$ sudo apt-get install python-django
$ go get -u github.com/kisielk/errcheck \
  golang.org/x/tools/cmd/goimports \
$ npm install -g polylint bower

Build ~everything:

$ make all

Generated Code

Some code is generated using go generate with external binaries. First, install the version of protoc referenced in the asset creation script and ensure it is on your PATH before other versions of protoc.

Install the necessary go packages:

$ go get -u \
  github.com/golang/protobuf/protoc-gen-go \
  golang.org/x/tools/cmd/stringer \
  google.golang.org/grpc \

To generate code run in this directory:

$ go generate ./...

Running unit tests

Install Cloud SDK.

Use this command to run the presubmit tests:

$ ./run_unittests --small