-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 'master'
support python3.12 and update CUDA base image See merge request pitchtrack/pitch-detectors!59
- Loading branch information
Showing
25 changed files
with
406 additions
and
267 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
stages: | ||
# - build | ||
- test | ||
|
||
variables: | ||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" | ||
PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.cache/pre-commit" | ||
RUFF_CACHE_DIR: "$CI_PROJECT_DIR/.cache/ruff_cache" | ||
MYPY_CACHE_DIR: "$CI_PROJECT_DIR/.cache/mypy_cache" | ||
|
||
cache: | ||
key: $CI_PROJECT_NAME | ||
paths: | ||
- .cache/ | ||
|
||
|
||
test: | ||
stage: test | ||
needs: [] | ||
tags: | ||
- u60-docker-gpu | ||
image: tandav/pitch-detectors:12.4.1-cudnn-devel-ubuntu22.0-python3.12 | ||
variables: | ||
PITCH_DETECTORS_SPICE_MODEL_PATH: /models/spice_model | ||
PITCH_DETECTORS_PENN_CHECKPOINT_PATH: /models/fcnf0++.pt | ||
script: | ||
- export $(grep -v '^#' $S3_ENV | xargs) && python scripts/download_models.py | ||
- pytest --cov pitch_detectors --cov-report term --cov-report xml --junitxml report.xml | ||
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' | ||
artifacts: | ||
when: always | ||
expire_in: 1 week | ||
reports: | ||
coverage_report: | ||
coverage_format: cobertura | ||
path: coverage.xml | ||
junit: report.xml | ||
|
||
lint: | ||
stage: test | ||
needs: [] | ||
image: python:3.12@sha256:fce9bc7648ef917a5ab67176cf1c7eb41b110452e259736144bc22f32f3aa622 | ||
variables: | ||
PIP_INDEX_URL: https://pypi.tandav.me/index/ | ||
script: | ||
- pip install .[dev] | ||
- pre-commit run --all-files |
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
version: '3' | ||
dotenv: ['.env'] | ||
vars: | ||
BASE_IMAGE: tandav/pitch-detectors-base:12.4.1-cudnn-devel-ubuntu22.0-python3.12 | ||
IMAGE: tandav/pitch-detectors:12.4.1-cudnn-devel-ubuntu22.0-python3.12 | ||
|
||
tasks: | ||
build-base: | ||
cmd: docker build --tag {{.BASE_IMAGE}} --file docker/base.dockerfile . | ||
|
||
push-base: | ||
cmd: docker push {{.BASE_IMAGE}} | ||
|
||
build: | ||
cmd: docker build --build-arg="BASE_IMAGE={{.BASE_IMAGE}}" --tag {{.IMAGE}} --file docker/pitch-detectors.dockerfile . | ||
|
||
push: | ||
cmd: docker push {{.IMAGE}} | ||
|
||
test: | ||
deps: [build] | ||
cmd: > | ||
docker run --rm -t --gpus all | ||
-v /media/tandav/sg8tb1/downloads-archive/libmv-data/spice_model:/spice_model:ro | ||
-v /media/tandav/sg8tb1/downloads-archive/libmv-data/fcnf0++.pt:/fcnf0++.pt:ro | ||
{{.IMAGE}} | ||
pytest -v | ||
test-no-docker: | ||
cmd: pytest -v | ||
|
||
freeze: | ||
cmd: docker run --rm -t --gpus all {{.IMAGE}} /venv/bin/pip freeze > freeze.txt | ||
|
||
bumpver: | ||
desc: 'Bump version. Pass --<part>. Usage example: task bumpver -- --minor' | ||
cmds: | ||
- bumpver update --no-fetch {{.CLI_ARGS}} | ||
|
||
evaluation: | ||
deps: [build] | ||
cmd: > | ||
docker run --rm -t --gpus all | ||
-e PITCH_DETECTORS_GPU=true | ||
-e REDIS_URL={{.REDIS_URL}} | ||
-v /media/tandav/sg8tb1/downloads-archive/f0-datasets:/app/f0-datasets:ro | ||
{{.IMAGE}} | ||
python -m pitch_detectors.evaluation | ||
table: | ||
cmd: python -m pitch_detectors.evaluation.table |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04@sha256:0a1cb6e7bd047a1067efe14efdf0276352d5ca643dfd77963dab1a4f05a003a4 | ||
|
||
# https://github.com/NVIDIA/nvidia-docker/wiki/Usage | ||
# https://github.com/NVIDIA/nvidia-docker/issues/531 | ||
ENV NVIDIA_DRIVER_CAPABILITIES compute,video,utility | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
ARG PYTHON_VERSION=3.12 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y software-properties-common && \ | ||
add-apt-repository -y ppa:deadsnakes/ppa && \ | ||
apt-get install -y python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv libsndfile-dev libasound-dev portaudio19-dev | ||
|
||
# this is only need for crepe @ git+https://github.com/tandav/crepe | ||
RUN apt-get install -y git | ||
|
||
# https://pythonspeed.com/articles/activate-virtualenv-dockerfile/ | ||
ENV VIRTUAL_ENV=/venv | ||
RUN python${PYTHON_VERSION} -m venv $VIRTUAL_ENV | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ARG BASE_IMAGE | ||
FROM ${BASE_IMAGE} | ||
|
||
WORKDIR /app | ||
COPY pyproject.toml . | ||
ENV PIP_INDEX_URL=https://pypi.tandav.me/index/ | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install --upgrade pip setuptools wheel && \ | ||
pip install .[dev] | ||
|
||
COPY pitch_detectors /app/pitch_detectors | ||
|
||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install --no-deps . | ||
|
||
COPY tests /app/tests | ||
COPY scripts/ /app/scripts | ||
COPY data /app/data |
Oops, something went wrong.