Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Commit

Permalink
Add rust toolchain to fix docker image build (#89)
Browse files Browse the repository at this point in the history
Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
  • Loading branch information
chenhunghan authored Dec 15, 2023
1 parent 15b04cb commit 8ce33d4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

FROM python:3.11-slim
WORKDIR /app
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.cuda11
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

# 11.7.1 https://github.com/ggerganov/llama.cpp/blob/master/.devops/main-cuda.Dockerfile
FROM nvidia/cuda:11.7.1-base-ubuntu22.04
RUN apt-get update && apt-get install -y -q python3 python3-pip
RUN apt-get update && apt-get install -y -q python3 python3-pip curl
WORKDIR /app
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
# https://github.com/marella/ctransformers#cuda
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.cuda12
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# syntax=docker/dockerfile:1

FROM nvidia/cuda:12.2.0-base-ubuntu22.04
RUN apt-get update && apt-get install -y -q python3 python3-pip
RUN apt-get update && apt-get install -y -q python3 python3-pip curl
WORKDIR /app
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
# https://github.com/marella/ctransformers#cuda
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.gptq
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

FROM nvidia/cuda:12.2.0-devel-ubuntu22.04
RUN apt-get update \
&& apt-get install -y --no-install-recommends g++ python3-dev python3-pip \
&& apt-get install -y --no-install-recommends g++ python3-dev python3-pip curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
# Fixes exllama/cuda_ext.py:82: UserWarning: Failed to initialize NumPy: No module named 'numpy'
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile.metal
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt requirements.txt
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN pip3 install -r requirements.txt
# https://github.com/marella/ctransformers#metal
RUN CT_METAL=1 pip3 install ctransformers --no-binary ctransformers
Expand Down

0 comments on commit 8ce33d4

Please sign in to comment.