Skip to content

Commit

Permalink
Add nativelink remote execution to github actions
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Adam Singer committed Aug 7, 2024
1 parent e0b062e commit bfbc7fb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/actions/build_example_nativelink/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: build_example_nativelink
inputs:
NATIVELINK_HEADER_RW_KEY_SECRET:
description: ''
required: true
runs:
using: composite
steps:
- name: Build examples/remote_execution/nativelink directory using remote execution
run: |-
cat <<EOL > examples/remote_execution/nativelink/.buckconfig.local
[buck2_re_client]
engine_address = grpc://scheduler-buck2.build-faster.nativelink.net:443
action_cache_address = grpc://cas-buck2.build-faster.nativelink.net:443
cas_address = grpc://cas-buck2.build-faster.nativelink.net:443
http_headers = x-nativelink-api-key:${NATIVELINK_HEADER_RW_KEY}
tls = true
instance_name = main
EOL
cd examples/remote_execution/nativelink
$RUNNER_TEMP/artifacts/buck2 build //... -v 4
env:
NATIVELINK_HEADER_RW_KEY: ${{ inputs.NATIVELINK_HEADER_RW_KEY_SECRET }}
shell: bash
3 changes: 3 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ jobs:
$RUNNER_TEMP/artifacts/buck2 test //... -v 2
- uses: ./.github/actions/build_example_conan
- uses: ./.github/actions/build_example_no_prelude
- uses: ./.github/actions/build_example_nativelink
with:
NATIVELINK_HEADER_RW_KEY_SECRET: ${{ secrets.NATIVELINK_HEADER_RW_KEY_SECRET }}
- uses: ./.github/actions/setup_reindeer
- uses: ./.github/actions/build_bootstrap
windows-build-examples:
Expand Down
2 changes: 1 addition & 1 deletion examples/remote_execution/nativelink/platforms/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _platforms(ctx):
# Set those up based on what workers you've registered with NativeLink.
remote_execution_properties = {
"OSFamily": "linux",
"container-image": "docker://ghcr.io/catthehacker/ubuntu:act-22.04@sha256:5f9c35c25db1d51a8ddaae5c0ba8d3c163c5e9a4a6cc97acd409ac7eae239448",
"container-image": "docker://buck2-github:latest",
},
remote_execution_use_case = "buck2-default",
remote_output_paths = "output_paths",
Expand Down

0 comments on commit bfbc7fb

Please sign in to comment.