-
Notifications
You must be signed in to change notification settings - Fork 122
/
worker-lre-cc.yaml
67 lines (67 loc) · 2.35 KB
/
worker-lre-cc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nativelink-worker-lre-cc
spec:
replicas: 1
selector:
matchLabels:
app: nativelink-worker-lre-cc
template:
metadata:
labels:
app: nativelink-worker-lre-cc
spec:
initContainers:
- name: setup-entrypoint
image: nixpkgs/nix-flakes:latest
command: ["/bin/sh", "-c"]
# The kind setup mounts the nativelink repository into the kind nodes at
# `/mnt/src_root`. This ensures that the tags between the worker configs
# and bazel toolchains match when this setup is run in CI.
#
# WARNING: The platform is *not* necessarily the container that is
# actually deployed here. The generator container in this example was
# `rbe-autogen-lre-cc:<sometag>` and the platform was modified
# after the fact to be `lre-cc:<sometag>`. The deployed container
# we use as worker is
# `nativelink-worker-lre-cc:<some_potentially_other_tag>` which is a
# completely separate extension of the `lre-cc` base image.
args:
- |
NATIVELINK_WORKER_PLATFORM=docker://lre-cc:$(nix eval /mnt/src_root#lre-cc.imageTag --raw) &&
printf '#!/bin/sh\nexport NATIVELINK_WORKER_PLATFORM=%s\nexec "$@"' "$NATIVELINK_WORKER_PLATFORM" > /entrypoint/entrypoint.sh &&
chmod +x /entrypoint/entrypoint.sh
volumeMounts:
- name: entrypoint
mountPath: /entrypoint
- name: mnt
mountPath: /mnt
containers:
- name: nativelink-worker-lre-cc
image: "localhost:5001/nativelink-worker-lre-cc:local"
env:
- name: RUST_LOG
value: warn
- name: CAS_ENDPOINT
value: nativelink-cas
- name: SCHEDULER_ENDPOINT
value: nativelink-scheduler
volumeMounts:
- name: worker-config
mountPath: /worker.json
subPath: worker.json
- name: entrypoint
mountPath: /entrypoint
command: ["/entrypoint/entrypoint.sh"]
args: ["/bin/nativelink", "/worker.json"]
volumes:
- name: entrypoint
emptyDir: {}
- name: worker-config
configMap:
name: worker
- name: mnt
hostPath:
path: /mnt