-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
100 lines (84 loc) · 2.87 KB
/
Dockerfile
File metadata and controls
100 lines (84 loc) · 2.87 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Base image with NVIDIA CUDA 12.4.1 on Ubuntu 22.04
ARG IMAGE_NAME=nvidia/cuda
FROM ${IMAGE_NAME}:12.4.1-devel-ubuntu22.04 AS base
# Set environment variables for various CUDA libraries
ENV NV_CUDA_LIB_VERSION=12.4.1-1
ENV NV_NVTX_VERSION=12.4.127-1
ENV NV_LIBNPP_VERSION=12.2.5.30-1
ENV NV_LIBNPP_PACKAGE=libnpp-12-4=${NV_LIBNPP_VERSION}
ENV NV_LIBCUSPARSE_VERSION=12.3.1.170-1
ENV NV_LIBCUBLAS_PACKAGE_NAME=libcublas-12-4
ENV NV_LIBCUBLAS_VERSION=12.4.5.8-1
ENV NV_LIBCUBLAS_PACKAGE=${NV_LIBCUBLAS_PACKAGE_NAME}=${NV_LIBCUBLAS_VERSION}
ENV NV_LIBNCCL_PACKAGE_NAME=libnccl2
ENV NV_LIBNCCL_PACKAGE_VERSION=2.21.5-1
ENV NCCL_VERSION=2.21.5-1
ENV NV_LIBNCCL_PACKAGE=${NV_LIBNCCL_PACKAGE_NAME}=${NV_LIBNCCL_PACKAGE_VERSION}+cuda12.4
# Update and install necessary Linux packages
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
cmake \
make \
gcc \
g++ \
vim \
python3-pip \
python3-venv \
libgomp1 \
libopenblas-dev \
wget \
cuda-libraries-12-4=${NV_CUDA_LIB_VERSION} \
${NV_LIBNPP_PACKAGE} \
cuda-nvtx-12-4=${NV_NVTX_VERSION} \
libcusparse-12-4=${NV_LIBCUSPARSE_VERSION} \
${NV_LIBCUBLAS_PACKAGE} \
${NV_LIBNCCL_PACKAGE} \
&& rm -rf /var/lib/apt/lists/*
# Create a Python virtual environment and activate it
RUN python3 -m venv /env
ENV PATH="/env/bin:$PATH"
# Upgrade pip in the venv
RUN pip install --upgrade pip
# Install PyTorch with CUDA 12.4 wheels and Python dependencies
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 && \
pip install \
pytorch-lightning \
wandb \
einops \
transformers \
pillow \
matplotlib \
numpy \
imageio \
requests \
tqdm \
casadi
# Copy your files into the container
COPY Planners /app/Planners
COPY NPField /app/NPField
RUN mkdir -p /app/third-party
# Install acados from third-party directory
RUN cd /app/third-party && \
git clone https://github.com/acados/acados.git && \
cd acados && \
git submodule update --recursive --init --depth 1 && \
mkdir -p build && cd build && \
cmake .. -DACADOS_WITH_QPOASES=ON -DACADOS_WITH_OPENMP=ON && \
make install -j4
# Install acados python Interface
RUN pip install -e /app/third-party/acados/interfaces/acados_template
# Set environment variables needed by acados
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/third-party/acados/lib
ENV ACADOS_SOURCE_DIR="/app/third-party/acados"
# Install L4casadi from the main V2 branch
RUN cd /app/third-party && \
git clone --branch main https://github.com/Tim-Salzmann/l4casadi.git && \
cd l4casadi && \
pip install -r requirements_build.txt && \
pip install . --no-build-isolation
# Set the working directory to /app
WORKDIR /app
# Expose port 80 for service access
EXPOSE 80
# Default command to run a bash shell
CMD ["/bin/bash"]