Skip to content

Commit

Permalink
Merge branch 'simpler-base-dockerfile' into 'master'
Browse files Browse the repository at this point in the history
Simpler dockerfile

See merge request pitchtrack/pitch-detectors!69
  • Loading branch information
tandav committed Nov 25, 2024
2 parents fbf7b4f + 83a8c08 commit 083b113
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 37 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.ipynb
dist
*.pyc
*.egg-info
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test:
- u60
- docker
- gpu
image: tandav/pitch-detectors:12.6.2-cudnn-devel-ubuntu24.04-python3.12
image: tandav/pitch-detectors:12.6.2-cudnn-devel-ubuntu24.04-python3.12@sha256:665b04e9a86d95b1b57175e582d66f0b6cdcda2accd7593845697a4021bd4c46
cache:
key: $CI_PROJECT_NAME
paths:
Expand Down
12 changes: 10 additions & 2 deletions docker/pitch-detectors.dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
ARG BASE_IMAGE=scratch

ARG BASE_IMAGE_CUDA=scratch
ARG PYTHON_VERSION=3.12
ARG UV_IMAGE=ghcr.io/astral-sh/uv:latest
FROM python:${PYTHON_VERSION}-slim AS python
FROM ${UV_IMAGE} AS uv
FROM ${BASE_IMAGE_CUDA}
# disable banner from nvidia/cuda entrypoint
ENTRYPOINT []

FROM ${BASE_IMAGE} AS base
# Copy Python binaries and libraries from the official Python image
COPY --from=python /usr/local /usr/local
ENV PATH="/usr/local/bin:$PATH"

COPY --from=uv /uv /uvx /bin/

Expand Down
19 changes: 4 additions & 15 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,18 @@ env:
UV_IMAGE: ghcr.io/astral-sh/uv:0.5.4@sha256:5436c72d52c9c0d011010ce68f4c399702b3b0764adcf282fe0e546f20ebaef6
BASE_IMAGE_CUDA_SHA256: 431b2307f69f41ca51503a6103be3b5c52dcfad18b201af7f12349a0cca35a4e
BASE_IMAGE_CUDA: nvidia/cuda:{{.CUDA_VERSION}}-cudnn-devel-ubuntu{{.UBUNTU_VERSION}}@sha256:{{.BASE_IMAGE_CUDA_SHA256}}
BASE_IMAGE: tandav/pitch-detectors-base:{{.CUDA_VERSION}}-cudnn-devel-ubuntu{{.UBUNTU_VERSION}}-python{{.PYTHON_VERSION}}
IMAGE: tandav/pitch-detectors:{{.CUDA_VERSION}}-cudnn-devel-ubuntu{{.UBUNTU_VERSION}}-python{{.PYTHON_VERSION}}
MODEL_PATH_SPICE: /mnt/sg8tb1/downloads-archive/libmv-data/spice_model
MODEL_PATH_PENN: /mnt/sg8tb1/downloads-archive/libmv-data/fcnf0++.pt
tasks:
build-base:
cmd: >
docker build
--build-arg BASE_IMAGE_CUDA=$BASE_IMAGE_CUDA
--tag $BASE_IMAGE
--file docker/base.dockerfile .
push-base:
cmd: docker push {{.BASE_IMAGE}}

build:
deps: [build-base]
cmd: >
docker build
--build-arg="BASE_IMAGE=$BASE_IMAGE"
--build-arg="UV_IMAGE=$UV_IMAGE"
--build-arg BASE_IMAGE_CUDA=$BASE_IMAGE_CUDA
--build-arg PYTHON_VERSION=$PYTHON_VERSION
--build-arg UV_IMAGE=$UV_IMAGE
--tag $IMAGE
--file docker/pitch-detectors.dockerfile .
.
push:
cmd: docker push $IMAGE
Expand Down
19 changes: 0 additions & 19 deletions docker/base.dockerfile

This file was deleted.

0 comments on commit 083b113

Please sign in to comment.