-
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.
use uv See merge request pitchtrack/pitch-detectors!67
- Loading branch information
Showing
8 changed files
with
2,209 additions
and
232 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
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 |
---|---|---|
@@ -1,21 +1,19 @@ | ||
FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04@sha256:0a1cb6e7bd047a1067efe14efdf0276352d5ca643dfd77963dab1a4f05a003a4 | ||
|
||
ARG BASE_IMAGE_CUDA=scratch | ||
FROM ${BASE_IMAGE_CUDA} | ||
# https://github.com/NVIDIA/nvidia-docker/wiki/Usage | ||
# https://github.com/NVIDIA/nvidia-docker/issues/531 | ||
ENV NVIDIA_DRIVER_CAPABILITIES compute,video,utility | ||
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" | ||
apt-get install -y --no-install-recommends \ | ||
python${PYTHON_VERSION}-dev \ | ||
libsndfile-dev \ | ||
libasound-dev \ | ||
portaudio19-dev && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* |
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 |
---|---|---|
@@ -1,18 +1,24 @@ | ||
ARG BASE_IMAGE | ||
FROM ${BASE_IMAGE} | ||
ARG BASE_IMAGE=scratch | ||
ARG UV_IMAGE=ghcr.io/astral-sh/uv:latest | ||
FROM ${UV_IMAGE} AS uv | ||
|
||
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] | ||
FROM ${BASE_IMAGE} AS base | ||
|
||
COPY --from=uv /uv /uvx /bin/ | ||
|
||
WORKDIR /app | ||
COPY pitch_detectors /app/pitch_detectors | ||
|
||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
pip install --no-deps . | ||
ENV UV_LINK_MODE=copy \ | ||
UV_FROZEN=1 | ||
|
||
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
--mount=type=bind,source=uv.lock,target=uv.lock \ | ||
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \ | ||
uv sync | ||
|
||
COPY tests /app/tests | ||
COPY scripts/ /app/scripts | ||
COPY data /app/data | ||
|
||
ENV PATH="/app/.venv/bin:$PATH" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.