-
Notifications
You must be signed in to change notification settings - Fork 137
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (48 loc) · 1.84 KB
/
Dockerfile
File metadata and controls
55 lines (48 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# This image has ubuntu 22.04.5 (Jammy Jellyfish), cuda 12.9, cudnn 9, python 3.11.13, pytorch 2.8.0
# NOTE: This pytorch version is currently slightly higher than the pytorch version used
# in the env
FROM pytorch/pytorch:2.8.0-cuda12.9-cudnn9-devel
WORKDIR /repo
# Set cuda env vars
ENV CUDA_HOME=/usr/local/cuda/
ENV PATH=${CUDA_HOME}/bin:$PATH
ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
# Install dependencies to:
# Get the program version from version control (git, needed by setuptools-scm)
# Download test data and maybe CUB (wget, unzip)
# Build C++/CUDA extensions faster (ninja-build)
# C++/C/CUDA coda formatting (clang-format)
RUN apt update && apt install -y wget git unzip ninja-build rsync clang-format
# Download test data
COPY ./download-dev-data.sh .
RUN ./download-dev-data.sh
# Copy pip optional dependencies file
COPY dev_requirements.txt .
# Install optional dependencies
RUN pip install --root-user-action ignore -r dev_requirements.txt
# Copy all other necessary repo files
COPY . /repo
# Initialize a git repo and create dummy tag for setuptools scm
RUN \
git config --global user.email "user@domain.com" \
&& git config --global user.name "User" \
&& git init \
&& git add . \
&& git commit -m "Initial commit" \
&& git tag -a "v3.0-dev" -m "Version v3.0-dev"
# Install torchani + core requirements (+ extensions if BUILD_EXT build arg is provided)
# Usage:
# BUILD_EXT=0 -> Don't build extensions
# BUILD_EXT=all-sms -> Build extensions for all sms
# BUILD_EXT=smMajorMinor (e.g. BUILD_EXT=sm86)-> Build for specific Major.Minor SM
ARG BUILD_EXT=0
RUN \
if [ "$BUILD_EXT" = "0" ]; then \
pip install --root-user-action ignore -v . ; \
else \
pip install \
--root-user-action ignore \
--no-build-isolation \
--config-settings=--global-option=ext-"${BUILD_EXT}" \
-v . ; \
fi