Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: Fix modules CI #2308

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 85 additions & 85 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ jobs:
load-engine-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.load-engine-matrix.outputs.matrix }}
matrix: ${{ steps.load-engine-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Load the engine matrix
id: load-engine-matrix
shell: bash
run: echo "matrix=$(jq -c . < .github/json_matrices/engine-matrix.json)" >> $GITHUB_OUTPUT

test:
runs-on: ${{ matrix.host.RUNNER }}
needs: load-engine-matrix
Expand All @@ -67,17 +67,17 @@ jobs:
matrix:
engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }}
python:
# - "3.8"
# - "3.9"
# - "3.10"
# - "3.11"
# - "3.8"
# - "3.9"
# - "3.10"
# - "3.11"
- "3.12"
host:
- {
OS: ubuntu,
RUNNER: ubuntu-latest,
TARGET: x86_64-unknown-linux-gnu
}
OS: ubuntu,
RUNNER: ubuntu-latest,
TARGET: x86_64-unknown-linux-gnu,
}
# - {
# OS: macos,
# RUNNER: macos-latest,
Expand Down Expand Up @@ -150,17 +150,17 @@ jobs:
matrix:
engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }}
python:
# - "3.8"
# - "3.9"
# - "3.10"
# - "3.11"
# - "3.8"
# - "3.9"
# - "3.10"
# - "3.11"
- "3.12"
host:
- {
OS: ubuntu,
RUNNER: ubuntu-latest,
TARGET: x86_64-unknown-linux-gnu
}
OS: ubuntu,
RUNNER: ubuntu-latest,
TARGET: x86_64-unknown-linux-gnu,
}
# - {
# OS: macos,
# RUNNER: macos-latest,
Expand All @@ -171,27 +171,27 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Build Python wrapper
uses: ./.github/workflows/build-python-wrapper
with:
os: ${{ matrix.host.OS }}
target: ${{ matrix.host.TARGET }}
github-token: ${{ secrets.GITHUB_TOKEN }}
engine-version: ${{ matrix.engine.version }}

- name: Test pubsub with pytest
working-directory: ./python
run: |
source .env/bin/activate
cd python/tests/
pytest --asyncio-mode=auto -k test_pubsub --html=pytest_report.html --self-contained-html

- name: Upload test reports
if: always()
continue-on-error: true
Expand Down Expand Up @@ -288,76 +288,76 @@ jobs:
name: smoke-test-report-amazon-linux
path: |
python/python/tests/pytest_report.html

start-self-hosted-runner:
if: github.event.pull_request.head.repo.owner.login == 'valkey-io'
runs-on: ubuntu-latest
environment: AWS_ACTIONS
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Start self hosted EC2 runner
uses: ./.github/workflows/start-self-hosted-runner
with:
role-to-assume: ${{ secrets.ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
ec2-instance-id: ${{ secrets.AWS_EC2_INSTANCE_ID }}
if: github.event.pull_request.head.repo.owner.login == 'valkey-io' || (github.repository_owner == 'valkey-io' && github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
environment: AWS_ACTIONS
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Start self hosted EC2 runner
uses: ./.github/workflows/start-self-hosted-runner
with:
role-to-assume: ${{ secrets.ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
ec2-instance-id: ${{ secrets.AWS_EC2_INSTANCE_ID }}

test-modules:
needs: [start-self-hosted-runner, load-engine-matrix]
name: Running Module Tests
runs-on: ${{ matrix.host.RUNNER }}
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
needs: [start-self-hosted-runner, load-engine-matrix]
name: Running Module Tests
runs-on: ${{ matrix.host.RUNNER }}
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
engine: ${{ fromJson(needs.load-engine-matrix.outputs.matrix) }}
python:
- "3.12"
host:
- {
OS: "ubuntu",
NAMED_OS: "linux",
RUNNER: ["self-hosted", "Linux", "ARM64"],
TARGET: "aarch64-unknown-linux-gnu",
}
steps:
- name: Setup self-hosted runner access
if: ${{ contains(matrix.host.RUNNER, 'self-hosted') }}
run: sudo chown -R $USER:$USER /home/ubuntu/actions-runner/_work/valkey-glide
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python for self-hosted Ubuntu runners
run: |
OS: "ubuntu",
NAMED_OS: "linux",
RUNNER: ["self-hosted", "Linux", "ARM64"],
TARGET: "aarch64-unknown-linux-gnu",
}

steps:
- name: Setup self-hosted runner access
if: ${{ contains(matrix.host.RUNNER, 'self-hosted') }}
run: sudo chown -R $USER:$USER /home/ubuntu/actions-runner/_work/valkey-glide

- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Python for self-hosted Ubuntu runners
run: |
sudo apt update -y
sudo apt upgrade -y
sudo apt install python3 python3-venv python3-pip -y
- name: Build Python wrapper
uses: ./.github/workflows/build-python-wrapper
with:
os: ${{ matrix.host.OS }}
target: ${{ matrix.host.TARGET }}
github-token: ${{ secrets.GITHUB_TOKEN }}
engine-version: ${{ matrix.engine.version }}

- name: Test with pytest
working-directory: ./python
run: |
source .env/bin/activate
cd python/tests/
pytest --asyncio-mode=auto --tls --cluster-endpoints=${{ secrets.MEMDB_MODULES_ENDPOINT }} -k server_modules --html=pytest_report.html --self-contained-html

- name: Upload test reports
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: smoke-test-report-amazon-linux
path: |
python/python/tests/pytest_report.html

- name: Build Python wrapper
uses: ./.github/workflows/build-python-wrapper
with:
os: ${{ matrix.host.OS }}
target: ${{ matrix.host.TARGET }}
github-token: ${{ secrets.GITHUB_TOKEN }}
engine-version: ${{ matrix.engine.version }}

- name: Test with pytest
working-directory: ./python
run: |
source .env/bin/activate
cd python/tests/
pytest --asyncio-mode=auto --tls --cluster-endpoints=${{ secrets.MEMDB_MODULES_ENDPOINT }} -k server_modules --html=pytest_report.html --self-contained-html

- name: Upload test reports
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: modules-test-report-${{ matrix.host.TARGET }}-python-${{ matrix.python }}-server-${{ matrix.engine.version }}
path: |
python/python/tests/pytest_report.html
Loading