Skip to content

Commit

Permalink
Add Dockerfile and instructions for running perch in a container.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 586894152
  • Loading branch information
owahltinez authored and copybara-github committed Dec 2, 2023
1 parent 5a10a2c commit 8f85917
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.11

# Environment variables
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1
ENV POETRY_VERSION=1.6.1

# Install poetry
RUN python -m pip install "poetry==$POETRY_VERSION"

# Install native dependencies
RUN apt-get -y update && apt-get -y install libsndfile1 ffmpeg

# Instal dependencies specified in the poetry configs
WORKDIR /app
ADD . /app
RUN poetry install

ENTRYPOINT [ "/usr/local/bin/poetry", "run" ]
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ Running `poetry install` installs all Perch dependencies into a new virtual envi
poetry run python -m unittest discover -s chirp/tests -p "*test.py"
```

## Using a container

Alternatively, you can install and run this project using a container via
Docker. To build a container using the tag `perch`, run:
```bash
git clone https://github.com/google-research/perch
cd perch
docker build . --tag perch
```

And then you can run the different commands using the container you just built.
For example, to run the tests, try:
```bash
docker run --rm -t perch python -m unittest discover -s chirp/tests -p "*test.py"
```

## BIRB data preparation

### Evaluation data
Expand Down

0 comments on commit 8f85917

Please sign in to comment.