Skip to content

Commit

Permalink
Merge pull request #206 from sensein/205-task-support-python-312
Browse files Browse the repository at this point in the history
support Python 3.12
  • Loading branch information
fabiocat93 authored Nov 21, 2024
2 parents 1e28e97 + 3a877f7 commit 69dea7e
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 3 deletions.
147 changes: 146 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
include:
- {os: macos-latest, architecture: arm64, python-version: '3.10'}
# - {os: macos-latest, architecture: arm64, python-version: '3.11'}
# the reason why we commented out 3.11 is that it hits github rate limit for some modules (e.g., knn-vc, Camb-ai/mars5-tts)
# - {os: macos-latest, architecture: arm64, python-version: '3.12'}
# the reason why we commented out 3.11 and 3.12 is that it hits github rate limit for some modules (e.g., knn-vc, Camb-ai/mars5-tts)
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -384,3 +385,147 @@ jobs:
github-token: ${{ secrets.GH_TOKEN }}
label: ${{ needs.start-runner-311.outputs.label }}
ec2-instance-id: ${{ needs.start-runner-311.outputs.ec2-instance-id }}


start-runner-312:
if: github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'to-test-gpu') && success()
needs:
- pre-commit
- macos-tests
name: start-runner-312
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
job-ran: ${{ steps.set-ran.outputs.ran }}
steps:
- id: set-ran
run: echo "::set-output name=ran::true"
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_KEY_SECRET }}
aws-region: ${{ vars.AWS_REGION }}
- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.GH_TOKEN }}
ec2-image-id: ${{ vars.AWS_IMAGE_ID }}
ec2-instance-type: ${{ vars.AWS_INSTANCE_TYPE }}
subnet-id: ${{ vars.AWS_SUBNET }}
security-group-id: ${{ vars.AWS_SECURITY_GROUP }}

ubuntu-tests-312:
name: ubuntu-tests-312
needs: start-runner-312
runs-on: ${{ needs.start-runner-312.outputs.label }}
defaults:
run:
shell: bash
working-directory: ${{ vars.WORKING_DIR }}
strategy:
matrix:
python-version: ['3.12']
env:
WORKING_DIR: ${{ vars.WORKING_DIR }}
POETRY_CACHE_DIR: ${{ vars.WORKING_DIR }}
outputs:
job-ran: ${{ steps.set-ran.outputs.ran }}
steps:
- id: set-ran
run: echo "::set-output name=ran::true"
- uses: actions/checkout@v4
with:
fetch-depth: 1 # no need for the history
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install ffmpeg (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -y ffmpeg
shell: bash
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Check available space
run: |
df -h
shell: bash
- name: Echo python info
run: |
python --version
which python
shell: bash
- name: Copy senselab directory to current directory
run: |
cp -r /actions-runner/_work/senselab/senselab .
- name: Install dependencies with Poetry
run: |
cd senselab
poetry env use ${{ matrix.python-version }}
poetry install --with dev
shell: bash
- name: Check poetry info
run: |
cd senselab
poetry env info
poetry --version
shell: bash
- name: Check NVIDIA SMI details
run: |
cd senselab
poetry run nvidia-smi
poetry run nvidia-smi -L
poetry run nvidia-smi -q -d Memory
shell: bash
- name: Prepare cache folder for pytest
run: mkdir -p $WORKING_DIR/pytest/temp
shell: bash
- name: Run unit tests
id: run-tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: >
cd senselab && poetry run pytest \
--rootdir=$WORKING_DIR/pytest \
--basetemp=$WORKING_DIR/pytest/temp \
--junitxml=pytest.xml \
--cov-report=term-missing:skip-covered \
--cov-report=xml:coverage.xml \
--cov=src src/tests \
--log-level=DEBUG \
--verbose
shell: bash

stop-runner-312:
name: stop-runner-312
needs:
- start-runner-312 # waits for the EC2 instance to be created
- ubuntu-tests-312 # waits for the actual job to finish
runs-on: ubuntu-latest
if: ${{ needs.start-runner-312.outputs.job-ran == 'true' && needs.ubuntu-tests-312.outputs.job-ran == 'true' || failure() }} # required to stop the runner even if an error occurred in previous jobs
steps:
- name: Check available space
run: |
df -h
shell: bash
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_KEY_SECRET }}
aws-region: ${{ vars.AWS_REGION }}
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.GH_TOKEN }}
label: ${{ needs.start-runner-312.outputs.label }}
ec2-instance-id: ${{ needs.start-runner-312.outputs.ec2-instance-id }}
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent"
]
packages = [{include = "senselab", from = "src"}]

[tool.poetry.dependencies]
python = ">=3.10,<3.12"
python = ">=3.10,<3.13"
datasets = "~=3"
torch = "~=2.4"
torchvision = "~=0.19"
Expand Down Expand Up @@ -54,7 +55,7 @@ nltk = "~=3.9"
vocos = "~=0.1"
iso639 = "~=0.1"
nest-asyncio = "~=1.5"
pylangacq = "^0.19.1"
pylangacq = "~=0.19"

[tool.poetry.group.dev]
optional = true
Expand Down

0 comments on commit 69dea7e

Please sign in to comment.