-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add no_prelude remote execution to github actions
Enabling testing of remote execution on github actions for `no_prelude` * 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. * Include a `platforms` configuration for the `no_prelude` example. * Update `go_toolchain.bzl` to be remote enabled friendly, no need to download a toolchain when remote worker has one. Open question: * Was the downloading of go toolchain to be remote execution compatible prior to this change?
- Loading branch information
Adam Singer
committed
Aug 24, 2024
1 parent
749c7ea
commit 5f3b9be
Showing
7 changed files
with
89 additions
and
13 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
.github/actions/build_example_nativelink_no_prelude/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: build_example_nativelink_no_prelude | ||
inputs: | ||
NATIVELINK_HEADER_RW_KEY_SECRET: | ||
description: '' | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Build example/no_prelude directory 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 | ||
[build] | ||
execution_platforms = root//platforms:platforms" | ||
} > examples/no_prelude/.buckconfig.local | ||
cd examples/no_prelude | ||
$RUNNER_TEMP/artifacts/buck2 build //... | ||
env: | ||
NATIVELINK_HEADER_RW_KEY: ${{ inputs.NATIVELINK_HEADER_RW_KEY_SECRET }} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
Cargo.lock | ||
buck-out | ||
/.direnv | ||
.buckconfig.local | ||
|
||
# symlinks | ||
/examples/with_prelude/prelude | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
load(":defs.bzl", "platforms") | ||
|
||
platforms(name = "platforms") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under both the MIT license found in the | ||
# LICENSE-MIT file in the root directory of this source tree and the Apache | ||
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory | ||
# of this source tree. | ||
|
||
def _platforms(ctx): | ||
configuration = ConfigurationInfo( | ||
constraints = {}, | ||
values = {}, | ||
) | ||
|
||
platform = ExecutionPlatformInfo( | ||
label = ctx.label.raw_target(), | ||
configuration = configuration, | ||
executor_config = CommandExecutorConfig( | ||
local_enabled = True, | ||
remote_enabled = True, | ||
use_limited_hybrid = True, | ||
# Set those up based on what workers you've registered with NativeLink. | ||
remote_execution_properties = { | ||
"OSFamily": "linux", | ||
"container-image": "docker://buck2-github:latest", | ||
}, | ||
remote_execution_use_case = "buck2-default", | ||
remote_output_paths = "output_paths", | ||
), | ||
) | ||
|
||
return [DefaultInfo(), ExecutionPlatformRegistrationInfo(platforms = [platform])] | ||
|
||
platforms = rule(attrs = {}, impl = _platforms) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters