Skip to content

Commit d472d2f

Browse files
author
Adam Singer
committed
Add nativelink remote execution to github actions
* Create github action that generates .buckconfig.local using `NATIVELINK_HEADER_RW_KEY` from gha secrets. * Set `container-image` used for remote execution specific to setup of buck2. * Update .gitignore to include .buckconfig.local.
1 parent 749c7ea commit d472d2f

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: build_example_nativelink
2+
inputs:
3+
NATIVELINK_HEADER_RW_KEY_SECRET:
4+
description: ''
5+
required: true
6+
runs:
7+
using: composite
8+
steps:
9+
- name: Build examples/remote_execution/nativelink directory using remote execution
10+
run: |-
11+
{
12+
echo "[buck2_re_client]
13+
engine_address = grpc://scheduler-buck2.build-faster.nativelink.net:443
14+
action_cache_address = grpc://cas-buck2.build-faster.nativelink.net:443
15+
cas_address = grpc://cas-buck2.build-faster.nativelink.net:443
16+
http_headers = x-nativelink-api-key:$NATIVELINK_HEADER_RW_KEY
17+
tls = true
18+
instance_name = main"
19+
} > examples/remote_execution/nativelink/.buckconfig.local
20+
cd examples/remote_execution/nativelink
21+
$RUNNER_TEMP/artifacts/buck2 build //...
22+
env:
23+
NATIVELINK_HEADER_RW_KEY: ${{ inputs.NATIVELINK_HEADER_RW_KEY_SECRET }}
24+
shell: bash

.github/workflows/build-and-test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ jobs:
6969
$RUNNER_TEMP/artifacts/buck2 test //... -v 2
7070
- uses: ./.github/actions/build_example_conan
7171
- uses: ./.github/actions/build_example_no_prelude
72+
- uses: ./.github/actions/build_example_nativelink
73+
with:
74+
NATIVELINK_HEADER_RW_KEY_SECRET: ${{ secrets.NATIVELINK_HEADER_RW_KEY_SECRET }}
7275
- uses: ./.github/actions/setup_reindeer
7376
- uses: ./.github/actions/build_bootstrap
7477
windows-build-examples:

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Cargo.lock
33
buck-out
44
/.direnv
5+
.buckconfig.local
56

67
# symlinks
78
/examples/with_prelude/prelude

examples/remote_execution/nativelink/platforms/defs.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _platforms(ctx):
2121
# Set those up based on what workers you've registered with NativeLink.
2222
remote_execution_properties = {
2323
"OSFamily": "linux",
24-
"container-image": "docker://ghcr.io/catthehacker/ubuntu:act-22.04@sha256:5f9c35c25db1d51a8ddaae5c0ba8d3c163c5e9a4a6cc97acd409ac7eae239448",
24+
"container-image": "docker://buck2-github:latest",
2525
},
2626
remote_execution_use_case = "buck2-default",
2727
remote_output_paths = "output_paths",

0 commit comments

Comments
 (0)