-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
executable file
·160 lines (128 loc) · 6.09 KB
/
Dockerfile
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
ARG CUDA_VERSION=11.1
ARG OS_VERSION=18.04
FROM nvcr.io/nvidia/tensorrt:21.07-py3
#FROM nvcr.io/nvidia/pytorch:21.09-py3
LABEL maintainer="NVIDIA CORPORATION"
#ENV TRT_VERSION 7.2.3.4
SHELL ["/bin/bash", "-c"]
# Setup user account
ARG uid=1000
ARG gid=1000
RUN groupadd -r -f -g ${gid} qmuser && useradd -o -r -u ${uid} -g ${gid} -ms /bin/bash qmuser
RUN usermod -aG sudo qmuser
RUN echo 'qmuser:qmuser' | chpasswd
#RUN mkdir -p /qml && chown qmuser /qml
ENV TZ=Asia/Dubai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update
# Install requried libraries
RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update && apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
wget \
zlib1g-dev \
git \
pkg-config \
sudo \
ssh \
libssl-dev \
pbzip2 \
pv \
bzip2 \
unzip \
devscripts \
lintian \
fakeroot \
dh-make \
build-essential
# Install python3
RUN apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-dev \
python3-wheel &&\
cd /usr/local/bin &&\
ln -s /usr/bin/python3 python
# ln -s /usr/bin/pip3 pip;
# Install PyPI packages
RUN pip3 install --upgrade pip
RUN pip3 install setuptools>=41.0.0
# Install Cmake
RUN cd /tmp && \
wget https://github.com/Kitware/CMake/releases/download/v3.20.1/cmake-3.20.1-Linux-x86_64.sh && \
chmod +x cmake-3.20.1-Linux-x86_64.sh && \
./cmake-3.20.1-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir --skip-license && \
rm ./cmake-3.20.1-Linux-x86_64.sh
USER root
# Jupyter
RUN pip install -U pandas jupyter ipywidgets scikit-learn matplotlib ipython ipykernel
# Set working dir
#RUN mkdir ~/.jupyter/
RUN python3 -m pip install ipykernel
RUN python3 -m ipykernel install --user
RUN python3 -m ipykernel.kernelspec
RUN jupyter nbextension enable --py widgetsnbextension
USER qmuser
RUN jupyter notebook --generate-config
USER qmuser
#RUN add jupyter_notebook_config.py
COPY jupyter_notebook_config.py /home/qmuser/.jupyter/jupyter_notebook_config.py
COPY run_jupyter.sh /home/qmuser/
WORKDIR "/"
USER root
RUN chmod +x /home/qmuser/run_jupyter.sh
RUN pip install -U scikit-image onnxruntime librosa
RUN python3.8 -m pip install torch torchvision torchaudio pyyaml humanfriendly torch-complex tqdm webrtcvad
WORKDIR /
RUN apt-get install -y --no-install-recommends libcairo2 texlive-xetex texlive-fonts-recommended texlive-plain-generic libeigen3-dev
RUN apt-get update \
&& apt-get install -y openssh-server xauth \
&& mkdir /var/run/sshd \
&& mkdir /root/.ssh \
&& chmod 700 /root/.ssh \
#&& mkdir /root/.ssh/authorized_keys \
&& ssh-keygen -A \
&& sed -i "s/^.*ClientAliveInterval.*$/ClientAliveInterval 120/" /etc/ssh/sshd_config \
&& sed -i "s/^.*ClientAliveCountMax.*$/ClientAliveCountMax 720/" /etc/ssh/sshd_config \
&& sed -i "s/^.*PasswordAuthentication.*$/PasswordAuthentication no/" /etc/ssh/sshd_config \
&& sed -i "s/^.*X11Forwarding.*$/X11Forwarding yes/" /etc/ssh/sshd_config \
&& sed -i "s/^.*X11UseLocalhost.*$/X11UseLocalhost no/" /etc/ssh/sshd_config \
&& grep "^X11UseLocalhost" /etc/ssh/sshd_config || echo "X11UseLocalhost no" >> /etc/ssh/sshd_config
RUN echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXzdf8v1f/R/DWV1UpJF/yxSessUC44kueQgs8fceWEncC3gUC174S7YfCff8Oas1lfCVFCJJZdmbSEExuw+YaLxyJ633RIHtAgAP+TJzl90UBys9iPxL66I4r7SzOXd3oYgyonUfMLADIWYAjkErvx4N8UHPNNe1yC8jBtT+7LDNZL4dVZ4iodfs8gQfSxN5UuPkIb04ali6chfvx3PADrfFWC8meYPfDxAqiz4h9U7DywgoXwMwWAc4J9Tbbg7Jztjz0xCWlrUjiif5hXbKcgDKv5fltwYVIPA2XU+I+zS3reegYWWiHxfpGf2V1Ym6sGIhJNsccjlLzEKq57gg1 dambo" >> /root/.ssh/authorized_keys
RUN echo 'ldconfig' >> /root/.bashrc
# RUN source /root/.bashrc
RUN echo "export PATH=$PATH" >> /etc/profile && \
echo "ldconfig" >> /etc/profile
RUN apt-get install -y libx11-dev ffmpeg libsm6 libxext6 libgl1 python3-opencv
RUN python3.8 -m pip install opencv-python opencv-contrib-python==4.5.5.62 pillow==9.1.0 celluloid
# see python -m pip install paddlepaddle==2.4.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
# see https://stackoverflow.com/questions/74319979/how-to-install-paddlepaddle-with-no-avx-core
#RUN python3.8 -m pip download paddlepaddle==2.3.0 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/noavx/stable.html --no-index --no-deps
USER qmuser
WORKDIR /home/qmuser
RUN git clone https://github.com/PaddlePaddle/Quantum.git
RUN git clone https://github.com/theerfan/Q/
RUN git clone https://github.com/DavitKhach/quantum-algorithms-tutorials.git
RUN git clone https://github.com/mit-han-lab/torchquantum.git
RUN git clone https://github.com/walid-mk/VQE.git
RUN git clone https://github.com/MyEntangled/Quantum-Autoencoders.git
RUN git clone https://github.com/PennyLaneAI/qml.git
RUN git clone https://github.com/XanaduAI/pennylane-demo-cern.git
RUN git clone https://github.com/quantum-machine-learning/Hands-On-Quantum-Machine-Learning-With-Python-Vol-1
RUN git clone https://github.com/MonitSharma/Learn-Quantum-Machine-Learning.git
RUN git clone https://github.com/MarcinPlodzien/Quantum-Machine-Learning-Introduction.git
#RUN #python3.8 -m pip install paddlepaddle-gpu==2.3.2 -f https://paddlepaddle.org.cn/whl/stable/noavx.html paddle-quantum==2.3.0
#RUN python3.8 -m pip install paddlepaddle-gpu==2.3.2 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/noavx/stable.html --no-index --no-deps
#RUN python3.8 -m pip install --no-index --no-deps paddle-quantum==2.2.2
#RUN python3.8 -m pip install qutip pyquil dwave_networkx minorminer docarray qiskit cirq qibo qsimcirq
#RUN python3.8 -m pip download paddlepaddle==2.3.0 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/noavx/stable.html --no-index --no-deps
RUN python3.8 -m pip install torch torchvision torchaudio pennylane efficientnet_pytorch pandas_summary numpy openfermion openfermionpyscf classiq
#RUN python3.8 -m pip install paddlepaddle-2.3.0-cp38-cp38-linux_x86_64.whl paddle-quantum==2.2.2
USER root
RUN chown qmuser /home/qmuser/
RUN chown -R qmuser:qmuser /home/qmuser/
USER qmuser
WORKDIR /home/qmuser
RUN ["/bin/bash"]
EXPOSE 8097 7842