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
117 changes: 117 additions & 0 deletions .github/workflows/build-reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Copyright 2026 The TensorFlow GNN Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
name: Reusable Build
on:
workflow_call:
inputs:

python_version:
description: 'Python version (overridden by kokoro_config if set)'
required: false
type: string
default: '3.11'
bazel_version:
description: 'Bazel version (overridden by kokoro_config if set)'
required: false
type: string
default: '7.4.1'
tf_version_spec:
description: 'TensorFlow version specifier'
required: false
type: string
keras_version_spec:
description: 'Keras version specifier'
required: false
type: string
artifact_name:
description: 'Name for uploaded wheel artifact'
required: true
type: string
nightly_build:
description: 'Whether to modify setup.py for tf-nightly'
required: false
type: boolean
default: false
run_tests:
description: 'Whether to run tests after building'
required: false
type: boolean
default: false
legacy_keras:
description: 'Value for TF_USE_LEGACY_KERAS'
required: false
type: string
default: '0'
build_tag_filters:
description: 'Bazel build tag filters'
required: false
type: string
default: '-no_oss,-oss_excluded'
test_tag_filters:
description: 'Bazel test tag filters'
required: false
type: string
default: '-no_oss,-oss_excluded'
nightly_env:
description: 'Whether to run checks for tf-nightly'
required: false
type: boolean
default: false

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
with:
ref: ${{ github.sha }}
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # ratchet:actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}

- name: Build wheel
env:
USE_BAZEL_VERSION: ${{ inputs.bazel_version }}
TF_VERSION_SPEC: ${{ inputs.tf_version_spec }}
KERAS_VERSION_SPEC: ${{ inputs.keras_version_spec }}
NIGHTLY_BUILD: ${{ inputs.nightly_build }}
run: bash build-gha.sh

# TBD - decide if want to upload it to GitHub at all
#- name: Upload wheel artifact
# uses: actions/upload-artifact@v4
# with:
# name: ${{ inputs.artifact_name }}
# path: dist/*.whl

- name: Run tests
if: inputs.run_tests
env:
USE_BAZEL_VERSION: ${{ inputs.bazel_version }}
TF_VERSION_SPEC: ${{ inputs.tf_version_spec }}
KERAS_VERSION_SPEC: ${{ inputs.keras_version_spec }}
TF_USE_LEGACY_KERAS: ${{ inputs.legacy_keras }}
BUILD_TAG_FILTERS: ${{ inputs.build_tag_filters }}
TEST_TAG_FILTERS: ${{ inputs.test_tag_filters }}
NIGHTLY_ENV: ${{ inputs.nightly_env }}
WHEEL_DIR: dist
run: bash test-gha.sh
52 changes: 52 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2026 The TensorFlow GNN Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
# Don't cancel in-progress jobs for main branches.
cancel-in-progress: ${{ github.ref != 'main' }}

jobs:
build-and-test-oldest:
uses: ./.github/workflows/build-reusable.yml
with:
python_version: '3.11'
tf_version_spec: 'tensorflow==2.12.*'
legacy_keras: '0'
build_tag_filters: '-no_oss,-oss_excluded,-tf_at_least_2_13'
test_tag_filters: '-no_oss,-oss_excluded,-tf_at_least_2_13'
artifact_name: 'tensorflow_gnn_oldest'
run_tests: true

build-and-test-newest:
uses: ./.github/workflows/build-reusable.yml
with:
python_version: '3.11'
tf_version_spec: 'tensorflow==2.20.*'
legacy_keras: '1'
artifact_name: 'tensorflow_gnn_newest'
run_tests: true
46 changes: 45 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,48 @@
bazel-*
build
build/
dist
*.egg-info

# Python bytecode
__pycache__/
*.py[cod]
*$py.class

# Logs
*.log

# Temporary/debug files
*.tmp
*.bak
*.swp
*.swo

# OS files
.DS_Store
Thumbs.db

# Build/test artifacts
build_*.txt
test_*.txt
test_output.log
clean_build_log.txt
error_context*.txt
failure_detail*.txt
failures_*.txt
install_log*.txt
installed_packages.txt
snippet*.txt
sha256.txt
workflow_log.txt

# Docker test logs
docker_test_results*.log

# IDE
.idea/
.vscode/
*.iml

# Virtual environments
venv/
.venv/
9 changes: 9 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ py_library(
# This is a dummy rule used as a absl dependency in open-source.
# We expect absl to already be installed on the system, e.g. via
# `pip install absl`
# strict_deps = False,
visibility = ["//visibility:public"],
deps = [],
)
Expand All @@ -12,6 +13,7 @@ py_library(
# This is a dummy rule used as a absl dependency in open-source.
# We expect absl to already be installed on the system, e.g. via
# `pip install absl`
# strict_deps = False,
visibility = ["//visibility:public"],
deps = [],
)
Expand All @@ -21,6 +23,7 @@ py_library(
# This is a dummy rule used as a absl dependency in open-source.
# We expect absl to already be installed on the system, e.g. via
# `pip install absl`
# strict_deps = False,
visibility = ["//visibility:public"],
deps = [],
)
Expand All @@ -30,6 +33,7 @@ py_library(
# This is a dummy rule used as a numpy dependency in open-source.
# We expect numpy to already be installed on the system, e.g. via
# `pip install numpy`
# strict_deps = False,
visibility = ["//visibility:public"],
deps = [],
)
Expand All @@ -39,6 +43,7 @@ py_library(
# This is a dummy rule used as a tensorflow dependency in open-source.
# We expect tensorflow to already be installed on the system, e.g. via
# `pip install tensorflow`
# strict_deps = False,
visibility = ["//visibility:public"],
deps = [],
)
Expand All @@ -48,6 +53,7 @@ py_library(
# This is a dummy rule used as a ai-edge-litert dependency in open-source.
# We expect ai-edge-litert to already be installed on the system, e.g. via
# `pip install ai-edge-litert`
# strict_deps = False,
visibility = ["//visibility:public"],
deps = [],
)
Expand All @@ -57,6 +63,7 @@ py_library(
# This is a dummy rule used as a tensorflow dependency in open-source.
# We expect tensorflow to already be installed on the system, e.g. via
# `pip install tensorflow`
# strict_deps = False,
visibility = ["//visibility:public"],
deps = [],
)
Expand All @@ -66,6 +73,7 @@ py_library(
# This is a dummy rule used as a dependency on vizier.service.pyvizier in open-source.
# We expect Vizier to already be installed on the system, e.g. via
# `pip install google-vizier` and extra steps if needed (b/254806045).
# strict_deps = False,
visibility = ["//visibility:public"],
deps = [],
)
Expand All @@ -75,6 +83,7 @@ py_library(
# This is a dummy rule used as a mock dependency in open-source tests.
# We expect mock to already be installed on the system, e.g. via
# `pip install mock`
# strict_deps = False,
visibility = ["//visibility:public"],
deps = [],
)
29 changes: 29 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2026 The TensorFlow GNN Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
module(
name = "tensorflow_gnn",
repo_name = "tensorflow_gnn",
)

bazel_dep(name = "rules_python", version = "0.26.0")
bazel_dep(name = "python_shim", version = "0.0.0", repo_name = "python")
local_path_override(
module_name = "python_shim",
path = "python_shim",
)

bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
bazel_dep(name = "rules_license", version = "0.0.4")
27 changes: 26 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,25 @@ workspace(name = "tensorflow_gnn")

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

http_archive(
name = "platforms",
sha256 = "29742e87275809b5e598dc2f04d86960cc7a55b3067d97221c9abbc9926bff0f",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.11/platforms-0.0.11.tar.gz",
"https://github.com/bazelbuild/platforms/releases/download/0.0.11/platforms-0.0.11.tar.gz",
],
)

# Load custom Python configuration to override local_config_python
load("//:python_configure.bzl", "python_repository")

python_repository(name = "local_config_python")

register_toolchains("@local_config_python//:py_toolchain")

# Define the TensorFlow archive.
load("@tensorflow_gnn//package:tfdep.bzl", "tf_setup")

tf_setup()

http_archive(
Expand All @@ -25,15 +42,23 @@ http_archive(
# Initialize the TensorFlow repository and all dependencies.
# See @org_tensorflow//WORKSPACE for details.
load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3")

tf_workspace3()

load("@org_tensorflow//tensorflow:workspace2.bzl", "tf_workspace2")

tf_workspace2()

load("@org_tensorflow//tensorflow:workspace1.bzl", "tf_workspace1")

tf_workspace1()

load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0")

tf_workspace0()

load("@rules_python//python:repositories.bzl", "py_repositories")

py_repositories()

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