Skip to content

Commit 380cf4e

Browse files
[actions] Use remote buildbuddy execution for perf actions (#1417)
Summary: Uses the remote buildbuddy executors to run bazel builds for perf experiments. Type of change: /kind test-infra Test Plan: Tested by pushing a branch and [manually triggering](https://github.com/pixie-io/pixie/actions/runs/5191523093). Cancelled it before the last one finished because I tore down the executors it was running on but it clearly works if the other 5 experiments were passing. Signed-off-by: James Bartlett <jamesbartlett@pixielabs.ai>
1 parent 56d24c9 commit 380cf4e

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

.github/workflows/perf_common.yaml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,9 @@ jobs:
3434
ref: ${{ inputs.ref }}
3535
generate-perf-matrix:
3636
needs: get-dev-image-with-extras
37-
runs-on: [self-hosted, nokvm]
37+
runs-on: ubuntu-latest-16-cores
3838
container:
3939
image: ${{ needs.get-dev-image-with-extras.outputs.image-with-tag }}
40-
options: --cpus 15
41-
volumes:
42-
- /etc/bazelrc:/etc/bazelrc
4340
outputs:
4441
matrix: ${{ steps.set-matrix.outputs.matrix }}
4542
steps:
@@ -50,6 +47,9 @@ jobs:
5047
run: git config --global --add safe.directory `pwd`
5148
- name: Use github bazel config
5249
uses: ./.github/actions/bazelrc
50+
with:
51+
use_remote_exec: 'true'
52+
BB_API_KEY: ${{ secrets.BB_IO_API_KEY }}
5353
- name: Set matrix
5454
id: set-matrix
5555
run: |
@@ -58,12 +58,9 @@ jobs:
5858
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
5959
run-perf-eval:
6060
needs: [get-dev-image-with-extras, generate-perf-matrix]
61-
runs-on: [self-hosted, nokvm]
61+
runs-on: ubuntu-latest-16-cores
6262
container:
6363
image: ${{ needs.get-dev-image-with-extras.outputs.image-with-tag }}
64-
options: --cpus 15
65-
volumes:
66-
- /etc/bazelrc:/etc/bazelrc
6764
strategy:
6865
matrix: ${{ fromJson(needs.generate-perf-matrix.outputs.matrix) }}
6966
fail-fast: false
@@ -72,10 +69,6 @@ jobs:
7269
with:
7370
ref: ${{ inputs.ref }}
7471
fetch-depth: 0
75-
- id: create-gcloud-key
76-
env:
77-
SERVICE_ACCOUNT_KEY: ${{ secrets.PERF_GCLOUD_KEY }}
78-
run: echo "$SERVICE_ACCOUNT_KEY" | base64 --decode > /tmp/gcloud.json && chmod 600 /tmp/gcloud.json
7972
- name: Add pwd to git safe dir
8073
run: git config --global --add safe.directory `pwd`
8174
- id: get-commit-sha
@@ -85,23 +78,23 @@ jobs:
8578
- name: Use github bazel config
8679
uses: ./.github/actions/bazelrc
8780
with:
81+
use_remote_exec: 'true'
82+
BB_API_KEY: ${{ secrets.BB_IO_API_KEY }}
8883
download_toplevel: 'true'
89-
- name: activate gcloud service account
90-
env:
91-
GOOGLE_APPLICATION_CREDENTIALS: "/tmp/gcloud.json"
92-
run: |
93-
service_account="$(jq -r '.client_email' "$GOOGLE_APPLICATION_CREDENTIALS")"
94-
gcloud auth activate-service-account "${service_account}" --key-file="$GOOGLE_APPLICATION_CREDENTIALS"
9584
- name: Install Pixie CLI
9685
run: |
9786
bazel build -c opt //src/pixie_cli:px
9887
p="$(bazel cquery -c opt //src/pixie_cli:px --output starlark --starlark:expr 'target.files.to_list()[0].path')"
9988
cp "${p}" /usr/bin/px
89+
- id: gcloud-creds
90+
uses: ./.github/actions/gcloud_creds
91+
with:
92+
SERVICE_ACCOUNT_KEY: ${{ secrets.PERF_GCLOUD_KEY }}
10093
- name: Run perf for ${{ matrix.suite }}/${{ matrix.experiment_name }}
10194
id: run-perf
10295
env:
10396
PX_API_KEY: ${{ secrets.PERF_PX_API_KEY }}
104-
GOOGLE_APPLICATION_CREDENTIALS: "/tmp/gcloud.json"
97+
GOOGLE_APPLICATION_CREDENTIALS: ${{ steps.gcloud-creds.outputs.gcloud-creds }}
10598
# yamllint disable rule:indentation
10699
run: |
107100
echo "$GOOGLE_APPLICATION_CREDENTIALS"

0 commit comments

Comments
 (0)