1
0
mirror of https://github.com/moby/buildkit.git synced 2025-04-18 18:04:03 +03:00
Sebastiaan van Stijn 21e9e9641e
Remove uses of deprecated io/ioutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-10 00:57:07 +01:00
..
2022-03-10 00:57:07 +01:00
2019-10-16 18:55:27 +09:00
2019-10-16 18:55:27 +09:00

Distributed Build with Consistent Hashing

Demo for efficiently using BuildKit daemon-local cache with multi-node cluster

Deploy

$ kubectl apply -f ../statefulset.rootless.yaml
$ kubectl scale --replicas=10 statefulset/buildkitd

Consistent hashing

Define the key string for consistent hashing.

For example, the key can be defined as <REPO NAME>:<CONTEXT PATH>, e.g. github.com/example/project:some/directory.

Then determine the pod that corresponds to the key:

$ go build -o consistenthash .
$ pod=$(./show-running-pods.sh | consistenthash $key)

You can connect to the pod using export BUILDKIT_HOST=kube-pod://$pod.