@@ -58,211 +58,52 @@ 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+ run : |
85+ set -eu && \
86+ cd deployment-examples/docker-compose && \
87+ docker compose up &> docker-compose.log & && \
88+ cd ../../ && \
89+ nix develop --impure --fallback --command \
90+ bash -c "bazel test //... \
91+ --lockfile_mode=error \
92+ --verbose_failures \
93+ --remote_cache=grpc://127.0.0.1:50051 \
94+ --remote_executor=grpc://127.0.0.1:50052"
95+ env :
96+ NATIVELINK_IMAGE : local-nativelink:latest
97+ NATIVELINK_WORKER_INIT_IMAGE : local-worker-init:latest
98+ NATIVELINK_LRE_IMAGE : local-worker-rs:latest
99+ RUST_LOG : debug
100+
101+ - name : Check Docker compose
102+ run : cat deployment-examples/docker-compose/docker-compose.log
103+ if : always()
104+
105+ - name : Teardown Worker
106+ uses : ./.github/actions/end-nix
107+ if : always()
108+ with :
109+ nativelink_attic_token : ${{ secrets.NATIVELINK_ATTIC_TOKEN }}
0 commit comments