Update flow run instrumentation to use RunTelemetry
class (#16233)
#19075
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: Replace `wait-for-server` with dedicated command | |
# https://github.com/PrefectHQ/prefect/issues/6990 | |
name: Integration tests | |
on: | |
pull_request: | |
paths: | |
- .github/workflows/integration-tests.yaml | |
- "src/prefect/**/*.py" | |
- requirements.txt | |
- requirements-client.txt | |
- requirements-dev.txt | |
- ui/** | |
- .nvmrc | |
- Dockerfile | |
- flows/* | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/integration-tests.yaml | |
- "**/*.py" | |
- requirements.txt | |
- requirements-client.txt | |
- requirements-dev.txt | |
- ui/** | |
- .nvmrc | |
- Dockerfile | |
jobs: | |
compatibility-tests: | |
name: Integration tests @${{ matrix.server-version.version }} | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
server-version: [ | |
# These versions correspond to Prefect image tags, the patch version is | |
# excluded to always pull the latest patch of each minor version. The ref | |
# should generally be set to the latest patch release for that version. | |
{ version: "main", ref: "main" }, | |
] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
id: setup_python | |
with: | |
python-version: "3.10" | |
- name: UV Cache | |
# Manually cache the uv cache directory | |
# until setup-python supports it: | |
# https://github.com/actions/setup-python/issues/822 | |
uses: actions/cache@v4 | |
id: cache-uv | |
with: | |
path: ~/.cache/uv | |
key: uvcache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('requirements-client.txt', 'requirements.txt', 'requirements-dev.txt') }} | |
- name: Install python packages | |
run: | | |
python -m pip install -U uv | |
uv pip install --upgrade --system . | |
- name: Start server@${{ matrix.server-version.version }} | |
if: ${{ matrix.server-version.version != 'main' }} | |
env: | |
PREFECT_API_URL: http://127.0.0.1:4200/api | |
PREFECT_SERVER_LOGGING_LEVEL: DEBUG | |
PREFECT_EXPERIMENTAL_EVENTS: "true" | |
run: > | |
docker run \ | |
--name "prefect-server" \ | |
-d \ | |
-p 4200:4200 \ | |
-e PREFECT_API_URL=${{ env.PREFECT_API_URL }} \ | |
-e PREFECT_SERVER_LOGGING_LEVEL=${{ env.PREFECT_SERVER_LOGGING_LEVEL }} \ | |
${{ matrix.server-version.image }} \ | |
prefect server start --analytics-off --host 0.0.0.0 | |
./scripts/wait-for-server.py | |
- name: Start server | |
if: ${{ matrix.server-version.version == 'main' }} | |
env: | |
PREFECT_API_URL: http://127.0.0.1:4200/api | |
PREFECT_SERVER_LOGGING_LEVEL: DEBUG | |
run: > | |
prefect server start --analytics-off --host 0.0.0.0 2>&1 > server.log & | |
./scripts/wait-for-server.py | |
- name: Run integration flows | |
env: | |
PREFECT_API_URL: http://127.0.0.1:4200/api | |
SERVER_VERSION: ${{ matrix.server-version.version }} | |
run: > | |
./scripts/run-integration-flows.py flows/ | |
- name: Show server logs | |
if: always() | |
run: | | |
cat server.log || echo "No logs available" | |
docker logs prefect-server || echo "No logs available" | |
sqlite-3-24-0: | |
name: Test SQLite 3.24.0 Compatibility | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Test with SQLite 3.24.0 | |
run: > | |
docker build -t prefect-server-old-sqlite \ | |
--build-arg SQLITE_VERSION=3240000 \ | |
--build-arg SQLITE_YEAR=2018 \ | |
-f old-sqlite.Dockerfile . && | |
docker run prefect-server-old-sqlite sh -c "prefect server database downgrade --yes -r base && prefect server database upgrade --yes" | |
sqlite-3-31-1: | |
name: Test SQLite 3.31.1 Compatibility | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Test with SQLite 3.31.1 | |
run: > | |
docker build -t prefect-server-new-sqlite \ | |
--build-arg SQLITE_VERSION=3310100 \ | |
--build-arg SQLITE_YEAR=2020 \ | |
-f old-sqlite.Dockerfile . && | |
docker run prefect-server-new-sqlite sh -c "prefect server database downgrade --yes -r base && prefect server database upgrade --yes" |