Compare commits

...

5 Commits

Author SHA1 Message Date
Quentin Gliech
7a55db885a
Merge e43b0f9bd18f6d4ec9f9e9d992ecdcceaaf10982 into cc8da2c5ed0cecc771919d76533704a04de9a41e 2025-07-02 16:06:37 +01:00
Erik Johnston
cc8da2c5ed
Log the room ID we're purging state for (#18625)
So we can see what we're deleting.
2025-07-02 15:02:12 +01:00
Quentin Gliech
e43b0f9bd1
TEMP: pretend this is not a PR 2025-07-01 17:45:19 +02:00
Quentin Gliech
0272860424
Newsfile 2025-07-01 17:45:19 +02:00
Quentin Gliech
79dfdceba1
Use native arm runners for building wheels 2025-07-01 17:45:19 +02:00
5 changed files with 24 additions and 29 deletions

View File

@ -107,27 +107,29 @@ jobs:
path: debs/* path: debs/*
build-wheels: build-wheels:
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }} name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-24.04, macos-13] os:
arch: [x86_64, aarch64] - ubuntu-24.04
- ubuntu-24.04-arm
- macos-13 # This uses x86-64
- macos-14 # This uses arm64
# is_pr is a flag used to exclude certain jobs from the matrix on PRs. # is_pr is a flag used to exclude certain jobs from the matrix on PRs.
# It is not read by the rest of the workflow. # It is not read by the rest of the workflow.
is_pr: is_pr:
- ${{ startsWith(github.ref, 'refs/pull/') }} - false
exclude: exclude:
# Don't build macos wheels on PR CI. # Don't build macos wheels on PR CI.
- is_pr: true - is_pr: true
os: "macos-13" os: "macos-13"
# Don't build aarch64 wheels on mac. - is_pr: true
- os: "macos-13" os: "macos-14"
arch: aarch64
# Don't build aarch64 wheels on PR CI. # Don't build aarch64 wheels on PR CI.
- is_pr: true - is_pr: true
arch: aarch64 os: "ubuntu-24.04-arm"
steps: steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@ -141,19 +143,9 @@ jobs:
- name: Install cibuildwheel - name: Install cibuildwheel
run: python -m pip install cibuildwheel==3.0.0 run: python -m pip install cibuildwheel==3.0.0
- name: Set up QEMU to emulate aarch64
if: matrix.arch == 'aarch64'
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
platforms: arm64
- name: Build aarch64 wheels
if: matrix.arch == 'aarch64'
run: echo 'CIBW_ARCHS_LINUX=aarch64' >> $GITHUB_ENV
- name: Only build a single wheel on PR - name: Only build a single wheel on PR
if: startsWith(github.ref, 'refs/pull/') if: false
run: echo "CIBW_BUILD="cp39-manylinux_${{ matrix.arch }}"" >> $GITHUB_ENV run: echo "CIBW_BUILD="cp39-manylinux_*"" >> $GITHUB_ENV
- name: Build wheels - name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse run: python -m cibuildwheel --output-dir wheelhouse
@ -161,13 +153,10 @@ jobs:
# Skip testing for platforms which various libraries don't have wheels # Skip testing for platforms which various libraries don't have wheels
# for, and so need extra build deps. # for, and so need extra build deps.
CIBW_TEST_SKIP: pp3*-* *i686* *musl* CIBW_TEST_SKIP: pp3*-* *i686* *musl*
# Fix Rust OOM errors on emulated aarch64: https://github.com/rust-lang/cargo/issues/10583
CARGO_NET_GIT_FETCH_WITH_CLI: true
CIBW_ENVIRONMENT_PASS_LINUX: CARGO_NET_GIT_FETCH_WITH_CLI
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with: with:
name: Wheel-${{ matrix.os }}-${{ matrix.arch }} name: Wheel-${{ matrix.os }}
path: ./wheelhouse/*.whl path: ./wheelhouse/*.whl
build-sdist: build-sdist:

1
changelog.d/18618.misc Normal file
View File

@ -0,0 +1 @@
Speed up the building of arm-based wheels in CI.

1
changelog.d/18625.misc Normal file
View File

@ -0,0 +1 @@
Log the room ID we're purging state for.

View File

@ -382,13 +382,10 @@ build-backend = "poetry.core.masonry.api"
# Skip unsupported platforms (by us or by Rust). # Skip unsupported platforms (by us or by Rust).
# See https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip for the list of build targets. # See https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip for the list of build targets.
# We skip: # We skip:
# - CPython 3.6, 3.7 and 3.8: EOLed # - CPython and PyPy 3.8: EOLed
# - PyPy 3.7 and 3.8: we only support Python 3.9+
# - musllinux i686: excluded to reduce number of wheels we build. # - musllinux i686: excluded to reduce number of wheels we build.
# c.f. https://github.com/matrix-org/synapse/pull/12595#discussion_r963107677 # c.f. https://github.com/matrix-org/synapse/pull/12595#discussion_r963107677
# - PyPy on Aarch64 and musllinux on aarch64: too slow to build. skip = "cp38* pp38* *-musllinux_i686"
# c.f. https://github.com/matrix-org/synapse/pull/14259
skip = "cp36* cp37* cp38* pp37* pp38* *-musllinux_i686 pp*aarch64 *-musllinux_aarch64"
# Enable non-default builds. # Enable non-default builds.
# "pypy" used to be included by default up until cibuildwheel 3. # "pypy" used to be included by default up until cibuildwheel 3.
enable = "pypy" enable = "pypy"

View File

@ -34,6 +34,7 @@ from synapse.metrics.background_process_metrics import wrap_as_background_proces
from synapse.storage.database import LoggingTransaction from synapse.storage.database import LoggingTransaction
from synapse.storage.databases import Databases from synapse.storage.databases import Databases
from synapse.types.storage import _BackgroundUpdates from synapse.types.storage import _BackgroundUpdates
from synapse.util.stringutils import shortstr
if TYPE_CHECKING: if TYPE_CHECKING:
from synapse.server import HomeServer from synapse.server import HomeServer
@ -167,6 +168,12 @@ class PurgeEventsStorageController:
break break
(room_id, groups_to_sequences) = next_to_delete (room_id, groups_to_sequences) = next_to_delete
logger.info(
"[purge] deleting state groups for room %s: %s",
room_id,
shortstr(groups_to_sequences.keys(), maxitems=10),
)
made_progress = await self._delete_state_groups( made_progress = await self._delete_state_groups(
room_id, groups_to_sequences room_id, groups_to_sequences
) )