From 47952463eb55adc1e5725b0575d1d1abfc6c30a1 Mon Sep 17 00:00:00 2001 From: Adrian RC Date: Wed, 17 Dec 2025 23:33:40 +0000 Subject: [PATCH 01/10] Updates CI workflow to run on self-hosted runner --- .github/workflows/ci.yml | 44 ++++------------------------------------ 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c509b97d2b..0ef87109cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,10 @@ env: jobs: build: - runs-on: ubuntu-22.04 + # Self-hosted runner since the ones provided by GH were running out of space. + # Other workflows are likely ok to use standard GH runners for now. + # Googlers, see b/460874304. + runs-on: linux-x86-n2-32 needs: lint-python-flake8 # fail fast in case of "undefined variable" errors strategy: fail-fast: false @@ -53,26 +56,6 @@ jobs: sudo mv ~/bazel /usr/local/bin/bazel sudo chmod +x /usr/local/bin/bazel cp ./ci/bazelrc ~/.bazelrc - - name: 'Configure build cache write credentials' - env: - CREDS: ${{ secrets.BAZEL_CACHE_SERVICE_ACCOUNT_CREDS }} - EVENT_TYPE: ${{ github.event_name }} - run: | - if [ -z "${CREDS}" ]; then - printf 'Using read-only cache (no credentials)\n' - exit - fi - if [ "${EVENT_TYPE}" = pull_request ]; then - printf 'Using read-only cache (PR build)\n' - exit - fi - printf 'Using writable cache\n' - creds_file=/tmp/service_account_creds.json - printf '%s\n' "${CREDS}" >"${creds_file}" - printf '%s\n' >>~/.bazelrc \ - "common --google_credentials=${creds_file}" \ - "common --remote_upload_local_results=true" \ - ; - name: 'Install TensorFlow' run: | python -m pip install -U pip @@ -120,25 +103,6 @@ jobs: bazel test //tensorboard/summary/writer:event_file_writer_s3_test && bazel test //tensorboard/compat/tensorflow_stub:gfile_fsspec_test && bazel test //tensorboard/summary/writer:event_file_writer_fsspec_test - - name: 'Bazel: build Pip package (master branch TF build only)' - # This pip package is only needed if we will upload it, so run this step - # only under the same conditions as the next step (see comment below). - if: matrix.tf_version_id == 'tf' && github.repository == 'tensorflow/tensorboard' && github.ref == 'refs/heads/master' - run: | - ./tensorboard/tools/set_nightly_version.sh - rm -rf /tmp/tb_nightly_pip_package && mkdir /tmp/tb_nightly_pip_package - bazel run //tensorboard/pip_package:build_pip_package -- /tmp/tb_nightly_pip_package - - name: 'Upload Pip package as an artifact (master branch TF build only)' - # Prevent uploads when running on forks or non-master branch. - # - # Note that upload-artifact GH action, starting in v4, requires the name of the uploaded - # file(s) to be unique per workflow run, so make sure that the name is unique for each - # "matrix" combination for which this is executed. - if: matrix.tf_version_id == 'tf' && github.repository == 'tensorflow/tensorboard' && github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v4 - with: - name: tb-nightly_py${{ matrix.python_version }} - path: /tmp/tb_nightly_pip_package/* build-data-server-pip: runs-on: ${{ matrix.platform }} From 59490fc630d678661783491b3fdb6c094ad74203 Mon Sep 17 00:00:00 2001 From: Adrian RC Date: Wed, 17 Dec 2025 23:43:42 +0000 Subject: [PATCH 02/10] Reverts deletion of artifact upload --- .github/workflows/ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ef87109cb..ab5427e723 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,6 +103,25 @@ jobs: bazel test //tensorboard/summary/writer:event_file_writer_s3_test && bazel test //tensorboard/compat/tensorflow_stub:gfile_fsspec_test && bazel test //tensorboard/summary/writer:event_file_writer_fsspec_test + - name: 'Bazel: build Pip package (master branch TF build only)' + # This pip package is only needed if we will upload it, so run this step + # only under the same conditions as the next step (see comment below). + if: matrix.tf_version_id == 'tf' && github.repository == 'tensorflow/tensorboard' && github.ref == 'refs/heads/master' + run: | + ./tensorboard/tools/set_nightly_version.sh + rm -rf /tmp/tb_nightly_pip_package && mkdir /tmp/tb_nightly_pip_package + bazel run //tensorboard/pip_package:build_pip_package -- /tmp/tb_nightly_pip_package + - name: 'Upload Pip package as an artifact (master branch TF build only)' + # Prevent uploads when running on forks or non-master branch. + # + # Note that upload-artifact GH action, starting in v4, requires the name of the uploaded + # file(s) to be unique per workflow run, so make sure that the name is unique for each + # "matrix" combination for which this is executed. + if: matrix.tf_version_id == 'tf' && github.repository == 'tensorflow/tensorboard' && github.ref == 'refs/heads/master' + uses: actions/upload-artifact@v4 + with: + name: tb-nightly_py${{ matrix.python_version }} + path: /tmp/tb_nightly_pip_package/* build-data-server-pip: runs-on: ${{ matrix.platform }} From 0d88eca263f6c578cfe2f4c5221e2f69b2f5b19e Mon Sep 17 00:00:00 2001 From: Adrian RC Date: Wed, 17 Dec 2025 23:50:46 +0000 Subject: [PATCH 03/10] adds a container setting to build job --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab5427e723..89af17e21a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,7 @@ jobs: # Other workflows are likely ok to use standard GH runners for now. # Googlers, see b/460874304. runs-on: linux-x86-n2-32 + container: jobs.build.container needs: lint-python-flake8 # fail fast in case of "undefined variable" errors strategy: fail-fast: false From 7db76fb7760f75389ab492807cd324139e2a25cf Mon Sep 17 00:00:00 2001 From: Adrian RC Date: Thu, 18 Dec 2025 00:21:19 +0000 Subject: [PATCH 04/10] updates container to reference ubuntu-22.04 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89af17e21a..ad4e9222cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: # Other workflows are likely ok to use standard GH runners for now. # Googlers, see b/460874304. runs-on: linux-x86-n2-32 - container: jobs.build.container + container: ubuntu-22.04 needs: lint-python-flake8 # fail fast in case of "undefined variable" errors strategy: fail-fast: false From e2bf0ce3abb41e78fa898f96087c6dfa15a37354 Mon Sep 17 00:00:00 2001 From: Adrian RC Date: Thu, 18 Dec 2025 00:40:17 +0000 Subject: [PATCH 05/10] updates container to reference ubuntu:22.04 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad4e9222cd..0584196617 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: # Other workflows are likely ok to use standard GH runners for now. # Googlers, see b/460874304. runs-on: linux-x86-n2-32 - container: ubuntu-22.04 + container: ubuntu:22.04 needs: lint-python-flake8 # fail fast in case of "undefined variable" errors strategy: fail-fast: false From e5724cbbe264e6ef65dfc2f0b242653913b555ef Mon Sep 17 00:00:00 2001 From: Adrian RC Date: Thu, 18 Dec 2025 01:00:38 +0000 Subject: [PATCH 06/10] updates container reference to custom ml container --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0584196617..7f0e2f3a75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: # Other workflows are likely ok to use standard GH runners for now. # Googlers, see b/460874304. runs-on: linux-x86-n2-32 - container: ubuntu:22.04 + container: us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build:latest needs: lint-python-flake8 # fail fast in case of "undefined variable" errors strategy: fail-fast: false From 65de4c74b50df2fb835281696ea0e6e7c42ea839 Mon Sep 17 00:00:00 2001 From: Adrian RC Date: Thu, 18 Dec 2025 01:29:05 +0000 Subject: [PATCH 07/10] updates bash operator to more universally supported one --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f0e2f3a75..cfc9a9845e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,8 +79,8 @@ jobs: # for removing this kludge. run: | ( set -o pipefail; - bazel build //tensorboard/... |&\ - grep -v 'external/com_google_protobuf/python: warning: directory' |&\ + bazel build //tensorboard/... 2>&1 |\ + grep -v 'external/com_google_protobuf/python: warning: directory' 2>&1 |\ grep -v 'INFO: From ProtoCompile ' ) - name: 'Bazel: test (with TensorFlow support)' run: bazel test //tensorboard/... From db4d792c8b2f26924e963ca87c00533ea1d01d55 Mon Sep 17 00:00:00 2001 From: Adrian RC Date: Thu, 18 Dec 2025 19:53:56 +0000 Subject: [PATCH 08/10] Set bash as default shell to use --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfc9a9845e..996c71ffa2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,10 @@ env: BUILDOZER_SHA256SUM: '3d58a0b6972e4535718cdd6c12778170ea7382de7c75bc3728f5719437ffb84d' TENSORFLOW_VERSION: 'tf-nightly' +defaults: + run: + shell: bash + jobs: build: # Self-hosted runner since the ones provided by GH were running out of space. @@ -79,8 +83,8 @@ jobs: # for removing this kludge. run: | ( set -o pipefail; - bazel build //tensorboard/... 2>&1 |\ - grep -v 'external/com_google_protobuf/python: warning: directory' 2>&1 |\ + bazel build //tensorboard/... |&\ + grep -v 'external/com_google_protobuf/python: warning: directory' |&\ grep -v 'INFO: From ProtoCompile ' ) - name: 'Bazel: test (with TensorFlow support)' run: bazel test //tensorboard/... From 24bdaa386b319cfaa5d81674c279c30750d4dfab Mon Sep 17 00:00:00 2001 From: Adrian RC Date: Thu, 18 Dec 2025 23:19:37 +0000 Subject: [PATCH 09/10] changes test to attempt to avoid some errors --- tensorboard/program_test.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tensorboard/program_test.py b/tensorboard/program_test.py index 68a9a51ea7..aeaa48434a 100644 --- a/tensorboard/program_test.py +++ b/tensorboard/program_test.py @@ -125,6 +125,7 @@ def testMakeServerBlankHost(self): self._StubApplication(), self.make_flags(port=0, path_prefix="") ) self.assertStartsWith(server.get_url(), "http://") + server.shutdown() def testPathPrefixSlash(self): # Test that checks the path prefix ends with one trailing slash @@ -133,12 +134,14 @@ def testPathPrefixSlash(self): self.make_flags(port=0, path_prefix="/test"), ) self.assertEndsWith(server.get_url(), "/test/") + server.shutdown() server = program.WerkzeugServer( self._StubApplication(), self.make_flags(port=0, path_prefix="/test/"), ) self.assertEndsWith(server.get_url(), "/test/") + server.shutdown() def testSpecifiedHost(self): one_passed = False @@ -148,6 +151,7 @@ def testSpecifiedHost(self): self.make_flags(host="127.0.0.1", port=0, path_prefix=""), ) self.assertStartsWith(server.get_url(), "http://127.0.0.1:") + server.shutdown() one_passed = True except program.TensorBoardServerException: # IPv4 is not supported @@ -158,6 +162,7 @@ def testSpecifiedHost(self): self.make_flags(host="::1", port=0, path_prefix=""), ) self.assertStartsWith(server.get_url(), "http://[::1]:") + server.shutdown() one_passed = True except program.TensorBoardServerException: # IPv6 is not supported From 5326df6c4f0f5c890f2b9d3ec90b5e545f07c93e Mon Sep 17 00:00:00 2001 From: Adrian RC Date: Fri, 19 Dec 2025 00:46:07 +0000 Subject: [PATCH 10/10] Undoes changes to tests --- tensorboard/program_test.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tensorboard/program_test.py b/tensorboard/program_test.py index aeaa48434a..68a9a51ea7 100644 --- a/tensorboard/program_test.py +++ b/tensorboard/program_test.py @@ -125,7 +125,6 @@ def testMakeServerBlankHost(self): self._StubApplication(), self.make_flags(port=0, path_prefix="") ) self.assertStartsWith(server.get_url(), "http://") - server.shutdown() def testPathPrefixSlash(self): # Test that checks the path prefix ends with one trailing slash @@ -134,14 +133,12 @@ def testPathPrefixSlash(self): self.make_flags(port=0, path_prefix="/test"), ) self.assertEndsWith(server.get_url(), "/test/") - server.shutdown() server = program.WerkzeugServer( self._StubApplication(), self.make_flags(port=0, path_prefix="/test/"), ) self.assertEndsWith(server.get_url(), "/test/") - server.shutdown() def testSpecifiedHost(self): one_passed = False @@ -151,7 +148,6 @@ def testSpecifiedHost(self): self.make_flags(host="127.0.0.1", port=0, path_prefix=""), ) self.assertStartsWith(server.get_url(), "http://127.0.0.1:") - server.shutdown() one_passed = True except program.TensorBoardServerException: # IPv4 is not supported @@ -162,7 +158,6 @@ def testSpecifiedHost(self): self.make_flags(host="::1", port=0, path_prefix=""), ) self.assertStartsWith(server.get_url(), "http://[::1]:") - server.shutdown() one_passed = True except program.TensorBoardServerException: # IPv6 is not supported