Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.bazel-user-root
.bazelisk-home
28 changes: 28 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
common --noenable_bzlmod
# Let the OS-specific sections below (`common:linux`, `common:macos`, etc.)
# take effect so one `.bazelrc` can carry the required per-platform C++ flags.
common --enable_platform_specific_config
common --experimental_repo_remote_exec # from TensorFlow
# Bazel-generated Python package init files can shadow TensorBoard's real
# compat package init at test runtime; keep this test-only so pip packaging
# still copies the intended package tree.
test --incompatible_default_to_explicit_init_py

# Use C++ backing implementations for Python proto parsing and deserialization,
# which is much faster (~10x).
build --define=use_fast_cpp_protos=true

# Protobuf 6.31.1 requires C++17 in this build. Keep the host and target
# language level aligned across supported platforms.
common:linux --cxxopt=-std=c++17
common:linux --host_cxxopt=-std=c++17
common:macos --cxxopt=-std=c++17
common:macos --host_cxxopt=-std=c++17
common:windows --cxxopt=/std:c++17
common:windows --host_cxxopt=/std:c++17

# Local shells and virtualenvs can leak Python import state into Bazel tests,
# which then import from the wrong environment instead of the test runfiles.
test --test_env=PYTHONPATH=
test --test_env=PYTHONHOME=
test --test_env=PYTHONSTARTUP=
test --test_env=PYTHONSAFEPATH=
test --test_env=PYTHONNOUSERSITE=1
test --test_env=PYTHONUSERBASE=
test --test_env=BUILD_WORKSPACE_DIRECTORY=
test --test_env=BUILD_WORKING_DIRECTORY=
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.7.0
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
* text=auto
*.bzl text eol=lf
*.sh text eol=lf
.bazel* text eol=lf
BUILD text eol=lf
BUILD.bazel text eol=lf
WORKSPACE text eol=lf
MODULE.bazel text eol=lf

third_party/rust/** -diff -merge linguist-generated=true
67 changes: 52 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ permissions:
env:
# Keep this Bazel version in sync with the `versions.check` directive
# in our WORKSPACE file.
BAZEL_VERSION: '6.5.0'
BAZEL_SHA256SUM: 'a40ac69263440761199fcb8da47ad4e3f328cbe79ffbf4ecc14e5ba252857307'
BAZEL_VERSION: '7.7.0'
BAZEL_SHA256SUM: 'fe7e799cbc9140f986b063e06800a3d4c790525075c877d00a7112669824acbf'
BUILDTOOLS_VERSION: '3.0.0'
BUILDIFIER_SHA256SUM: 'e92a6793c7134c5431c58fbc34700664f101e5c9b1c1fcd93b97978e8b7f88db'
BUILDOZER_SHA256SUM: '3d58a0b6972e4535718cdd6c12778170ea7382de7c75bc3728f5719437ffb84d'
Expand All @@ -48,13 +48,40 @@ jobs:
fail-fast: false
matrix:
tf_version_id: ['tf', 'notf']
python_version: ['3.9']
python_version: ['3.10']
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # v4.3.0
with:
python-version: ${{ matrix.python_version }}
architecture: 'x64'
# Use the container's system Python installation path instead of
# actions/setup-python so Bazel's @system_python repo sees a standard
# interpreter/header layout.
- name: 'Set up Python and system dependencies'
run: |
py_abi="python${{ matrix.python_version }}"
sudo apt-get update
sudo apt-get install -y \
"${py_abi}" \
"${py_abi}-dev" \
"${py_abi}-venv" \
libgbm-dev \
libxss1 \
libasound2
"/usr/bin/${py_abi}" -m venv /tmp/tb-build-venv
echo "/tmp/tb-build-venv/bin" >> "${GITHUB_PATH}"
echo "VIRTUAL_ENV=/tmp/tb-build-venv" >> "${GITHUB_ENV}"
/tmp/tb-build-venv/bin/python -m pip install -U pip setuptools wheel virtualenv
- name: 'Check Python toolchain'
run: |
python --version
python - <<'PY'
import pathlib
import sys
import sysconfig

print("sys.executable =", sys.executable)
include_dir = pathlib.Path(sysconfig.get_config_var("INCLUDEPY"))
print("INCLUDEPY =", include_dir)
print("Python.h exists =", (include_dir / "Python.h").exists())
PY
- name: 'Set up Bazel'
run: |
ci/download_bazel.sh "${BAZEL_VERSION}" "${BAZEL_SHA256SUM}" ~/bazel
Expand All @@ -65,6 +92,11 @@ jobs:
run: |
python -m pip install -U pip
pip install "${TENSORFLOW_VERSION}"
# tf-nightly currently pulls in tb-nightly as a dependency. Bazel's
# source-tree tests must import TensorBoard from runfiles rather than
# from site-packages, otherwise tests that rely on local-only modules
# like `tensorboard.test` resolve against the installed wheel and fail.
pip uninstall -y tensorboard tb-nightly || true
if: matrix.tf_version_id != 'notf'
- name: 'Install Python dependencies'
run: |
Expand All @@ -73,10 +105,6 @@ jobs:
-r ./tensorboard/pip_package/requirements.txt \
-r ./tensorboard/pip_package/requirements_dev.txt \
;
- name: 'Install Chrome dependencies'
run: |
sudo apt-get update
sudo apt-get install -y libgbm-dev libxss1 libasound2
- name: 'Check Pip state'
run: pip freeze --all
- name: 'Bazel: fetch'
Expand All @@ -98,13 +126,21 @@ jobs:
if: matrix.tf_version_id == 'notf'
- name: 'Bazel: run Pip package test (with TensorFlow support)'
run: |
bazel run //tensorboard/pip_package:test_pip_package -- \
# `bazel run` has been flaky under this self-hosted container runner
# even when the smoke test itself completes successfully. Build the
# launcher target, invoke the generated binary directly, then shut
# down the Bazel server so the step exits cleanly.
bazel build //tensorboard/pip_package:test_pip_package
./bazel-bin/tensorboard/pip_package/test_pip_package \
--tf-version "${TENSORFLOW_VERSION}"
bazel shutdown
if: matrix.tf_version_id != 'notf'
- name: 'Bazel: run Pip package test (non-TensorFlow only)'
run: |
bazel run //tensorboard/pip_package:test_pip_package -- \
bazel build //tensorboard/pip_package:test_pip_package
./bazel-bin/tensorboard/pip_package/test_pip_package \
--tf-version notf
bazel shutdown
if: matrix.tf_version_id == 'notf'
- name: 'Bazel: run manual tests'
run: |
Expand Down Expand Up @@ -310,7 +346,8 @@ jobs:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: 16
# Angular v17 supports node.js versions: v18.13.0 and newer
node-version: 18
- run: yarn install --ignore-engines
# You can run `yarn fix-lint` to fix all Prettier complaints, although at this point this will try to fix too many things.
# To fix only the files changed in this PR, see the command below.
Expand All @@ -321,7 +358,7 @@ jobs:
# Make sure no one depends on Angular material and CDK directly. Please
# import the indirection in //tensorboard/webapp/angular.
- run: |
! git grep -E '"@npm//@angular/material"|"@npm//@angular/cdk"' 'tensorboard/*/BUILD' ':!tensorboard/webapp/BUILD' ':!tensorboard/webapp/angular/BUILD'
! git grep -E '"@npm//@angular/material"|"@npm//@angular/cdk"' 'tensorboard/*/BUILD' ':!tensorboard/webapp/angular/BUILD' ':!tensorboard/webapp/angular_components/BUILD'
# Cannot directly depend on d3 in webapp. Must depend on
# `//tensorboard/webapp/third_party:d3` instead.
- run: |
Expand Down
Loading
Loading