-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathgpu.Dockerfile
More file actions
111 lines (98 loc) · 3.3 KB
/
Copy pathgpu.Dockerfile
File metadata and controls
111 lines (98 loc) · 3.3 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
101
102
103
104
105
106
107
108
109
110
111
# FROM ros:humble-ros-base-jammy
# FROM ghcr.io/nvidia/jax:jax
# RUN apt-get update
# RUN apt-get install -y gedit
# RUN apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
# RUN python3 -m pip install PyQt5
# RUN python3 -m pip install matplotlib
# RUN python3 -m pip install gpjax
# RUN pip3 uninstall gpjax -y
# ARG DEBIAN_FRONTEND=noninteractive
# RUN apt-get install -y libqt5gui5
# RUN apt-get install -y texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra dvipng cm-super
# FROM hardikparwana/cuda12-ubuntu22:ros2
FROM nvcr.io/nvidia/jax:23.08-py3
# Set environment variables to avoid interactive prompts during installation and optimize Python environment
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
# POETRY_HOME='/root/.local/bin' \
# POETRY_NO_INTERACTION=1 \
# POETRY_VIRTUALENVS_CREATE=false \
YOUR_ENV=default_value \
PATH="/root/.local/bin:${PATH}"
# Version pinning as ARGs for easier updates
# ARG PYTHON_VERSION=3.10
# ARG POETRY_VERSION=1.7.1
# Update the package list, install necessary packages in one layer, including Python 3.10, CMake, BLAS libraries, and clean up
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
make \
build-essential \
software-properties-common \
curl \
ssh \
git \
python3-pip \
python3-dev \
libopenblas-dev \
&& add-apt-repository -y ppa:deadsnakes/ppa \
&& apt-get install -y python3.10 python3.10-dev python3.10-venv \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
# Install Poetry using pip and pin the version
# RUN python3.10 -m pip install poetry==$POETRY_VERSION
# Expose the port that Jupyter Notebook will run on
EXPOSE 8888
WORKDIR /home/cbfkit
# Copy the project files
# COPY pyproject.toml poetry.lock ./
# Set the PYTHONPATH to include /home and project directories
ENV PYTHONPATH="/home:/home/cbfkit:/home/cbfkit/src:${PYTHONPATH}"
# Project initialization and conditionally install cvxopt if on x86 architecture
# RUN poetry install --no-interaction && \
# if [ "$(uname -m)" = "x86_64" ]; then poetry add cvxopt; fi
# RUN python3 -m pip install jax[cuda12]
RUN python3 -m pip install --no-cache-dir \
numpy \
matplotlib \
notebook \
PyQt5 \
kvxopt>=1.3.2.0 \
cmake>=3.28.1 \
cython>=3.0.8 \
pyyaml>=6.0.1 \
setuptools>=69.0.3 \
black>=23.12.1 \
mypy>=1.8.0 \
jaxopt>=0.8.3 \
jinja2>=3.0.0 \
jupyter>=1.0.0 \
control>=0.9.4 \
pandas>=2.1.4 \
casadi>=3.6.4 \
tqdm>=4.66.2 \
&& if [ "$(uname -m)" = "x86_64" ]; then python3 -m pip install --no-cache-dir cvxopt; fi
RUN apt-get update && apt-get install -y \
python3-tk \
ffmpeg \
'^libxcb.*-dev' \
libx11-xcb-dev \
libglu1-mesa-dev \
libxrender-dev \
libxi-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libqt5gui5 \
texlive-fonts-recommended \
texlive-fonts-extra \
texlive-latex-extra \
dvipng \
cm-super \
vim \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*