Skip to content

Commit 467581c

Browse files
authored
Synchronize CI/CD, Flatbuffers vendoring and wamp-ai and wamp-cicd Submodules between autobahn-python and zlmdb (#1822)
* add feature branch audit file * Add FlatBuffers/flatc bundling support and smoke tests Add shared flatc infrastructure from wamp-cicd: - Bump .cicd submodule to include new scripts/flatc/ files - Add src/autobahn/_flatc/ module with get_flatc_path() and run_flatc() - Add scripts/smoke_test.py and scripts/smoke_test_flatc.py - Add justfile recipes: test-smoke, test-wheel-install, test-sdist-install This syncs autobahn-python with zlmdb's FlatBuffers bundling approach, using shared code from wamp-cicd/scripts/flatc/ for DRY. Note: This work was completed with AI assistance (Claude Code). * Add complete FlatBuffers vendoring with bundled flatc compiler - hatch_build.py: Add _build_flatc(), _generate_reflection_bfbs(), and _update_flatbuffers_git_version() methods for wheel builds - pyproject.toml: Add flatc console script entry point - flatbuffers/__init__.py: Add version() function and _git_version import - flatbuffers/_git_version.py: Git version tracking file - flatbuffers/reflection.fbs: Copy reflection schema for runtime access - scripts/update_flatbuffers.sh: External script for updating vendored flatbuffers - justfile: Simplify update-flatbuffers recipe, add test-bundled-flatc - .gitignore: Exclude flatc binary and reflection.bfbs build artifacts The wheel now includes: - Bundled flatc compiler built from deps/flatbuffers - reflection.bfbs generated during build - Git version tracking for vendored runtime Tested: wheel install, sdist install, smoke tests all pass Note: This work was completed with AI assistance (Claude Code). * Fix manylinux ISA compatibility: use manylinux_2_28 instead of manylinux_2_34 The manylinux_2_34 container uses a toolchain that defaults to x86_64_v2 ISA level (SSE4.2, POPCNT), which causes auditwheel to fail with: ValueError: Cannot repair the wheel, because required library "flatc" could not be located. x86_64_v2 (ISA level) is not compatible with manylinux platform tag's (x86_64) requirement. The manylinux_2_28 container uses baseline x86_64 ISA which is compatible with all manylinux platform tags. This matches zlmdb which already uses manylinux_2_28 successfully. Note: This work was completed with AI assistance (Claude Code). * Increase ARM64 build timeout to 30 minutes CFFI compilation under QEMU ARM64 emulation is very slow. CPython builds can take 20+ minutes due to emulation overhead. This matches zlmdb which already uses 30 minute timeouts. Note: This work was completed with AI assistance (Claude Code). * Increase ARM64 build timeout to 60 minutes CFFI and flatc compilation under QEMU ARM64 emulation is very slow. Builds can take 45+ minutes due to emulation overhead. Note: This work was completed with AI assistance (Claude Code). * Update release.yml to use manylinux_2_28 artifact names The wheels-docker workflow was changed to use manylinux_2_28 instead of manylinux_2_34 for ISA compatibility. The release workflow must use the matching artifact names. Note: This work was completed with AI assistance (Claude Code). * Add workflows README, WAMP .bfbs generation, and version sync check 1. Add .github/workflows/README.md documenting the CI/CD architecture, artifact flow, and platform coverage (adapted from zlmdb) 2. Add _generate_wamp_bfbs() to hatch_build.py to compile wamp.bfbs from the WAMP FlatBuffers schemas during wheel build. This binary schema file enables runtime schema introspection for WAMP messages. 3. Add check_zlmdb_flatbuffers_version_in_sync() to autobahn/__init__.py This is the reciprocal of zlmdb.check_autobahn_flatbuffers_version_in_sync() and verifies both libraries use the same vendored FlatBuffers runtime for reliable data-in-transit/data-at-rest interoperability. 4. Add wamp.bfbs to .gitignore as it's a build artifact Note: This work was completed with AI assistance (Claude Code). * Rename install-flatc to install-flatc-system with warning, add version check 1. Rename `install-flatc` to `install-flatc-system` with prominent warning explaining that users normally DON'T need this since autobahn bundles flatc in wheels. Adds interactive confirmation prompt. 2. Enhance smoke_test_flatc.py to verify flatc binary version matches the vendored FlatBuffers runtime version. This ensures consistency between the compiler and runtime library. Note: This work was completed with AI assistance (Claude Code).
1 parent 60f226c commit 467581c

18 files changed

Lines changed: 1793 additions & 67 deletions
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- [ ] I did **not** use any AI-assistance tools to help create this pull request.
2+
- [x] I **did** use AI-assistance tools to *help* create this pull request.
3+
- [x] I have read, understood and followed the project's AI_POLICY.md when creating code, documentation etc. for this pull request.
4+
5+
Submitted by: @oberstet
6+
Date: 2025-12-13
7+
Related issue(s): #1821
8+
Branch: oberstet:sync-autobahn-zlmdb

.github/workflows/README.md

Lines changed: 260 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/release.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
138138
// Query artifacts from wheels-docker workflow
139139
const wheelsDockerRunId = latestRuns['wheels-docker']?.id;
140-
core.setOutput('artifact_manylinux_x86_64', await findArtifact(wheelsDockerRunId, 'artifacts-manylinux_2_34_x86_64'));
140+
core.setOutput('artifact_manylinux_x86_64', await findArtifact(wheelsDockerRunId, 'artifacts-manylinux_2_28_x86_64'));
141141
142142
// Query artifacts from wheels-arm64 workflow
143143
const wheelsArm64RunId = latestRuns['wheels-arm64']?.id;
@@ -813,20 +813,20 @@ jobs:
813813
mode: strict
814814
keep-metadata: true # Keep CHECKSUMS for user verification
815815
targets: |
816-
cpy311-linux-x86_64-manylinux_2_34
816+
cpy311-linux-x86_64-manylinux_2_28
817817
cpy311-linux-aarch64-manylinux_2_28
818818
cpy311-win-amd64
819-
cpy312-linux-x86_64-manylinux_2_34
819+
cpy312-linux-x86_64-manylinux_2_28
820820
cpy312-win-amd64
821821
cpy313-macos-arm64
822-
cpy313-linux-x86_64-manylinux_2_34
822+
cpy313-linux-x86_64-manylinux_2_28
823823
cpy313-linux-aarch64-manylinux_2_28
824824
cpy313-win-amd64
825825
cpy314-macos-arm64
826-
cpy314-linux-x86_64-manylinux_2_34
826+
cpy314-linux-x86_64-manylinux_2_28
827827
cpy314-win-amd64
828828
pypy311-macos-arm64
829-
pypy311-linux-x86_64-manylinux_2_34
829+
pypy311-linux-x86_64-manylinux_2_28
830830
pypy311-linux-aarch64-manylinux_2_17
831831
pypy311-win-amd64
832832
source
@@ -1642,20 +1642,20 @@ jobs:
16421642
mode: strict
16431643
keep-metadata: true # Keep CHECKSUMS for user verification
16441644
targets: |
1645-
cpy311-linux-x86_64-manylinux_2_34
1645+
cpy311-linux-x86_64-manylinux_2_28
16461646
cpy311-linux-aarch64-manylinux_2_28
16471647
cpy311-win-amd64
1648-
cpy312-linux-x86_64-manylinux_2_34
1648+
cpy312-linux-x86_64-manylinux_2_28
16491649
cpy312-win-amd64
16501650
cpy313-macos-arm64
1651-
cpy313-linux-x86_64-manylinux_2_34
1651+
cpy313-linux-x86_64-manylinux_2_28
16521652
cpy313-linux-aarch64-manylinux_2_28
16531653
cpy313-win-amd64
16541654
cpy314-macos-arm64
1655-
cpy314-linux-x86_64-manylinux_2_34
1655+
cpy314-linux-x86_64-manylinux_2_28
16561656
cpy314-win-amd64
16571657
pypy311-macos-arm64
1658-
pypy311-linux-x86_64-manylinux_2_34
1658+
pypy311-linux-x86_64-manylinux_2_28
16591659
pypy311-linux-aarch64-manylinux_2_17
16601660
pypy311-win-amd64
16611661
source
@@ -2262,20 +2262,20 @@ jobs:
22622262
mode: strict
22632263
# keep-metadata: false (default - removes CHECKSUMS for PyPI)
22642264
targets: |
2265-
cpy311-linux-x86_64-manylinux_2_34
2265+
cpy311-linux-x86_64-manylinux_2_28
22662266
cpy311-linux-aarch64-manylinux_2_28
22672267
cpy311-win-amd64
2268-
cpy312-linux-x86_64-manylinux_2_34
2268+
cpy312-linux-x86_64-manylinux_2_28
22692269
cpy312-win-amd64
22702270
cpy313-macos-arm64
2271-
cpy313-linux-x86_64-manylinux_2_34
2271+
cpy313-linux-x86_64-manylinux_2_28
22722272
cpy313-linux-aarch64-manylinux_2_28
22732273
cpy313-win-amd64
22742274
cpy314-macos-arm64
2275-
cpy314-linux-x86_64-manylinux_2_34
2275+
cpy314-linux-x86_64-manylinux_2_28
22762276
cpy314-win-amd64
22772277
pypy311-macos-arm64
2278-
pypy311-linux-x86_64-manylinux_2_34
2278+
pypy311-linux-x86_64-manylinux_2_28
22792279
pypy311-linux-aarch64-manylinux_2_17
22802280
pypy311-win-amd64
22812281
source

.github/workflows/wheels-arm64.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ jobs:
130130
if: matrix.target.build_type == 'custom'
131131
uses: nick-fields/retry@v3
132132
with:
133-
timeout_minutes: 10
133+
# CFFI and flatc compilation under QEMU ARM64 emulation is very slow
134+
# Builds can take 45+ minutes due to emulation overhead
135+
timeout_minutes: 60
134136
max_attempts: 3
135137
retry_on: error
136138
warning_on_retry: true
@@ -153,7 +155,9 @@ jobs:
153155
- name: Build ARM64 wheels with NVX extension (with retry for QEMU flakiness)
154156
uses: nick-fields/retry@v3
155157
with:
156-
timeout_minutes: 15
158+
# CFFI and flatc compilation under QEMU ARM64 emulation is very slow
159+
# Builds can take 45+ minutes due to emulation overhead
160+
timeout_minutes: 60
157161
max_attempts: 3
158162
retry_on: error
159163
warning_on_retry: true

.github/workflows/wheels-docker.yml

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,14 @@ jobs:
4545
fail-fast: false
4646
matrix:
4747
target:
48-
# manylinux_2_34 (glibc 2.34+) - PEP 600 compliant for modern Linux
48+
# manylinux_2_28 (glibc 2.28+) - PEP 600 compliant, wide compatibility
49+
# IMPORTANT: manylinux_2_28 uses baseline x86_64 ISA level (no SSE4.2/POPCNT)
50+
# which is required for auditwheel to repair binaries like flatc.
51+
# manylinux_2_34 uses x86_64_v2 which causes auditwheel failures.
52+
# Matches zlmdb which also uses manylinux_2_28.
4953
# see: https://github.com/pypa/manylinux
50-
- name: "manylinux_2_34_x86_64"
51-
base_image: "quay.io/pypa/manylinux_2_34_x86_64"
52-
53-
# Future manylinux images can be added here:
54-
# - name: "manylinux_2_34_aarch64"
55-
# base_image: "quay.io/pypa/manylinux_2_34_aarch64"
56-
57-
# Deactivated for now - focusing on standard manylinux wheels:
58-
# - name: "debian12-amd64"
59-
# base_image: "debian:12"
60-
# - name: "rocky9-amd64"
61-
# base_image: "rockylinux:9"
62-
# - name: "ubuntu2404-amd64"
63-
# base_image: "ubuntu:24.04"
54+
- name: "manylinux_2_28_x86_64"
55+
base_image: "quay.io/pypa/manylinux_2_28_x86_64"
6456

6557
steps:
6658
- name: Checkout code
@@ -197,22 +189,13 @@ jobs:
197189
command -v auditwheel >/dev/null || { echo "auditwheel missing, aborting"; exit 1; }
198190
mkdir -p wheelhouse
199191
200-
# Convert linux_x86_64 wheels to multi-platform tag (incl. manylinux_2_34_x86_64) using auditwheel
192+
# Convert linux_x86_64 wheels to manylinux_2_28_x86_64 using auditwheel
201193
echo ""
202-
echo "==> Converting wheels to multi-platform tag (incl. manylinux_2_34_x86_64) format..."
194+
echo "==> Converting wheels to manylinux_2_28_x86_64 format..."
203195
for wheel in dist/*.whl; do
204196
if [[ "$wheel" == *"linux_x86_64"* ]]; then
205197
echo "Converting: $(basename $wheel)"
206-
207-
# show autodetected set of platform tags
208198
auditwheel show "$wheel"
209-
210-
# fix/rename wheel based on autodetected platform tags and store in wheelhouse/
211-
# -> auditwheel will encode all (!) supported tags into the wheel filename
212-
# -> Python packaging ecosystem allows wheels to carry multiple platform tags
213-
# -> pip will then pick the most specific tag that works for the current system
214-
# -> so we do not need to manually set: --plat manylinux_2_34_x86_64 as in:
215-
# auditwheel repair "$wheel" --plat manylinux_2_34_x86_64 -w wheelhouse/
216199
auditwheel repair "$wheel" -w wheelhouse/
217200
else
218201
echo "Copying non-linux wheel: $(basename $wheel)"

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ node.key
4545
src/autobahn/nvx/_nvx_*.c
4646
src/_nvx_*.c
4747

48+
# Build artifact: flatc binary (compiled from deps/flatbuffers during wheel build)
49+
src/autobahn/_flatc/bin/
50+
51+
# Build artifact: reflection.bfbs (generated from reflection.fbs during wheel build)
52+
src/autobahn/flatbuffers/reflection.bfbs
53+
54+
# Build artifact: wamp.bfbs (generated from wamp.fbs during wheel build)
55+
src/autobahn/wamp/flatbuffers/wamp.bfbs
56+
4857
.wheels
4958
get-pip.py
5059
docs/autoapi/

0 commit comments

Comments
 (0)