Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +1 -40
Dockerfile
CHANGED
@@ -1,49 +1,10 @@
|
|
1 |
FROM nvidia/cuda:12.2.0-devel-ubuntu22.04
|
2 |
|
3 |
-
ARG PYTORCH_VERSION=2.4.0
|
4 |
-
ARG PYTHON_VERSION=3.9
|
5 |
-
ARG CUDA_VERSION=12.1
|
6 |
-
ARG MAMBA_VERSION=24.3.0-0
|
7 |
-
ARG CUDA_CHANNEL=nvidia
|
8 |
-
ARG INSTALL_CHANNEL=pytorch
|
9 |
-
# Automatically set by buildx
|
10 |
-
ARG TARGETPLATFORM
|
11 |
-
|
12 |
RUN useradd -m -u 1000 user
|
13 |
|
14 |
ENV PATH=/opt/conda/bin:$PATH
|
15 |
|
16 |
-
RUN
|
17 |
-
build-essential \
|
18 |
-
ca-certificates \
|
19 |
-
ccache \
|
20 |
-
curl \
|
21 |
-
python3 \
|
22 |
-
python3-pip \
|
23 |
-
git && \
|
24 |
-
rm -rf /var/lib/apt/lists/*
|
25 |
-
|
26 |
-
# Install conda
|
27 |
-
# translating Docker's TARGETPLATFORM into mamba arches
|
28 |
-
RUN case ${TARGETPLATFORM} in \
|
29 |
-
"linux/arm64") MAMBA_ARCH=aarch64 ;; \
|
30 |
-
*) MAMBA_ARCH=x86_64 ;; \
|
31 |
-
esac && \
|
32 |
-
curl -fsSL -v -o ~/mambaforge.sh -O "https://github.com/conda-forge/miniforge/releases/download/${MAMBA_VERSION}/Mambaforge-${MAMBA_VERSION}-Linux-${MAMBA_ARCH}.sh"
|
33 |
-
RUN chmod +x ~/mambaforge.sh && \
|
34 |
-
bash ~/mambaforge.sh -b -p /opt/conda && \
|
35 |
-
rm ~/mambaforge.sh
|
36 |
-
|
37 |
-
# Install pytorch
|
38 |
-
# On arm64 we exit with an error code
|
39 |
-
RUN case ${TARGETPLATFORM} in \
|
40 |
-
"linux/arm64") exit 1 ;; \
|
41 |
-
*) /opt/conda/bin/conda update -y conda && \
|
42 |
-
/opt/conda/bin/conda install -c "${INSTALL_CHANNEL}" -c "${CUDA_CHANNEL}" -y "python=${PYTHON_VERSION}" "pytorch=$PYTORCH_VERSION" "pytorch-cuda=$(echo $CUDA_VERSION | cut -d'.' -f 1-2)" ;; \
|
43 |
-
esac && \
|
44 |
-
/opt/conda/bin/conda clean -ya
|
45 |
-
|
46 |
-
RUN pip install -r ./requirements.txt
|
47 |
RUN git clone -b energy_star_dev https://github.com/huggingface/optimum-benchmark.git /optimum-benchmark && cd optimum-benchmark && pip install -e .
|
48 |
|
49 |
USER user
|
|
|
1 |
FROM nvidia/cuda:12.2.0-devel-ubuntu22.04
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
RUN useradd -m -u 1000 user
|
4 |
|
5 |
ENV PATH=/opt/conda/bin:$PATH
|
6 |
|
7 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
RUN git clone -b energy_star_dev https://github.com/huggingface/optimum-benchmark.git /optimum-benchmark && cd optimum-benchmark && pip install -e .
|
9 |
|
10 |
USER user
|