Skip to content

Commit 7d1c863

Browse files
committed
Test actual LRE in CI
1 parent 847b0d3 commit 7d1c863

4 files changed

Lines changed: 43 additions & 278 deletions

File tree

.github/workflows/lre.yaml

Lines changed: 39 additions & 208 deletions
Original file line numberDiff line numberDiff line change
@@ -58,211 +58,42 @@ jobs:
5858
with:
5959
nativelink_attic_token: ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
6060

61-
# remote:
62-
# strategy:
63-
# fail-fast: false
64-
# matrix:
65-
# os: [xlarge-ubuntu-24.04]
66-
# toolchain: [lre-cc, lre-rs]
67-
# name: Remote / ${{ matrix.toolchain }} / ${{ matrix.os }}
68-
# runs-on: ${{ matrix.os }}
69-
# timeout-minutes: 45
70-
# steps:
71-
# - name: Checkout
72-
# uses: >- # v6.0.2
73-
# actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
74-
75-
# - name: Prepare Worker
76-
# uses: ./.github/actions/prepare-nix
77-
# with:
78-
# nativelink_attic_token: ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
79-
80-
# - name: Start Kubernetes cluster
81-
# run: >
82-
# nix run .#native up
83-
84-
# - name: Start NativeLink operator
85-
# env:
86-
# REPO_URL: ${{ github.event.pull_request.head.repo.clone_url || format('https://github.com/{0}.git', github.repository) }}
87-
# BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
88-
# COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
89-
# TOOLCHAIN: ${{ matrix.toolchain }}
90-
# run: |
91-
# nix develop --fallback --impure --command bash -c 'cat > kustomization.yaml << EOF
92-
# apiVersion: kustomize.config.k8s.io/v1beta1
93-
# kind: Kustomization
94-
# resources:
95-
# - kubernetes/resources/flux
96-
# - kubernetes/resources/nativelink-core
97-
# - kubernetes/resources/gateway-routes
98-
# - kubernetes/workers/resources/worker-init
99-
# - kubernetes/workers/resources/${TOOLCHAIN}
100-
# patches:
101-
# - patch: |-
102-
# - op: replace
103-
# path: /spec/url
104-
# value: ${REPO_URL}
105-
# - op: replace
106-
# path: /spec/ref/branch
107-
# value: ${BRANCH}
108-
# - op: replace
109-
# path: /spec/ref/commit
110-
# value: ${COMMIT}
111-
# target:
112-
# kind: GitRepository
113-
# name: nativelink-infra
114-
# - patch: |-
115-
# - op: replace
116-
# path: /spec/postBuild/substitute/PLACEHOLDER_FLAKE_OUTPUT
117-
# value: ./src_root#image
118-
# target:
119-
# kind: Kustomization
120-
# name: nativelink-alert-core
121-
# - patch: |-
122-
# - op: replace
123-
# path: /spec/postBuild/substitute/PLACEHOLDER_FLAKE_OUTPUT
124-
# value: ./src_root#nativelink-worker-init
125-
# target:
126-
# kind: Kustomization
127-
# name: nativelink-alert-worker-init
128-
# - patch: |-
129-
# - op: replace
130-
# path: /spec/postBuild/substitute/PLACEHOLDER_FLAKE_OUTPUT
131-
# value: ./src_root#nativelink-worker-${TOOLCHAIN}
132-
# target:
133-
# kind: Kustomization
134-
# name: nativelink-alert-${TOOLCHAIN}
135-
# EOF
136-
# kubectl apply -k . &&
137-
# rm kustomization.yaml'
138-
139-
# - name: Wait for Tekton resources
140-
# run: >
141-
# nix develop --impure --command
142-
# bash -c "flux reconcile kustomization \
143-
# --timeout=15m \
144-
# nativelink-tekton-resources"
145-
146-
# - name: Wait for alerts
147-
# env:
148-
# TOOLCHAIN: ${{ matrix.toolchain }}
149-
# run: >
150-
# nix develop --impure --command
151-
# bash -c "flux reconcile kustomization \
152-
# --timeout=15m \
153-
# nativelink-alert-core && \
154-
# flux reconcile kustomization \
155-
# --timeout=15m \
156-
# nativelink-alert-worker-init && \
157-
# flux reconcile kustomization \
158-
# --timeout=15m \
159-
# nativelink-alert-${TOOLCHAIN}"
160-
161-
# - name: Trigger pipelines
162-
# env:
163-
# REPO_URL: ${{ github.event.pull_request.head.repo.clone_url || format('https://github.com/{0}.git', github.repository) }}
164-
# BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
165-
# run: |
166-
# nix develop --impure --command bash -c 'cat > nativelink-repo.yaml << EOF
167-
# apiVersion: source.toolkit.fluxcd.io/v1
168-
# kind: GitRepository
169-
# metadata:
170-
# name: nativelink
171-
# namespace: default
172-
# spec:
173-
# interval: 2m
174-
# url: ${REPO_URL}
175-
# ref:
176-
# branch: ${BRANCH}
177-
# EOF
178-
# kubectl apply -f nativelink-repo.yaml &&
179-
# rm nativelink-repo.yaml'
180-
181-
# - name: Wait for Tekton pipelines
182-
# run: >
183-
# nix develop --impure --command bash << 'EOF'
184-
# until pr=$(kubectl get pipelinerun -n ci -o name | \
185-
# grep rebuild-nativelink-run-); do
186-
# echo "Waiting for pipeline to be created..."
187-
# sleep 1
188-
# done
189-
190-
# echo "Found pipelinerun: $pr"
191-
# kubectl wait --for=create -n ci $pr
192-
193-
# echo "Waiting for pipelinerun to succeed..."
194-
# kubectl wait \
195-
# --for=condition=Succeeded \
196-
# --timeout=45m \
197-
# pipelinerun \
198-
# -n ci \
199-
# -l tekton.dev/pipeline=rebuild-nativelink
200-
# EOF
201-
202-
# - name: Wait for NativeLink Kustomization
203-
# run: >
204-
# nix develop --impure --command
205-
# bash -c "flux reconcile kustomization -n default \
206-
# --timeout=15m \
207-
# nativelink-core"
208-
209-
# - name: Debug Kustomizations
210-
# run: >
211-
# nix develop --impure --command
212-
# bash -c "kubectl get kustomizations.kustomize.toolkit.fluxcd.io -A && kubectl events --all-namespaces && kubectl describe kustomizations.kustomize.toolkit.fluxcd.io -A"
213-
# if: always()
214-
215-
# - name: Wait for Worker Kustomization
216-
# env:
217-
# TOOLCHAIN: ${{ matrix.toolchain }}
218-
# run: >
219-
# nix develop --impure --command
220-
# bash -c "flux reconcile kustomization -n default \
221-
# --timeout=15m \
222-
# nativelink-${TOOLCHAIN}"
223-
224-
# - name: Debug Kustomizations
225-
# run: >
226-
# nix develop --impure --command
227-
# bash -c "kubectl get kustomizations.kustomize.toolkit.fluxcd.io -A && kubectl events --all-namespaces && kubectl describe kustomizations.kustomize.toolkit.fluxcd.io -A"
228-
# if: always()
229-
230-
# - name: Wait for NativeLink
231-
# run: >
232-
# nix develop --impure --command
233-
# bash -c "kubectl rollout status deploy/nativelink"
234-
235-
# - name: Wait for worker
236-
# env:
237-
# TOOLCHAIN: ${{ matrix.toolchain }}
238-
# run: >
239-
# nix develop --impure --command
240-
# bash -c "kubectl rollout status deploy/nativelink-worker-${TOOLCHAIN}"
241-
242-
# - name: Get gateway IPs
243-
# id: gateway-ips
244-
# run: |
245-
# echo "nativelink_ip=$(kubectl get gtw nativelink-gateway -o=jsonpath='{.status.addresses[0].value}')" >> "$GITHUB_ENV"
246-
247-
# - name: Print cluster state
248-
# run: |
249-
# kubectl get svc -A
250-
# kubectl get pod -A
251-
# kubectl get svc -A
252-
# kubectl get deployments -A
253-
# kubectl describe gtw
254-
# echo "nativelink"
255-
# kubectl logs -l app=nativelink
256-
# echo "worker"
257-
# kubectl logs -l app=nativelink-worker
258-
259-
# - name: Build example with ${{ matrix.toolchain }} toolchain
260-
# env:
261-
# TOOLCHAIN: ${{ matrix.toolchain }}
262-
# run: >
263-
# nix develop --impure --command
264-
# bash -c "bazel run \
265-
# --remote_cache=grpc://$nativelink_ip \
266-
# --remote_executor=grpc://$nativelink_ip \
267-
# --verbose_failures \
268-
# @local-remote-execution//examples:${TOOLCHAIN}"
61+
remote-docker-compose:
62+
runs-on: ubuntu-24.04
63+
steps:
64+
- name: Checkout
65+
uses: >- # v6.0.2
66+
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
67+
68+
- name: Set up Docker Buildx
69+
uses: >- # v3.9.0
70+
docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca
71+
72+
- name: Prepare Worker
73+
uses: ./.github/actions/prepare-nix
74+
with:
75+
nativelink_attic_token: ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
76+
77+
- name: Build Nativelink image
78+
run: |
79+
nix develop --impure --fallback --command create-local-image
80+
81+
- name: Compile NativeLink with NativeLink
82+
run: |
83+
cd deployment-examples/docker-compose && \
84+
docker-compose up -d && \
85+
cd ../../ && \
86+
nix develop --impure --fallback --command
87+
bash -c "bazel test //... \
88+
--lockfile_mode=error \
89+
--verbose_failures \
90+
--remote_cache=grpc://127.0.0.1:50051 \
91+
--remote_executor=grpc://127.0.0.1:50052"
92+
env:
93+
NATIVELINK_IMAGE: local-nativelink:latest
94+
95+
- name: Teardown Worker
96+
uses: ./.github/actions/end-nix
97+
if: always()
98+
with:
99+
nativelink_attic_token: ${{ secrets.NATIVELINK_ATTIC_TOKEN }}

.github/workflows/main.yaml

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -20,72 +20,6 @@ concurrency:
2020
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
2121

2222
jobs:
23-
# TODO(palfrey): Flaky. Fix.
24-
# docker-compose-compiles-nativelink:
25-
# # The type of runner that the job will run on.
26-
# runs-on: ubuntu-24.04
27-
# strategy:
28-
# matrix:
29-
# # Which OS versions we will test on.
30-
# os_version: [ 24.04 ]
31-
# steps:
32-
# - name: Checkout
33-
# uses: >- # v6.0.2
34-
# actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
35-
36-
# - name: Set up Docker Buildx
37-
# uses: >- # v3.9.0
38-
# docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca
39-
40-
# - name: Build Nativelink image
41-
# uses: >- # v6.13.0
42-
# docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991
43-
# with:
44-
# context: .
45-
# file: ./deployment-examples/docker-compose/Dockerfile
46-
# build-args: |
47-
# OPT_LEVEL=opt
48-
# OS_VERSION=${{ matrix.os_version }}
49-
# ADDITIONAL_SETUP_WORKER_CMD=apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y gcc g++ lld pkg-config python3
50-
# load: true # This brings the build into `docker images` from buildx.
51-
# tags: trace_machina/nativelink:latest
52-
53-
# - name: Build builder image
54-
# uses: >- # v6.13.0
55-
# docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991
56-
# with:
57-
# context: .
58-
# file: ./deployment-examples/docker-compose/Dockerfile
59-
# build-args: |
60-
# OPT_LEVEL=opt
61-
# OS_VERSION=${{ matrix.os_version }}
62-
# load: true # This brings the build into `docker images` from buildx.
63-
# tags: trace_machina/nativelink:builder
64-
# target: builder
65-
66-
# - name: Compile NativeLink with NativeLink
67-
# run: |
68-
# mkdir -p ~/.cache && \
69-
# cd deployment-examples/docker-compose && \
70-
# (docker-compose up -d || docker compose up -d) && \
71-
# cd ../../ && \
72-
# docker run --rm --net=host -w /root/nativelink -v $PWD:/root/nativelink trace_machina/nativelink:builder sh -c ' \
73-
# bazel clean && \
74-
# bazel test //... \
75-
# --extra_toolchains=@rust_toolchains//:all \
76-
# --remote_cache=grpc://127.0.0.1:50051 \
77-
# --remote_executor=grpc://127.0.0.1:50052 \
78-
# --remote_default_exec_properties=cpu_count=2 \
79-
# ' && \
80-
# docker run --rm --net=host -w /root/nativelink -v $PWD:/root/nativelink trace_machina/nativelink:builder sh -c ' \
81-
# bazel clean && \
82-
# bazel test //... \
83-
# --extra_toolchains=@rust_toolchains//:all \
84-
# --remote_cache=grpc://127.0.0.1:50051 \
85-
# --remote_executor=grpc://127.0.0.1:50052 \
86-
# --remote_default_exec_properties=cpu_count=2 \
87-
# ' 2>&1 | ( ! grep ' PASSED in ' ) # If we get PASSED without (cache) it means there's a cache issue.
88-
8923
integration-tests:
9024
runs-on: ubuntu-24.04
9125
timeout-minutes: 60

deployment-examples/docker-compose/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
services:
1616
nativelink_local_cas:
17-
image: trace_machina/nativelink:latest
17+
image: ${NATIVELINK_IMAGE:-trace_machina/nativelink:latest}
1818
build:
1919
context: ../..
2020
dockerfile: ./deployment-examples/docker-compose/Dockerfile
@@ -33,7 +33,7 @@ services:
3333
nativelink /root/local-storage-cas.json5
3434
3535
nativelink_scheduler:
36-
image: trace_machina/nativelink:latest
36+
image: ${NATIVELINK_IMAGE:-trace_machina/nativelink:latest}
3737
build:
3838
context: ../..
3939
dockerfile: ./deployment-examples/docker-compose/Dockerfile
@@ -54,7 +54,7 @@ services:
5454
- nativelink_local_cas
5555

5656
nativelink_executor:
57-
image: trace_machina/nativelink:latest
57+
image: ${NATIVELINK_IMAGE:-trace_machina/nativelink:latest}
5858
privileged: true # So we can do use_namespaces
5959
build:
6060
context: ../..

web/platform/src/content/docs/docs/contribute/nix.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ and get tagged with nix derivation hashes.
4141
To build an image locally and make it available to your container runtime:
4242

4343
```sh
44-
nix run create-local-image
44+
create-local-image
4545
```
4646

4747
which will be called `local-nativelink:latest`

0 commit comments

Comments
 (0)