Skip to content

Commit b8afeb7

Browse files
authored
Updates CI workflow to run on self-hosted runner (#7040)
## Motivation for features / changes The standard runners provided by GitHub started running out of space, so we set up self-hosted runners. By internal policy, these runners cannot publish artifacts, e.g. to PyPI, so the nightly workflows will need to be update to be produced by separate infra, but at least this unblocks CI runs for PRs and such. This change also removes the BUILD cache that was not actually used before due to misconfiguration issue. To reduce maintenance burden related to internal security policy and processes, the storage bucket that was used for this purpose had public access removed, so we're simply not using this anymore either way. Note that this PR accomplishes the objective, which is to start running CI workflows in a self-hosted runner. However, tests seem to be failing in the new environment, and thus the CI workflow itself is failing. I will proceed to merge this change, bypassing the requirement for the CI workflow to be successful, and we should address the test failures in one or more separate PRs.
1 parent ab697c3 commit b8afeb7

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,17 @@ env:
3232
BUILDOZER_SHA256SUM: '3d58a0b6972e4535718cdd6c12778170ea7382de7c75bc3728f5719437ffb84d'
3333
TENSORFLOW_VERSION: 'tf-nightly'
3434

35+
defaults:
36+
run:
37+
shell: bash
38+
3539
jobs:
3640
build:
37-
runs-on: ubuntu-22.04
41+
# Self-hosted runner since the ones provided by GH were running out of space.
42+
# Other workflows are likely ok to use standard GH runners for now.
43+
# Googlers, see b/460874304.
44+
runs-on: linux-x86-n2-32
45+
container: us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build:latest
3846
needs: lint-python-flake8 # fail fast in case of "undefined variable" errors
3947
strategy:
4048
fail-fast: false
@@ -53,26 +61,6 @@ jobs:
5361
sudo mv ~/bazel /usr/local/bin/bazel
5462
sudo chmod +x /usr/local/bin/bazel
5563
cp ./ci/bazelrc ~/.bazelrc
56-
- name: 'Configure build cache write credentials'
57-
env:
58-
CREDS: ${{ secrets.BAZEL_CACHE_SERVICE_ACCOUNT_CREDS }}
59-
EVENT_TYPE: ${{ github.event_name }}
60-
run: |
61-
if [ -z "${CREDS}" ]; then
62-
printf 'Using read-only cache (no credentials)\n'
63-
exit
64-
fi
65-
if [ "${EVENT_TYPE}" = pull_request ]; then
66-
printf 'Using read-only cache (PR build)\n'
67-
exit
68-
fi
69-
printf 'Using writable cache\n'
70-
creds_file=/tmp/service_account_creds.json
71-
printf '%s\n' "${CREDS}" >"${creds_file}"
72-
printf '%s\n' >>~/.bazelrc \
73-
"common --google_credentials=${creds_file}" \
74-
"common --remote_upload_local_results=true" \
75-
;
7664
- name: 'Install TensorFlow'
7765
run: |
7866
python -m pip install -U pip

0 commit comments

Comments
 (0)