Skip to content

Commit acd6a2d

Browse files
Internal infrastructure change.
PiperOrigin-RevId: 876264616
1 parent 55784fc commit acd6a2d

File tree

25 files changed

+225
-179
lines changed

25 files changed

+225
-179
lines changed

.bazelversion

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
7.7.0
2+
# TODO: b/390391579 - Upgrade once bazel 8+ works.

BUILD

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ py_library(
33
# This is a dummy rule used as a absl dependency in open-source.
44
# We expect absl to already be installed on the system, e.g. via
55
# `pip install absl`
6+
# strict_deps = False,
67
visibility = ["//visibility:public"],
78
deps = [],
89
)
@@ -12,6 +13,7 @@ py_library(
1213
# This is a dummy rule used as a absl dependency in open-source.
1314
# We expect absl to already be installed on the system, e.g. via
1415
# `pip install absl`
16+
# strict_deps = False,
1517
visibility = ["//visibility:public"],
1618
deps = [],
1719
)
@@ -21,6 +23,7 @@ py_library(
2123
# This is a dummy rule used as a absl dependency in open-source.
2224
# We expect absl to already be installed on the system, e.g. via
2325
# `pip install absl`
26+
# strict_deps = False,
2427
visibility = ["//visibility:public"],
2528
deps = [],
2629
)
@@ -30,6 +33,7 @@ py_library(
3033
# This is a dummy rule used as a numpy dependency in open-source.
3134
# We expect numpy to already be installed on the system, e.g. via
3235
# `pip install numpy`
36+
# strict_deps = False,
3337
visibility = ["//visibility:public"],
3438
deps = [],
3539
)
@@ -39,6 +43,7 @@ py_library(
3943
# This is a dummy rule used as a tensorflow dependency in open-source.
4044
# We expect tensorflow to already be installed on the system, e.g. via
4145
# `pip install tensorflow`
46+
# strict_deps = False,
4247
visibility = ["//visibility:public"],
4348
deps = [],
4449
)
@@ -48,6 +53,7 @@ py_library(
4853
# This is a dummy rule used as a ai-edge-litert dependency in open-source.
4954
# We expect ai-edge-litert to already be installed on the system, e.g. via
5055
# `pip install ai-edge-litert`
56+
# strict_deps = False,
5157
visibility = ["//visibility:public"],
5258
deps = [],
5359
)
@@ -57,6 +63,7 @@ py_library(
5763
# This is a dummy rule used as a tensorflow dependency in open-source.
5864
# We expect tensorflow to already be installed on the system, e.g. via
5965
# `pip install tensorflow`
66+
# strict_deps = False,
6067
visibility = ["//visibility:public"],
6168
deps = [],
6269
)
@@ -66,6 +73,7 @@ py_library(
6673
# This is a dummy rule used as a dependency on vizier.service.pyvizier in open-source.
6774
# We expect Vizier to already be installed on the system, e.g. via
6875
# `pip install google-vizier` and extra steps if needed (b/254806045).
76+
# strict_deps = False,
6977
visibility = ["//visibility:public"],
7078
deps = [],
7179
)
@@ -75,6 +83,7 @@ py_library(
7583
# This is a dummy rule used as a mock dependency in open-source tests.
7684
# We expect mock to already be installed on the system, e.g. via
7785
# `pip install mock`
86+
# strict_deps = False,
7887
visibility = ["//visibility:public"],
7988
deps = [],
8089
)

kokoro/github/ubuntu/cpu/build.sh

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ set -x
1919
PYENV_ROOT="/home/kbuilder/.pyenv"
2020
PYTHON_VERSION=${PYTHON_VERSION:-"3.11"}
2121

22-
echo "Installing pyenv.."
23-
git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT"
22+
if [[ ! -d "$PYENV_ROOT" ]]; then
23+
echo "Installing pyenv.."
24+
git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT"
25+
fi
2426
export PATH="/home/kbuilder/.local/bin:$PYENV_ROOT/bin:$PATH"
2527
eval "$(pyenv init --path)"
2628

@@ -32,21 +34,23 @@ cd "${KOKORO_ARTIFACTS_DIR}/github/gnn/"
3234

3335
PIP_TEST_PREFIX=bazel_pip
3436

35-
python -m venv venv
36-
source venv/bin/activate
37+
python -m venv build_venv
38+
source build_venv/bin/activate
3739

3840
# Check the python version
3941
python --version
40-
python3 --version
4142

4243
# update pip
4344
pip install --upgrade pip
4445

46+
# Install build
47+
pip install build
48+
4549
TEST_ROOT=$(pwd)/${PIP_TEST_PREFIX}
4650
rm -rf "$TEST_ROOT"
4751
mkdir -p "$TEST_ROOT"
4852
ln -s "$(pwd)"/tensorflow_gnn "$TEST_ROOT"/tensorflow_gnn
49-
tag_filters="-no_oss,-oss_excluded"
53+
tag_filters="-no_oss,-oss_excluded${TAG_FILTERS}"
5054

5155
# Check that `bazel` does version selection as expected.
5256
if [[ -n "${USE_BAZEL_VERSION}" && $(bazel --version) != *${USE_BAZEL_VERSION}* ]]; then
@@ -55,25 +59,35 @@ if [[ -n "${USE_BAZEL_VERSION}" && $(bazel --version) != *${USE_BAZEL_VERSION}*
5559
fi
5660

5761
bazel clean
58-
pip install -r requirements-dev.txt --progress-bar off
59-
pip install tf-keras-nightly tf-nightly --progress-bar off --upgrade
60-
# We need to remove the dependency on tensorflow to test nightly
61-
# The dependencies will be provided by tf-nightly
62-
perl -i -lpe '$k+= s/tensorflow>=2\.[0-9]+\.[0-9]+(,<=?[0-9.]+)?;/tf-nightly;/g; END{exit($k != 1)}' setup.py
63-
# tf-nightly 2.21 lifted the protobuf version to what google-vizier 0.1.24 wants
64-
# but what google-vizier 0.1.21 together with apache-beam does not allow.
65-
# TODO: b/482003228 - Replace this patch by a proper dependency cleanup.
66-
perl -i -lpe '$k+= s/google-vizier>=0.0.13,!=0.1.23,!=0.1.24/google-vizier>=0.0.13,!=0.1.23/g; END{exit($k != 1)}' setup.py
67-
python3 setup.py bdist_wheel
68-
pip uninstall -y tensorflow_gnn
69-
pip install dist/tensorflow_gnn-*.whl
62+
pip install --group test-nightly --progress-bar off --upgrade
63+
python3 -m build --wheel
64+
deactivate
65+
66+
# Start the test environment.
67+
python3 -m venv test_venv
68+
source test_venv/bin/activate
69+
70+
# Check the python version
71+
python --version
72+
73+
pip install --upgrade pip
74+
tf_wheel=$(ls dist/tensorflow_gnn-*.whl)
75+
pip install "${tf_wheel[0]}[vizier]"
76+
pip uninstall -y tensorflow tf-keras ai-edge-litert
77+
pip install --group test-nightly --progress-bar off --upgrade
7078

7179
echo "Final packages after all pip commands:"
7280
pip list
7381

7482
# Check that tf-nightly is installed but tensorflow is not
7583
# Also check that tf-keras-nightly is installed.
76-
pip freeze | grep -q tf-nightly= && ! pip freeze | grep -q tensorflow=
77-
pip freeze | grep -q tf-keras-nightly= && ! pip freeze | grep -q tf-keras=
84+
if [[ $(pip freeze | grep -q tf_nightly=; echo $?) -eq 0 && $(pip freeze | grep -q tensorflow=; echo $?) -eq 0 ]]; then
85+
echo "Found tensorflow and tf_nightly in the environment."
86+
exit 1
87+
fi
88+
if [[ $(pip freeze | grep -q tf_keras-nightly=; echo $?) -eq 0 && $(pip freeze | grep -q tf_keras=; echo $?) -eq 0 ]]; then
89+
echo "Found tf_keras and tf_keras-nightly in the environment."
90+
exit 1
91+
fi
7892
# The env variable is needed to ensure that TF keras still behaves like keras 2
7993
bazel test --test_env="TF_USE_LEGACY_KERAS=1" --build_tag_filters="${tag_filters}" --test_tag_filters="${tag_filters}" --test_output=errors --verbose_failures=true --build_tests_only --define=no_tfgnn_py_deps=true --keep_going --experimental_repo_remote_exec //bazel_pip/tensorflow_gnn/...

kokoro/github/ubuntu/cpu/build_versioned.sh

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,22 @@ set -x
1919
PYENV_ROOT="/home/kbuilder/.pyenv"
2020
PYTHON_VERSION=${PYTHON_VERSION:-"3.11"}
2121

22-
echo "Installing pyenv.."
23-
git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT"
22+
function force_tensorflow_version() {
23+
if [[ -z "${TF_VERSION}" ]]; then
24+
echo "TF_VERSION is not set. Not forcing tensorflow version."
25+
return
26+
fi
27+
28+
pip install tensorflow=="${TF_VERSION}" --progress-bar off --upgrade
29+
if [[ "$TF_USE_LEGACY_KERAS" == 1 ]]; then
30+
pip install tf-keras=="${TF_VERSION}" --progress-bar off --upgrade
31+
fi
32+
}
33+
34+
if [[ ! -d "$PYENV_ROOT" ]]; then
35+
echo "Installing pyenv.."
36+
git clone https://github.com/pyenv/pyenv.git "$PYENV_ROOT"
37+
fi
2438
export PATH="/home/kbuilder/.local/bin:$PYENV_ROOT/bin:$PATH"
2539
eval "$(pyenv init --path)"
2640

@@ -32,16 +46,18 @@ cd "${KOKORO_ARTIFACTS_DIR}/github/gnn/"
3246

3347
PIP_TEST_PREFIX=bazel_pip
3448

35-
python -m venv venv
36-
source venv/bin/activate
49+
python -m venv build_venv
50+
source build_venv/bin/activate
3751

3852
# Debug messages to indicate the python version
3953
python --version
40-
python3 --version
4154

4255
# update pip
4356
pip install --upgrade pip
4457

58+
# Install build
59+
pip install build
60+
4561
TEST_ROOT=$(pwd)/${PIP_TEST_PREFIX}
4662
rm -rf "$TEST_ROOT"
4763
mkdir -p "$TEST_ROOT"
@@ -62,13 +78,27 @@ if [[ -n "${USE_BAZEL_VERSION}" && $(bazel --version) != *${USE_BAZEL_VERSION}*
6278
fi
6379

6480
bazel clean
65-
pip install -r requirements-dev.txt --progress-bar off
66-
pip install tensorflow=="${TF_VERSION}" --progress-bar off --upgrade
81+
force_tensorflow_version
82+
python3 -m build --wheel
83+
deactivate
84+
85+
# Start the test environment.
86+
python3 -m venv test_venv
87+
source test_venv/bin/activate
88+
89+
# Check the python version
90+
python --version
91+
92+
# update pip
93+
pip install --upgrade pip
94+
force_tensorflow_version
95+
6796
if [[ "$TF_USE_LEGACY_KERAS" == 1 ]]; then
68-
pip install tf-keras=="${TF_VERSION}" --progress-bar off --upgrade
97+
pip install --group test-tf216plus --progress-bar off --upgrade
98+
else
99+
pip install --group test-pre-tf216 --progress-bar off --upgrade
69100
fi
70-
python3 setup.py bdist_wheel
71-
pip uninstall -y tensorflow_gnn
101+
72102
pip install dist/tensorflow_gnn-*.whl
73103

74104
echo "Final packages after all pip commands:"

kokoro/github/ubuntu/cpu/continuous.cfg

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
build_file: "gnn/kokoro/github/ubuntu/cpu/build.sh"
22

3-
env_vars: {
4-
key: "USE_BAZEL_VERSION"
5-
value: "7.4.1" # TODO - b/390391579: Unpin once bazel 8 works.
6-
}
73
env_vars: {
84
key: "PYTHON_VERSION"
9-
value: "3.11"
5+
value: "3.12"
106
}
117

128
action {

kokoro/github/ubuntu/cpu/newest_stable/continuous.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
build_file: "gnn/kokoro/github/ubuntu/cpu/build_versioned.sh"
22

3-
env_vars: {
4-
key: "USE_BAZEL_VERSION"
5-
value: "7.4.1" # TODO - b/390391579: Unpin once bazel 8 works.
6-
}
73
env_vars: {
84
key: "PYTHON_VERSION"
9-
value: "3.11"
5+
value: "3.12"
106
}
117
env_vars: {
128
key: "TF_VERSION"
@@ -16,6 +12,10 @@ env_vars: {
1612
key: "TF_USE_LEGACY_KERAS"
1713
value: "1"
1814
}
15+
env_vars: {
16+
key: "TAG_FILTERS"
17+
value: ",-vizier"
18+
}
1919

2020
action {
2121
define_artifacts {

kokoro/github/ubuntu/cpu/newest_stable/presubmit.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
build_file: "gnn/kokoro/github/ubuntu/cpu/build_versioned.sh"
22

3-
env_vars: {
4-
key: "USE_BAZEL_VERSION"
5-
value: "7.4.1" # TODO - b/390391579: Unpin once bazel 8 works.
6-
}
73
env_vars: {
84
key: "PYTHON_VERSION"
9-
value: "3.11"
5+
value: "3.12"
106
}
117
env_vars: {
128
key: "TF_VERSION"
@@ -16,6 +12,10 @@ env_vars: {
1612
key: "TF_USE_LEGACY_KERAS"
1713
value: "1"
1814
}
15+
env_vars: {
16+
key: "TAG_FILTERS"
17+
value: ",-vizier"
18+
}
1919

2020
action {
2121
define_artifacts {

kokoro/github/ubuntu/cpu/oldest/continuous.cfg

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
build_file: "gnn/kokoro/github/ubuntu/cpu/build_versioned.sh"
22

3-
env_vars: {
4-
key: "USE_BAZEL_VERSION"
5-
value: "7.4.1" # TODO - b/390391579: Unpin once bazel 8 works.
6-
}
73
env_vars: {
84
key: "PYTHON_VERSION"
95
value: "3.11"
@@ -18,7 +14,7 @@ env_vars: {
1814
}
1915
env_vars: {
2016
key: "TAG_FILTERS"
21-
value: ",-tf_at_least_2_13"
17+
value: ",-tf_at_least_2_13,-vizier"
2218
}
2319

2420
action {

kokoro/github/ubuntu/cpu/oldest/presubmit.cfg

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
build_file: "gnn/kokoro/github/ubuntu/cpu/build_versioned.sh"
22

3-
env_vars: {
4-
key: "USE_BAZEL_VERSION"
5-
value: "7.4.1" # TODO - b/390391579: Unpin once bazel 8 works.
6-
}
73
env_vars: {
84
key: "PYTHON_VERSION"
95
value: "3.11"
@@ -18,7 +14,7 @@ env_vars: {
1814
}
1915
env_vars: {
2016
key: "TAG_FILTERS"
21-
value: ",-tf_at_least_2_13"
17+
value: ",-tf_at_least_2_13,-vizier"
2218
}
2319

2420
action {

kokoro/github/ubuntu/cpu/presubmit.cfg

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
build_file: "gnn/kokoro/github/ubuntu/cpu/build.sh"
22

3-
env_vars: {
4-
key: "USE_BAZEL_VERSION"
5-
value: "7.4.1" # TODO - b/390391579: Unpin once bazel 8 works.
6-
}
73
env_vars: {
84
key: "PYTHON_VERSION"
9-
value: "3.11"
5+
value: "3.12"
106
}
117

128
action {

0 commit comments

Comments
 (0)