Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup buck2 to build buck2 with remote execution #742

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/actions/build_buck2_nativelink/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: build_buck2_nativelink
inputs:
NATIVELINK_HEADER_RW_KEY_SECRET:
description: ''
required: true
runs:
using: composite
steps:
- name: Build `buck2` with `buck2` using remote execution
run: |-
{
echo "[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
enabled = true
capabilities = true
[build]
execution_platforms = prelude//platforms:default"
} > .buckconfig.local
$RUNNER_TEMP/artifacts/buck2 build //:buck2 -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 @@ -71,6 +71,9 @@ jobs:
- uses: ./.github/actions/build_example_no_prelude
- uses: ./.github/actions/setup_reindeer
- uses: ./.github/actions/build_bootstrap
- uses: ./.github/actions/build_buck2_nativelink
with:
NATIVELINK_HEADER_RW_KEY_SECRET: ${{ secrets.NATIVELINK_HEADER_RW_KEY_SECRET }}
windows-build-examples:
runs-on: windows-latest
steps:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Cargo.lock
buck-out
/.direnv

.buckconfig.local

# symlinks
/examples/with_prelude/prelude
/examples/with_prelude/third-party/ocaml/opam
Expand Down
12 changes: 11 additions & 1 deletion prelude/platforms/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@ def _execution_platform_impl(ctx: AnalysisContext) -> list[Provider]:
configuration = cfg,
executor_config = CommandExecutorConfig(
local_enabled = True,
remote_enabled = False,
remote_enabled = True,
use_limited_hybrid = True,
allow_limited_hybrid_fallbacks = True,
allow_hybrid_fallbacks_on_failure = True,
remote_cache_enabled = True,
remote_execution_properties = {
"OSFamily": "linux",
"container-image": "docker://buck2-github:latest",
},
remote_execution_use_case = "buck2-default",
remote_output_paths = "output_paths",
use_windows_path_separators = ctx.attrs.use_windows_path_separators,
),
)
Expand Down
Loading