Skip to content

Commit

Permalink
[#15] Use requirements_minimal.txt as dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
xserrat committed Nov 26, 2022
1 parent c29c837 commit 51d3cdc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:

jobs:
Build-Docker-Image:
strategy:
matrix:
demucs_version: [ minimal ]
runs-on: ubuntu-latest
steps:
-
Expand Down Expand Up @@ -39,6 +42,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
build-args: DEMUCS_VERSION=${{ matrix.demucs_version }}
push: true
platforms: linux/amd64,linux/arm64
tags: xserrat/facebook-demucs:${{ steps.github_ref_name_replacement_step.outputs.replaced }}
22 changes: 5 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
#FROM python:3.8-alpine3.16 as build-lameenc
#
#RUN python3 -m venv /opt/venv \
# && python3 -m pip install --upgrade pip
#ENV PATH="/opt/venv/bin:$PATH"
#
#RUN git clone -b v1.3.1 --single-branch https://github.com/chrisstaite/lameenc /lib/lameenc
#
#RUN mkdir -p /lib/lameenc/build
#WORKDIR /lib/lameenc/build
#RUN cmake .. && make && pip install "lameenc-1.3.1-cp38-cp38-linux_aarch64.whl"

FROM python:3.8-alpine3.16

USER root
ENV TORCH_HOME=/data/models
ENV REQUIREMENTS_FILE=requirements_minimal.txt

# Install needed packages
RUN apk update && apk add \
Expand All @@ -27,12 +16,11 @@ WORKDIR /lib/demucs

RUN git clone --depth 1 --branch main https://github.com/facebookresearch/demucs .

#COPY --from=build-lameenc /opt/venv /opt/venv
#RUN REQUIREMENTS_FILE=$([[ "${DEMUCS_VERSION}" == "minimal" ]] && echo "requirements_minimal.txt" || echo "requirements.txt")

RUN sed -i 's/lameenc>=1.2/lameenc>=1.4.1/g' requirements.txt requirements_minimal.txt \
&& cat requirements.txt \
&& cat requirements_minimal.txt
RUN python3 -m pip install --platform=arm64 --no-deps -e .
RUN echo "Requirements file: ${REQUIREMENTS_FILE}"
RUN sed -i 's/lameenc>=1.2/lameenc>=1.4.1/g' ${REQUIREMENTS_FILE} # Upgrade lameenc to 1.4.1 to support arm64
RUN python3 -m pip install -r ${REQUIREMENTS_FILE}
RUN python3 -m demucs.separate -d cpu --mp3 test.mp3 # Trigger model download \
&& rm -r separated # cleanup

Expand Down

0 comments on commit 51d3cdc

Please sign in to comment.