Skip to content

Commit 608e9e8

Browse files
Graph Learning Teamtensorflower-gardener
authored andcommitted
Initial changes for moving to ML-Actions GHA workflows
PiperOrigin-RevId: 872147334
1 parent 55784fc commit 608e9e8

File tree

53 files changed

+1084
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1084
-216
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Copyright 2026 The TensorFlow GNN Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
15+
name: Reusable Build
16+
on:
17+
workflow_call:
18+
inputs:
19+
20+
python_version:
21+
description: 'Python version (overridden by kokoro_config if set)'
22+
required: false
23+
type: string
24+
default: '3.11'
25+
bazel_version:
26+
description: 'Bazel version (overridden by kokoro_config if set)'
27+
required: false
28+
type: string
29+
default: '7.4.1'
30+
tf_version_spec:
31+
description: 'TensorFlow version specifier'
32+
required: false
33+
type: string
34+
keras_version_spec:
35+
description: 'Keras version specifier'
36+
required: false
37+
type: string
38+
artifact_name:
39+
description: 'Name for uploaded wheel artifact'
40+
required: true
41+
type: string
42+
nightly_build:
43+
description: 'Whether to modify setup.py for tf-nightly'
44+
required: false
45+
type: boolean
46+
default: false
47+
run_tests:
48+
description: 'Whether to run tests after building'
49+
required: false
50+
type: boolean
51+
default: false
52+
legacy_keras:
53+
description: 'Value for TF_USE_LEGACY_KERAS'
54+
required: false
55+
type: string
56+
default: '0'
57+
build_tag_filters:
58+
description: 'Bazel build tag filters'
59+
required: false
60+
type: string
61+
default: '-no_oss,-oss_excluded'
62+
test_tag_filters:
63+
description: 'Bazel test tag filters'
64+
required: false
65+
type: string
66+
default: '-no_oss,-oss_excluded'
67+
nightly_env:
68+
description: 'Whether to run checks for tf-nightly'
69+
required: false
70+
type: boolean
71+
default: false
72+
73+
permissions:
74+
contents: read
75+
76+
jobs:
77+
build:
78+
runs-on: ubuntu-24.04
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
82+
with:
83+
ref: ${{ github.sha }}
84+
persist-credentials: false
85+
86+
- name: Setup Python
87+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # ratchet:actions/setup-python@v5
88+
with:
89+
python-version: ${{ inputs.python_version }}
90+
91+
- name: Build wheel
92+
env:
93+
USE_BAZEL_VERSION: ${{ inputs.bazel_version }}
94+
TF_VERSION_SPEC: ${{ inputs.tf_version_spec }}
95+
KERAS_VERSION_SPEC: ${{ inputs.keras_version_spec }}
96+
NIGHTLY_BUILD: ${{ inputs.nightly_build }}
97+
run: bash build-gha.sh
98+
99+
# TBD - decide if want to upload it to GitHub at all
100+
#- name: Upload wheel artifact
101+
# uses: actions/upload-artifact@v4
102+
# with:
103+
# name: ${{ inputs.artifact_name }}
104+
# path: dist/*.whl
105+
106+
- name: Run tests
107+
if: inputs.run_tests
108+
env:
109+
USE_BAZEL_VERSION: ${{ inputs.bazel_version }}
110+
TF_VERSION_SPEC: ${{ inputs.tf_version_spec }}
111+
KERAS_VERSION_SPEC: ${{ inputs.keras_version_spec }}
112+
TF_USE_LEGACY_KERAS: ${{ inputs.legacy_keras }}
113+
BUILD_TAG_FILTERS: ${{ inputs.build_tag_filters }}
114+
TEST_TAG_FILTERS: ${{ inputs.test_tag_filters }}
115+
NIGHTLY_ENV: ${{ inputs.nightly_env }}
116+
WHEEL_DIR: dist
117+
run: bash test-gha.sh

.github/workflows/ci-build.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright 2026 The TensorFlow GNN Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
15+
name: CI
16+
17+
on:
18+
push:
19+
branches:
20+
- main
21+
pull_request:
22+
branches:
23+
- main
24+
25+
permissions:
26+
contents: read
27+
28+
concurrency:
29+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
30+
# Don't cancel in-progress jobs for main branches.
31+
cancel-in-progress: ${{ github.ref != 'main' }}
32+
33+
jobs:
34+
build-and-test-oldest:
35+
uses: ./.github/workflows/build-reusable.yml
36+
with:
37+
python_version: '3.11'
38+
tf_version_spec: 'tensorflow==2.12.*'
39+
legacy_keras: '0'
40+
build_tag_filters: '-no_oss,-oss_excluded,-tf_at_least_2_13'
41+
test_tag_filters: '-no_oss,-oss_excluded,-tf_at_least_2_13'
42+
artifact_name: 'tensorflow_gnn_oldest'
43+
run_tests: true
44+
45+
build-and-test-newest:
46+
uses: ./.github/workflows/build-reusable.yml
47+
with:
48+
python_version: '3.11'
49+
tf_version_spec: 'tensorflow==2.20.*'
50+
legacy_keras: '1'
51+
artifact_name: 'tensorflow_gnn_newest'
52+
run_tests: true

.gitignore

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,48 @@
11
bazel-*
2-
build
2+
build/
33
dist
44
*.egg-info
5+
6+
# Python bytecode
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# Logs
12+
*.log
13+
14+
# Temporary/debug files
15+
*.tmp
16+
*.bak
17+
*.swp
18+
*.swo
19+
20+
# OS files
21+
.DS_Store
22+
Thumbs.db
23+
24+
# Build/test artifacts
25+
build_*.txt
26+
test_*.txt
27+
test_output.log
28+
clean_build_log.txt
29+
error_context*.txt
30+
failure_detail*.txt
31+
failures_*.txt
32+
install_log*.txt
33+
installed_packages.txt
34+
snippet*.txt
35+
sha256.txt
36+
workflow_log.txt
37+
38+
# Docker test logs
39+
docker_test_results*.log
40+
41+
# IDE
42+
.idea/
43+
.vscode/
44+
*.iml
45+
46+
# Virtual environments
47+
venv/
48+
.venv/

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
)

MODULE.bazel

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2026 The TensorFlow GNN Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
15+
module(
16+
name = "tensorflow_gnn",
17+
repo_name = "tensorflow_gnn",
18+
)
19+
20+
bazel_dep(name = "rules_python", version = "0.26.0")
21+
bazel_dep(name = "python_shim", version = "0.0.0", repo_name = "python")
22+
local_path_override(
23+
module_name = "python_shim",
24+
path = "python_shim",
25+
)
26+
27+
bazel_dep(name = "platforms", version = "0.0.11")
28+
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
29+
bazel_dep(name = "rules_license", version = "0.0.4")

WORKSPACE

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,25 @@ workspace(name = "tensorflow_gnn")
22

33
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44

5+
http_archive(
6+
name = "platforms",
7+
sha256 = "29742e87275809b5e598dc2f04d86960cc7a55b3067d97221c9abbc9926bff0f",
8+
urls = [
9+
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.11/platforms-0.0.11.tar.gz",
10+
"https://github.com/bazelbuild/platforms/releases/download/0.0.11/platforms-0.0.11.tar.gz",
11+
],
12+
)
13+
14+
# Load custom Python configuration to override local_config_python
15+
load("//:python_configure.bzl", "python_repository")
16+
17+
python_repository(name = "local_config_python")
18+
19+
register_toolchains("@local_config_python//:py_toolchain")
20+
521
# Define the TensorFlow archive.
622
load("@tensorflow_gnn//package:tfdep.bzl", "tf_setup")
23+
724
tf_setup()
825

926
http_archive(
@@ -25,15 +42,23 @@ http_archive(
2542
# Initialize the TensorFlow repository and all dependencies.
2643
# See @org_tensorflow//WORKSPACE for details.
2744
load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3")
45+
2846
tf_workspace3()
47+
2948
load("@org_tensorflow//tensorflow:workspace2.bzl", "tf_workspace2")
49+
3050
tf_workspace2()
51+
3152
load("@org_tensorflow//tensorflow:workspace1.bzl", "tf_workspace1")
53+
3254
tf_workspace1()
55+
3356
load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0")
57+
3458
tf_workspace0()
3559

3660
load("@rules_python//python:repositories.bzl", "py_repositories")
61+
3762
py_repositories()
3863

3964
# This seems required to avoid a proxy setup.
@@ -53,4 +78,4 @@ http_archive(
5378
"https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz",
5479
"https://github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz",
5580
],
56-
)
81+
)

0 commit comments

Comments
 (0)