Skip to content

Commit

Permalink
chore: switch from Engflow to Buildbuddy (#1241)
Browse files Browse the repository at this point in the history
* chore: switch from Engflow to Buildbuddy

* chore: modify js image to bust bad cache entry
  • Loading branch information
alexeagle authored Aug 28, 2023
1 parent 9f754f7 commit 198ec6f
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 55 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/ci.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,8 @@ build:rbe --genrule_strategy=remote,local
build:rbe --host_platform=@aspect_rules_js//platforms:x86_64_linux_remote
build:rbe --jobs=32

# EngFlow remote cache
build:rbe --bes_backend=grpcs://tourmaline.cluster.engflow.com
build:rbe --bes_results_url=https://tourmaline.cluster.engflow.com/invocation/
build:rbe --remote_cache=grpcs://tourmaline.cluster.engflow.com

# EngFlow remote build execution
build:rbe --remote_executor=grpcs://tourmaline.cluster.engflow.com

# TODO: remove workaround for failure
build:rbe --modify_execution_info=GoCompilePkg=+no-remote-exec

# These files are written during CI setup, using secrets registered with the CI platforms
build:rbe --tls_client_certificate=engflow.crt --tls_client_key=engflow.key
# BuildBuddy remote exec
build:rbe --bes_results_url=https://app.buildbuddy.io/invocation/
build:rbe --bes_backend=grpcs://remote.buildbuddy.io
build:rbe --remote_timeout=3600
build:rbe --remote_executor=grpcs://remote.buildbuddy.io
16 changes: 7 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ jobs:
# Prepares the 'config' axis of the test matrix
runs-on: ubuntu-latest
env:
ENGFLOW_PRIVATE_KEY: ${{ secrets.ENGFLOW_PRIVATE_KEY }}
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
steps:
- id: local
run: echo "config=local" >> $GITHUB_OUTPUT
- id: rbe
run: echo "config=rbe" >> $GITHUB_OUTPUT
# Only run on main branch (or PR branches that contain 'rbe') to reduce the matrix size for PRs
# Don't run RBE if there are no EngFlow creds which is the case on forks
if: (github.ref == 'refs/heads/main' || contains(github.head_ref, 'rbe')) && env.ENGFLOW_PRIVATE_KEY != ''
# Don't run RBE if there is no API key which is the case on forks
if: (github.ref == 'refs/heads/main' || contains(github.head_ref, 'rbe')) && env.BUILDBUDDY_API_KEY != ''
outputs:
# Will look like ["local", "rbe"]
config: ${{ toJSON(steps.*.outputs.config) }}
Expand Down Expand Up @@ -288,13 +288,11 @@ jobs:
if: matrix.config == 'rbe'
working-directory: ${{ matrix.folder }}
run: |
touch engflow.crt engflow.key
chmod 0600 engflow.crt engflow.key
echo "$ENGFLOW_CLIENT_CRT" > engflow.crt
echo "$ENGFLOW_PRIVATE_KEY" > engflow.key
touch $HOME/.bazelrc
chmod 0600 $HOME/.bazelrc
echo "build --remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY" > $HOME/.bazelrc
env:
ENGFLOW_CLIENT_CRT: ${{ secrets.ENGFLOW_CLIENT_CRT }}
ENGFLOW_PRIVATE_KEY: ${{ secrets.ENGFLOW_PRIVATE_KEY }}
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}

- name: Set bzlmod flag (for integration tests)
# Store the --enable_bzlmod flag that we add to the test command below
Expand Down
8 changes: 0 additions & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -140,26 +140,18 @@ npm.npm_translate_lock(
"@kubernetes/client-node": [],
"@figma/nodegit": [
"no-sandbox",
# Workaround Engflow not honoring requires-network on build actions
"no-remote-exec",
"requires-network",
],
"esbuild": [
"no-sandbox",
# Workaround Engflow not honoring requires-network on build actions
"no-remote-exec",
"requires-network",
],
"segfault-handler": [
"no-sandbox",
# Workaround Engflow not honoring requires-network on build actions
"no-remote-exec",
"requires-network",
],
"puppeteer": [
"no-sandbox",
# Workaround Engflow not honoring requires-network on build actions
"no-remote-exec",
"requires-network",
],
},
Expand Down
8 changes: 0 additions & 8 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -120,26 +120,18 @@ npm_translate_lock(
"@kubernetes/client-node": [],
"@figma/nodegit": [
"no-sandbox",
# Workaround Engflow not honoring requires-network on build actions
"no-remote-exec",
"requires-network",
],
"esbuild": [
"no-sandbox",
# Workaround Engflow not honoring requires-network on build actions
"no-remote-exec",
"requires-network",
],
"segfault-handler": [
"no-sandbox",
# Workaround Engflow not honoring requires-network on build actions
"no-remote-exec",
"requires-network",
],
"puppeteer": [
"no-sandbox",
# Workaround Engflow not honoring requires-network on build actions
"no-remote-exec",
"requires-network",
],
},
Expand Down
6 changes: 1 addition & 5 deletions e2e/npm_link_package-esm/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ npm_translate_lock(
"sharp": ["APPDATA=."],
},
lifecycle_hooks_execution_requirements = {
"sharp": [
# Workaround Engflow not honoring requires-network on build actions
"no-remote-exec",
"requires-network",
],
"sharp": ["requires-network"],
},
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
Expand Down
6 changes: 1 addition & 5 deletions e2e/npm_link_package/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ npm_translate_lock(
"sharp": ["APPDATA=."],
},
lifecycle_hooks_execution_requirements = {
"sharp": [
# Workaround Engflow not honoring requires-network on build actions
"no-remote-exec",
"requires-network",
],
"sharp": ["requires-network"],
},
npm_package_target_name = "{dirname}_pkg",
pnpm_lock = "//:pnpm-lock.yaml",
Expand Down
2 changes: 2 additions & 0 deletions js/private/test/image/structure/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ js_image_layer(
compression = "none",
platform = ":amd64_linux",
root = "/app",
# TODO: figure out why the digests_generated.sum is different on buildbuddy executors
tags = ["no-remote-exec"],
)

filegroup(
Expand Down
2 changes: 1 addition & 1 deletion js/private/test/image/structure/digests.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
020eddc540c3859f483447afe6934e735e830b644db4cab77117bb1e3ac4d16c
38599e1bb75e2446121490c4e4fac2a1256c2f35ef0805daa432ab2935f19291
da1b55242e360edac2456ec4e1e7cd0a88b052ee075bef7ef620d62985751f30
2 changes: 1 addition & 1 deletion js/private/test/image/structure/main.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const acorn = require('acorn')
console.log(acorn.version)
console.log('acorn version:', acorn.version)
10 changes: 5 additions & 5 deletions npm/private/test/repositories_checked.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,7 @@ def npm_repositories():
"universalify": ["0.1.2"],
},
lifecycle_hooks = ["preinstall", "install", "postinstall"],
lifecycle_hooks_execution_requirements = ["no-sandbox", "no-remote-exec", "requires-network"],
lifecycle_hooks_execution_requirements = ["no-sandbox", "requires-network"],
)

npm_import(
Expand Down Expand Up @@ -9448,7 +9448,7 @@ def npm_repositories():
"esbuild-windows-arm64": ["0.14.38"],
},
lifecycle_hooks = ["preinstall", "install", "postinstall"],
lifecycle_hooks_execution_requirements = ["no-sandbox", "no-remote-exec", "requires-network"],
lifecycle_hooks_execution_requirements = ["no-sandbox", "requires-network"],
)

npm_import(
Expand Down Expand Up @@ -9513,7 +9513,7 @@ def npm_repositories():
"@esbuild/win32-x64": ["0.16.17"],
},
lifecycle_hooks = ["preinstall", "install", "postinstall"],
lifecycle_hooks_execution_requirements = ["no-sandbox", "no-remote-exec", "requires-network"],
lifecycle_hooks_execution_requirements = ["no-sandbox", "requires-network"],
)

npm_import(
Expand Down Expand Up @@ -18595,7 +18595,7 @@ def npm_repositories():
"wrap-ansi": ["7.0.0"],
},
lifecycle_hooks = ["preinstall", "install", "postinstall"],
lifecycle_hooks_execution_requirements = ["no-sandbox", "no-remote-exec", "requires-network"],
lifecycle_hooks_execution_requirements = ["no-sandbox", "requires-network"],
)

npm_import(
Expand Down Expand Up @@ -20318,7 +20318,7 @@ def npm_repositories():
"file-uri-to-path": ["1.0.0"],
},
lifecycle_hooks = ["preinstall", "install", "postinstall"],
lifecycle_hooks_execution_requirements = ["no-sandbox", "no-remote-exec", "requires-network"],
lifecycle_hooks_execution_requirements = ["no-sandbox", "requires-network"],
)

npm_import(
Expand Down

0 comments on commit 198ec6f

Please sign in to comment.