Skip to content

Commit

Permalink
chore: better structure for cuda/cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
aw632 committed Oct 7, 2024
1 parent cc0c7de commit bd016a3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ run it

## Docker Setup

Note: currently we only have Docker support for CUDA.
Note: currently we only have Docker support for CUDA and CPU.

To build and run the project using Docker, follow these steps:

Expand All @@ -75,14 +75,15 @@ To build and run the project using Docker, follow these steps:

2. Build the Docker image using the following command:
```bash
DOCKER_BUILDKIT=1 docker build \
--secret id=ssh_key,src=$HOME/.ssh/your_ssh_key \
--secret id=known_hosts,src=$HOME/.ssh/known_hosts \
--secret id=hf_token,env=HF_TOKEN \
-t entropix \
-f docker/Dockerfile.entropix_cuda .
```
Make sure to replace `your_ssh_key` with the path to your actual SSH key.
DOCKER_BUILDKIT=1 docker build \
--secret id=ssh_key,src=$HOME/.ssh/your_ssh_key \
--secret id=known_hosts,src=$HOME/.ssh/known_hosts \
--secret id=hf_token,env=HF_TOKEN \
--build-arg BACKEND=cuda \
-t entropix \
-f docker/Dockerfile.entropix .
```
Make sure to replace `your_ssh_key` with the path to your actual SSH key, and to set the `BACKEND` argument to `cpu` if you want to build the CPU image.

3. Once the image is built, you can run it using:
```bash
Expand Down
11 changes: 10 additions & 1 deletion docker/Dockerfile.entropix_cuda → docker/Dockerfile.entropix
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
FROM nvidia/cuda:12.3.1-base-ubuntu22.04
ARG BACKEND=cuda
# CUDA base image
FROM nvidia/cuda:12.3.1-base-ubuntu22.04 AS cuda_base
# CPU base image
FROM ubuntu:22.04 AS cpu_base

FROM ${BACKEND}_base AS final
ARG DEBIAN_FRONTEND=noninteractive
ARG BACKEND

# Required to disable interactive prompts when installing openssh.
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
Expand Down

0 comments on commit bd016a3

Please sign in to comment.