Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Update Synapse pipelines for Python 3.9 #119

Merged
merged 11 commits into from
Jan 8, 2021
182 changes: 102 additions & 80 deletions synapse/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,21 @@ steps:

################################################################################
#
# `trial` tests
# Twisted `trial` tests
#
# Our Intent is to test:
# - All supported Python versions (using SQLite) with current dependencies
# - The oldest and newest supported pairings of Python and PostgreSQL
#
# We also test two special cases:
# - The newest supported Python, without any optional dependencies
# - The oldest supported Python, with its oldest supported dependency versions
#
################################################################################

- label: ":python: 3.5 / SQLite / Old Deps"
# -- Special Case: Oldest Python w/ Oldest Deps

- label: ":python: 3.5 (Old Deps)"
command:
- ".buildkite/scripts/test_old_deps.sh"
env:
Expand All @@ -122,11 +132,29 @@ steps:
propagate-environment: true
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
# - matrix-org/coveralls#v1.0:
# parallel: "true"
retry: *retry_setup

- label: ":python: 3.5 / SQLite"
# -- Special Case: Newest Python w/o Optional Deps

- label: ":python: 3.9 (No Extras)"
command:
- *trial_setup
- "tox -e py39-noextras,combine"
env:
TRIAL_FLAGS: "-j 2"
plugins:
- docker#v3.7.0:
image: "python:3.9"
workdir: "/src"
mount-buildkite-agent: false
propagate-environment: true
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
retry: *retry_setup

# -- All Supported Python Versions (SQLite)

- label: ":python: 3.5"
command:
- *trial_setup
- "tox -e py35,combine"
Expand All @@ -140,11 +168,9 @@ steps:
propagate-environment: true
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
# - matrix-org/coveralls#v1.0:
# parallel: "true"
retry: *retry_setup

- label: ":python: 3.6 / SQLite"
- label: ":python: 3.6"
command:
- *trial_setup
- "tox -e py36,combine"
Expand All @@ -158,11 +184,9 @@ steps:
propagate-environment: true
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
# - matrix-org/coveralls#v1.0:
# parallel: "true"
retry: *retry_setup

- label: ":python: 3.7 / SQLite"
- label: ":python: 3.7"
command:
- *trial_setup
- "tox -e py37,combine"
Expand All @@ -176,14 +200,12 @@ steps:
propagate-environment: true
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
# - matrix-org/coveralls#v1.0:
# parallel: "true"
retry: *retry_setup

- label: ":python: 3.8 / noextras / SQLite"
- label: ":python: 3.8"
command:
- *trial_setup
- "tox -e py38-noextras,combine"
- "tox -e py38,combine"
env:
TRIAL_FLAGS: "-j 2"
plugins:
Expand All @@ -195,42 +217,35 @@ steps:
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
retry: *retry_setup

- label: ":python: 3.5 / :postgres: 9.5"
agents:
queue: "medium"
env:
TRIAL_FLAGS: "-j 8"
PYTHON_VERSION: "3.5"
POSTGRES_VERSION: "9.5"

- label: ":python: 3.9"
command:
- *trial_setup
- "python -m tox -e py35-postgres,combine"
- "tox -e py39,combine"
env:
TRIAL_FLAGS: "-j 2"
plugins:
- matrix-org/download#v1.1.0:
urls:
- https://raw.githubusercontent.com/matrix-org/pipelines/master/synapse/docker-compose.yaml
- https://raw.githubusercontent.com/matrix-org/pipelines/master/synapse/docker-compose-env
- docker-compose#v3.7.0:
run: testenv
config:
- /tmp/download-${BUILDKITE_BUILD_ID}/docker-compose.yaml
- docker#v3.7.0:
image: "python:3.9"
workdir: "/src"
mount-buildkite-agent: false
propagate-environment: true
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
# - matrix-org/coveralls#v1.0:
# parallel: "true"
retry: *retry_setup

- label: ":python: 3.7 / :postgres: 11"
# -- Oldest and Newest Supported Python and Postgres Pairings

- label: ":python: 3.5 :postgres: 9.5"
agents:
queue: "medium"
env:
TRIAL_FLAGS: "-j 8"
PYTHON_VERSION: "3.7"
POSTGRES_VERSION: "11"
PYTHON_VERSION: "3.5"
POSTGRES_VERSION: "9.5"
command:
- *trial_setup
- "python -m tox -e py37-postgres,combine"
- "python -m tox -e py35-postgres,combine"
plugins:
- matrix-org/download#v1.1.0:
urls:
Expand All @@ -242,20 +257,18 @@ steps:
- /tmp/download-${BUILDKITE_BUILD_ID}/docker-compose.yaml
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
# - matrix-org/coveralls#v1.0:
# parallel: "true"
retry: *retry_setup

- label: ":python: 3.8 / :postgres: 12"
- label: ":python: 3.9 :postgres: 13"
agents:
queue: "medium"
env:
TRIAL_FLAGS: "-j 8"
PYTHON_VERSION: "3.8"
POSTGRES_VERSION: "12"
PYTHON_VERSION: "3.9"
POSTGRES_VERSION: "13"
command:
- *trial_setup
- "python -m tox -e py38-postgres,combine"
- "python -m tox -e py39-postgres,combine"
plugins:
- matrix-org/download#v1.1.0:
urls:
Expand All @@ -267,17 +280,41 @@ steps:
- /tmp/download-${BUILDKITE_BUILD_ID}/docker-compose.yaml
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
# - matrix-org/coveralls#v1.0:
# parallel: "true"
retry: *retry_setup

################################################################################
#
# Sytest
#
# Our tests have three dimensions:
# 1. Topology (Monolith, Workers, Workers w/ Redis)
# 2. Database (SQLite, PostgreSQL)
# 3. Python Version
#
# Tests can run against either a single or multiple PostgreSQL databases.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically Synapse can run against a sqlite and a postgres, though doing that seems slightly insane and the sytest setup scripts have no support for such a thing.

# This is configured by setting `MULTI_POSTGRES=1` in the environment.
#
# We mostly care about testing each topology.
# To vary the Python and Postgres versions, we use Docker images which are based
# on an assortment of Debian releases.
# - "py35" is Debian 9 Stretch (Python 3.5, Postgres 9.6)
# - "py37" is Debian 10 Buster (Python 3.7, Postgres 11)
# - "py38" is Debian 11 Bullseye (Python 3.9, Postgres 13)
#
# Our intent is to test:
# - Monolith:
# - Older Distro + SQLite
# - Older Python + Older PostgreSQL
# - Newer Python + Newer PostgreSQL
# - Workers:
# - Older Python + Older PostgreSQL (MULTI_POSTGRES)
# - Newer Python + Newer PostgreSQL (MULTI_POSTGRES)
# - Workers w/ Redis:
# - Newer Python + Newer PostgreSQL
#
################################################################################

- label: "SyTest - :python: 3.5 / SQLite / Monolith"
- label: "SyTest Monolith :sqlite: :debian: 9"
agents:
queue: "medium"
command:
Expand All @@ -299,11 +336,9 @@ steps:
- matrix-org/annotate:
path: "logs/annotate.md"
style: "error"
# - matrix-org/coveralls#v1.0:
# parallel: "true"
retry: *retry_setup

- label: "SyTest - :python: 3.5 / :postgres: 9.6 / Monolith"
- label: "SyTest Monolith :postgres: :debian: 9"
agents:
queue: "medium"
env:
Expand All @@ -327,25 +362,19 @@ steps:
- matrix-org/annotate:
path: "logs/annotate.md"
style: "error"
# - matrix-org/coveralls#v1.0:
# parallel: "true"
retry: *retry_setup

- label: "SyTest - :python: 3.5 / :postgres: 9.6 / Workers"
- label: "SyTest Monolith :postgres: :debian: 11"
agents:
queue: "xlarge"
queue: "medium"
env:
MULTI_POSTGRES: "1" # Test with split out databases
POSTGRES: "1"
WORKERS: "1"
BLACKLIST: "synapse-blacklist-with-workers"
command:
- "bash .buildkite/merge_base_branch.sh"
- "bash -c 'cat /src/sytest-blacklist /src/.buildkite/worker-blacklist > /src/synapse-blacklist-with-workers'"
- "bash /bootstrap.sh synapse"
plugins:
- docker#v3.7.0:
image: "matrixdotorg/sytest-synapse:py35"
image: "matrixdotorg/sytest-synapse:py38"
propagate-environment: true
always-pull: true
workdir: "/src"
Expand All @@ -359,22 +388,23 @@ steps:
- matrix-org/annotate:
path: "logs/annotate.md"
style: "error"
# - matrix-org/coveralls#v1.0:
# parallel: "true"
retry: *retry_setup


- label: "SyTest - :python: 3.8 / :postgres: 12 / Monolith"
- label: "SyTest Workers :postgres: :debian: 9"
agents:
queue: "medium"
queue: "xlarge"
env:
MULTI_POSTGRES: "1" # Test with split out databases
POSTGRES: "1"
WORKERS: "1"
BLACKLIST: "synapse-blacklist-with-workers"
command:
- "bash .buildkite/merge_base_branch.sh"
- "bash -c 'cat /src/sytest-blacklist /src/.buildkite/worker-blacklist > /src/synapse-blacklist-with-workers'"
- "bash /bootstrap.sh synapse"
plugins:
- docker#v3.7.0:
image: "matrixdotorg/sytest-synapse:py38"
image: "matrixdotorg/sytest-synapse:py35"
propagate-environment: true
always-pull: true
workdir: "/src"
Expand All @@ -388,11 +418,9 @@ steps:
- matrix-org/annotate:
path: "logs/annotate.md"
style: "error"
# - matrix-org/coveralls#v1.0:
# parallel: "true"
retry: *retry_setup

- label: "SyTest - :python: 3.7 / :postgres: 11 / Workers"
- label: "SyTest Workers :postgres: :debian: 10"
agents:
queue: "xlarge"
env:
Expand Down Expand Up @@ -420,11 +448,9 @@ steps:
- matrix-org/annotate:
path: "logs/annotate.md"
style: "error"
# - matrix-org/coveralls#v1.0:
# parallel: "true"
retry: *retry_setup

- label: "SyTest - :python: 3.7 / :postgres: 11 / Workers / :redis: Redis"
- label: "SyTest Workers :redis: :postgres: :debian: 10
agents:
# this one seems to need a lot of memory.
queue: "xlarge"
Expand Down Expand Up @@ -453,14 +479,14 @@ steps:
- matrix-org/annotate:
path: "logs/annotate.md"
style: "error"
# - matrix-org/coveralls#v1.0:
# parallel: "true"
retry: *retry_setup

################################################################################
#
# synapse_port_db
#
# Tests the oldest and newest supported pairings of Python and PostgreSQL
#
################################################################################

- label: "synapse_port_db / :python: 3.5 / :postgres: 9.5"
Expand All @@ -482,15 +508,13 @@ steps:
- /tmp/download-${BUILDKITE_BUILD_ID}/docker-compose.yaml
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
# - matrix-org/coveralls#v1.0:
# parallel: "true"

- label: "synapse_port_db / :python: 3.7 / :postgres: 11"
- label: "synapse_port_db / :python: 3.9 / :postgres: 13"
agents:
queue: "medium"
env:
PYTHON_VERSION: "3.7"
POSTGRES_VERSION: "11"
PYTHON_VERSION: "3.9"
POSTGRES_VERSION: "13"
command:
- "bash .buildkite/scripts/test_synapse_port_db.sh"
plugins:
Expand All @@ -504,8 +528,6 @@ steps:
- /tmp/download-${BUILDKITE_BUILD_ID}/docker-compose.yaml
- artifacts#v1.3.0:
upload: [ "_trial_temp/*/*.log" ]
# - matrix-org/coveralls#v1.0:
# parallel: "true"

# - wait: ~
# continue_on_failure: true
Expand Down