Skip to content

Commit 801fd18

Browse files
authored
Align with r0.52.0 release branch (#64)
* Update 0.52.0 release in version.py and RELEASE.md on master * Update tensorflow-metadata dependency to >=1.21.0,<1.22.0 * Document tensorflow-metadata dependency update in RELEASE.md * Pin com_github_tensorflow_metadata to stable 1.21.0 release * Pin com_github_tensorflow_metadata to 1.21.0 commit da17f45 * Pre-pull ubuntu:22.04 from mirror.gcr.io in CI and capitalize AS in Dockerfile * Add automated PyPI wheel publishing job using PYPI_API_TOKEN * Enable PyPI wheel publishing across Python 3.10, 3.11, 3.12, 3.13 matrix * Enable cross-platform PyPI publishing matrix across Linux and macOS * Simplify PyPI publish job name for clean GitHub Actions sidebar presentation * Fix SFrame assembler error by using -fno-asynchronous-unwind-tables in .bazelrc * Restrict docker-serving-build job to master branch pushes * Fix GNU assembler error by restoring -fno-asynchronous-unwind-tables flag in .bazelrc * Remove sframe_fix config from default Linux and GitHub Actions runs; restore -Wa,--gsframe=no for local GCC 15 builds * Integrate wheel build and PyPI publish steps into main build job; remove redundant 8-job pypi-publish matrix * Simplify wheel build command by omitting default python binary arg * Dynamically select Bazelisk architecture on macOS CI runners to support Apple Silicon (M1/M2 arm64) runners * Conditionally compile Arrow AVX SIMD optimization sources only when building for x86_64 CPU architecture to prevent Apple Silicon macOS errors * Split wheel upload and PyPI publish into separate optimized jobs so all matrix runners build wheels and a unified Linux job publishes them to PyPI * Add auditwheel repair step to Linux wheel build so wheels receive PyPI-compliant manylinux platform tags * Exclude libtensorflow_framework.so from auditwheel repair since TensorFlow runtime provides it
1 parent 96a8008 commit 801fd18

9 files changed

Lines changed: 88 additions & 46 deletions

File tree

.bazelrc

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -45,44 +45,14 @@ build:macos --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=1
4545

4646
build:short_logs --output_filter=DONT_MATCH_ANYTHING
4747

48-
# Config to disable sframe in assembler to avoid linker errors with gcc 15
48+
# Config to disable sframe unwind tables to avoid assembler/linker errors with gcc 15
4949
build:sframe_fix --copt=-Wa,--gsframe=no
50+
build:sframe_fix --cxxopt=-Wa,--gsframe=no
51+
build:sframe_fix --host_copt=-Wa,--gsframe=no
52+
build:sframe_fix --host_cxxopt=-Wa,--gsframe=no
5053

5154
build:macos --macos_minimum_os=10.12
5255

5356
common --noenable_bzlmod
5457

5558
test --noincompatible_check_sharding_support
56-
build --action_env TF_HEADER_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow/include"
57-
build --action_env TF_SHARED_LIBRARY_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow"
58-
build --action_env TF_SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"
59-
build --action_env TF_HEADER_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow/include"
60-
build --action_env TF_SHARED_LIBRARY_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow"
61-
build --action_env TF_SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"
62-
build --action_env TF_HEADER_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow/include"
63-
build --action_env TF_SHARED_LIBRARY_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow"
64-
build --action_env TF_SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"
65-
build --action_env TF_HEADER_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow/include"
66-
build --action_env TF_SHARED_LIBRARY_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow"
67-
build --action_env TF_SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"
68-
build --action_env TF_HEADER_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow/include"
69-
build --action_env TF_SHARED_LIBRARY_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow"
70-
build --action_env TF_SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"
71-
build --action_env TF_HEADER_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow/include"
72-
build --action_env TF_SHARED_LIBRARY_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow"
73-
build --action_env TF_SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"
74-
build --action_env TF_HEADER_DIR="/usr/local/google/home/vkarampudi/anaconda3/lib/python3.12/site-packages/tensorflow/include"
75-
build --action_env TF_SHARED_LIBRARY_DIR="/usr/local/google/home/vkarampudi/anaconda3/lib/python3.12/site-packages/tensorflow"
76-
build --action_env TF_SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"
77-
build --action_env TF_HEADER_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow/include"
78-
build --action_env TF_SHARED_LIBRARY_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow"
79-
build --action_env TF_SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"
80-
build --action_env TF_HEADER_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow/include"
81-
build --action_env TF_SHARED_LIBRARY_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow"
82-
build --action_env TF_SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"
83-
build --action_env TF_HEADER_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow/include"
84-
build --action_env TF_SHARED_LIBRARY_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow"
85-
build --action_env TF_SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"
86-
build --action_env TF_HEADER_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow/include"
87-
build --action_env TF_SHARED_LIBRARY_DIR="/usr/local/lib/python3.12/dist-packages/tensorflow"
88-
build --action_env TF_SHARED_LIBRARY_NAME="libtensorflow_framework.so.2"

.github/workflows/build.yml

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ name: Build
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ master, 'r*' ]
6+
tags: [ 'v*' ]
67
pull_request:
7-
branches: [ master ]
8+
branches: [ master, 'r*' ]
89

910
env:
1011
USE_BAZEL_VERSION: 7.7.0
@@ -37,7 +38,12 @@ jobs:
3738
if [ "$RUNNER_OS" == "Linux" ]; then
3839
curl -Lo /tmp/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64
3940
elif [ "$RUNNER_OS" == "macOS" ]; then
40-
curl -Lo /tmp/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-darwin-amd64
41+
ARCH=$(uname -m)
42+
if [ "$ARCH" == "arm64" ]; then
43+
curl -Lo /tmp/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-darwin-arm64
44+
else
45+
curl -Lo /tmp/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-darwin-amd64
46+
fi
4147
fi
4248
chmod +x /tmp/bazelisk
4349
sudo mv /tmp/bazelisk /usr/local/bin/bazel
@@ -62,12 +68,56 @@ jobs:
6268
shell: bash -l {0}
6369
run: bazel build //...
6470

71+
- name: Build Release Wheel
72+
shell: bash -l {0}
73+
run: bazel run //:build_pip_package
74+
75+
- name: Repair Linux Wheel with Auditwheel
76+
if: runner.os == 'Linux'
77+
shell: bash -l {0}
78+
run: |
79+
python -m pip install auditwheel
80+
auditwheel repair --exclude 'libtensorflow_framework.so.*' dist/*.whl -w repaired_wheels/
81+
rm -f dist/*.whl
82+
mv repaired_wheels/*.whl dist/
83+
84+
- name: Upload Wheel Artifact
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: wheels-${{ matrix.os }}-${{ matrix.python-version }}
88+
path: dist/*.whl
89+
6590
docker-serving-build:
6691
name: Build Docker Serving Image
92+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
6793
runs-on: ubuntu-latest
6894
steps:
6995
- uses: actions/checkout@v4
96+
- name: Pre-pull Ubuntu base image from GCR mirror to prevent Docker Hub timeouts
97+
run: |
98+
docker pull mirror.gcr.io/library/ubuntu:22.04
99+
docker tag mirror.gcr.io/library/ubuntu:22.04 ubuntu:22.04
70100
- name: Build TF-Serving Docker Image
71101
run: |
72102
cd struct2tensor/tools/tf_serving_docker
73103
docker build -t struct2tensor-serving:latest .
104+
105+
pypi-publish:
106+
name: Publish Wheels to PyPI
107+
needs: build
108+
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/r'))
109+
runs-on: ubuntu-latest
110+
steps:
111+
- name: Download all wheels
112+
uses: actions/download-artifact@v4
113+
with:
114+
pattern: wheels-*
115+
path: dist/
116+
merge-multiple: true
117+
118+
- name: Publish Package to PyPI
119+
uses: pypa/gh-action-pypi-publish@release/v1
120+
with:
121+
password: ${{ secrets.PYPI_API_TOKEN }}
122+
packages-dir: dist/
123+
skip-existing: true

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Struct2Tensor
22

3-
[![Python](https://img.shields.io/badge/python%7C3.9-blue)](https://github.com/google/struct2tensor)
3+
[![Python](https://img.shields.io/badge/python%7C3.10%7C3.11%7C3.12%7C3.13-blue)](https://github.com/google/struct2tensor)
44
[![PyPI](https://badge.fury.io/py/struct2tensor.svg)](https://badge.fury.io/py/struct2tensor)
55

66
<!--*
@@ -115,6 +115,7 @@ is an integer.
115115

116116
struct2tensor | tensorflow
117117
---------------------------------------------------------------------- | ----------
118+
[0.52.0](https://github.com/google/struct2tensor/releases/tag/v0.52.0) | 2.21.0
118119
[0.48.0](https://github.com/google/struct2tensor/releases/tag/v0.48.0) | 2.17.0
119120
[0.47.0](https://github.com/google/struct2tensor/releases/tag/v0.47.0) | 2.16.2
120121
[0.46.0](https://github.com/google/struct2tensor/releases/tag/v0.46.0) | 2.15.0

RELEASE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@
44

55
## Major Features and Improvements
66

7+
## Bug Fixes and Other Changes
8+
9+
## Breaking Changes
10+
11+
## Deprecations
12+
13+
## Version 0.52.0
14+
15+
## Major Features and Improvements
16+
717
* N/A
818

919
## Bug Fixes and Other Changes
1020

1121
* Depends on `tensorflow 2.21.0`.
22+
* Depends on `tensorflow-metadata>=1.21.0,<1.22.0`.
1223
* Depends on `protobuf==6.31.1`.
1324
* Depends on `pyarrow==23.0.1`.
1425
* Enforced C++17 in `.bazelrc`.

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ def select_constraint(default, nightly=None, git_master=None):
8383
'tensorflow>=2.21,<2.22',
8484
'tensorflow-metadata'
8585
+ select_constraint(
86-
default='@git+https://github.com/tensorflow/metadata@master',
87-
nightly='>=1.18.0.dev',
86+
default='>=1.21.0,<1.22.0',
87+
nightly='>=1.21.0.dev',
8888
git_master='@git+https://github.com/tensorflow/metadata@master',
8989
),
9090
'pyarrow>=14',

struct2tensor/tools/tf_serving_docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Defines an image that contains a tensorflow-serving model server binary
1616
# that has struct2tensor ops linked in.
1717

18-
FROM ubuntu:22.04 as base_build
18+
FROM ubuntu:22.04 AS base_build
1919
ARG TF_SERVING_VERSION_GIT_BRANCH=r2.19
2020
ARG TF_SERVING_VERSION_GIT_COMMIT=head
2121
ARG S2T_VERSION_GIT_BRANCH=master
@@ -126,7 +126,7 @@ RUN echo "local_repository(name=\"com_google_struct2tensor\", path=\"/struct2ten
126126
//tensorflow_serving/model_servers:tensorflow_model_server
127127

128128

129-
FROM base_build as binary_build
129+
FROM base_build AS binary_build
130130
ARG TF_SERVING_BUILD_OPTIONS="--config=release"
131131
RUN echo "Building with build options: ${TF_SERVING_BUILD_OPTIONS}"
132132
ARG TF_SERVING_BAZEL_OPTIONS="--noenable_bzlmod"

struct2tensor/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
"""Contains the version string of struct2tensor."""
1616

1717
# Note that setup.py uses this version.
18-
__version__ = '0.49.0.dev'
18+
__version__ = '0.53.0.dev'

struct2tensor/workspace.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ def struct2tensor_workspace():
7171
urls = ["https://github.com/apache/arrow/archive/%s.zip" % ARROW_COMMIT],
7272
)
7373

74-
_TFMD_COMMIT_HASH = "d3194a388344cb7a10d42b2a7c01bf384f3d1741" #Align with TF 2.21
74+
_TFMD_COMMIT_HASH = "da17f4557749ae122284c5be3e43a2f211d3e6e2" # 1.21.0
7575
http_archive(
7676
name = "com_github_tensorflow_metadata",
77-
sha256 = "b574885016ea3afdf54133c4920849ac122c77a77b2a7a8356ad1fa548d75bc6",
77+
sha256 = "126e7718dac19552be61de53c5f97da853a4166903a240aa33fce7e93b9e4fb2",
7878
strip_prefix = "metadata-%s" % _TFMD_COMMIT_HASH,
7979
urls = [
8080
"https://github.com/tensorflow/metadata/archive/%s.tar.gz" % _TFMD_COMMIT_HASH,

third_party/arrow.BUILD

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ fbs_headers = [
5353
"cpp/src/generated/Tensor_generated.h",
5454
]
5555

56+
arrow_simd_srcs = select({
57+
"@platforms//cpu:x86_64": glob([
58+
"cpp/src/arrow/compute/**/*_avx2.cc",
59+
"cpp/src/arrow/compute/**/*_avx512.cc",
60+
]),
61+
"//conditions:default": [],
62+
})
63+
5664
cc_library(
5765
name = "arrow",
5866
srcs = glob(
@@ -87,6 +95,8 @@ cc_library(
8795
"cpp/src/arrow/util/bpacking_avx512.*",
8896
"cpp/src/arrow/util/bpacking_neon*",
8997
"cpp/src/arrow/util/bpacking_simd*",
98+
"cpp/src/arrow/compute/**/*_avx2.*",
99+
"cpp/src/arrow/compute/**/*_avx512.*",
90100
"cpp/src/arrow/util/compression_brotli*",
91101
"cpp/src/arrow/util/compression_bz2*",
92102
"cpp/src/arrow/util/compression_lz4*",
@@ -106,7 +116,7 @@ cc_library(
106116
#"cpp/src/arrow/vendored/datetime/**",
107117
"cpp/src/parquet/encryption/encryption_internal.cc",
108118
],
109-
),
119+
) + arrow_simd_srcs,
110120
hdrs = [
111121
# Headers from above genrules.
112122
"cpp/src/arrow/util/config.h",

0 commit comments

Comments
 (0)