Skip to content

Commit eb210b3

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

16 files changed

Lines changed: 241 additions & 323 deletions

File tree

.github/workflows/lre.yaml

Lines changed: 50 additions & 208 deletions
Original file line numberDiff line numberDiff line change
@@ -58,211 +58,53 @@ 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 images
78+
run: |
79+
nix run .#image.copyTo docker-daemon:local-nativelink:latest
80+
nix run .#nativelink-worker-lre-rs.copyTo docker-daemon:local-worker-rs:latest
81+
nix run .#nativelink-worker-init.copyTo docker-daemon:local-worker-init:latest
82+
83+
- name: Compile NativeLink with NativeLink
84+
timeout-minutes: 60
85+
run: |
86+
set -eu
87+
cd deployment-examples/docker-compose
88+
docker compose -f docker-compose-lre.yml up &> docker-compose.log &
89+
cd ../../
90+
nix develop --impure --fallback --command \
91+
bash -c "bazel test //... \
92+
--lockfile_mode=error \
93+
--verbose_failures \
94+
--remote_cache=grpc://127.0.0.1:50051 \
95+
--remote_executor=grpc://127.0.0.1:50052"
96+
env:
97+
NATIVELINK_IMAGE: local-nativelink:latest
98+
NATIVELINK_WORKER_INIT_IMAGE: local-worker-init:latest
99+
NATIVELINK_LRE_IMAGE: local-worker-rs:latest
100+
RUST_LOG: debug
101+
102+
- name: Check Docker compose
103+
run: cat deployment-examples/docker-compose/docker-compose.log
104+
if: always()
105+
106+
- name: Teardown Worker
107+
uses: ./.github/actions/end-nix
108+
if: always()
109+
with:
110+
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

MODULE.bazel

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bazel_dep(name = "rules_shell", version = "0.6.1")
1515
# via --extra_toolchains, which outranks the MODULE.bazel registration below,
1616
# so Nix users keep getting LRE-CC unchanged. Outside Nix (no lre.bazelrc),
1717
# these hermetic toolchains replace the host autodetect path.
18-
bazel_dep(name = "llvm", version = "0.7.7")
18+
bazel_dep(name = "llvm", version = "0.8.0")
1919

2020
register_toolchains("@llvm//toolchain:all")
2121

@@ -50,9 +50,10 @@ register_toolchains(
5050
dev_dependency = True,
5151
)
5252

53-
bazel_dep(name = "rules_rs", version = "0.0.76")
53+
bazel_dep(name = "rules_rs", version = "0.0.77")
5454

55-
# Pin rules_rust to the hermeticbuild fork (the same commit rules_rs provisions)
55+
# Pin rules_rust to the hermeticbuild fork (the same commit rules_rs provisions
56+
# see https://github.com/hermeticbuild/rules_rs/blob/v0.0.77/rs/rules_rust.bzl)
5657
# so all `@rules_rust//...` references resolve to the patched ruleset. The
5758
# bazel_dep + archive_override is the form that keeps `@rules_rust` visible to
5859
# subsequent `use_extension(...)` calls in this MODULE.bazel — the alternative
@@ -62,15 +63,15 @@ bazel_dep(name = "rules_rs", version = "0.0.76")
6263
# The local musl-platforms patch is still applied because the hermeticbuild
6364
# fork does not list x86_64/aarch64-unknown-linux-musl as supported triples in
6465
# rust/platform/triple_mappings.bzl.
65-
bazel_dep(name = "rules_rust", version = "0.68.1")
66+
bazel_dep(name = "rules_rust", version = "0.70.0")
6667
archive_override(
6768
module_name = "rules_rust",
68-
integrity = "sha256-HG4cSGKVIoZTn0zpUNKhJbGvFfD2UVPJqKRqgTqLOQQ=",
69+
integrity = "sha256-aROt7MxNPUOELpgM4BZEQpptsoT6t2qjFpAzyZRF0LE=",
6970
patch_strip = 1,
7071
patches = ["//tools:rules_rust-musl-platforms.diff"],
71-
strip_prefix = "rules_rust-cf176d81c12d9c8f6420c7d433b0af0f08d2abb1",
72+
strip_prefix = "rules_rust-1c00622c3ba0269a6d5306772fe2e9aff4bf89a0",
7273
urls = [
73-
"https://github.com/hermeticbuild/rules_rust/archive/cf176d81c12d9c8f6420c7d433b0af0f08d2abb1.tar.gz",
74+
"https://github.com/hermeticbuild/rules_rust/archive/1c00622c3ba0269a6d5306772fe2e9aff4bf89a0.tar.gz",
7475
],
7576
)
7677

0 commit comments

Comments
 (0)