This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 535
/
ubuntu18.04-cpu.Dockerfile
77 lines (56 loc) · 1.73 KB
/
ubuntu18.04-cpu.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
FROM ubuntu:18.04 as base
LABEL maintainer="GluonNLP Team"
COPY install /install
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib" \
PYTHONIOENCODING=UTF-8 \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8
ENV WORKDIR=/workspace
ENV SHELL=/bin/bash
RUN mkdir -p ${WORKDIR}
RUN bash /install/install_ubuntu18.04_core.sh
# Install Open MPI
RUN bash /install/install_openmpi.sh
ENV LD_LIBRARY_PATH=/usr/local/openmpi/lib:$LD_LIBRARY_PATH
ENV PATH=/usr/local/openmpi/bin/:/usr/local/bin:/root/.local/bin:$PATH
# Install LLVM
RUN bash /install/install_llvm.sh
# Install Python Packages
RUN bash /install/install_python_packages.sh
# Install TVM
RUN bash /install/install_tvm_cpu.sh
# Install MXNet
RUN python3 -m pip install -U --pre "mxnet>=2.0.0a" --user
# Install PyTorch
RUN python3 -m pip install "torch==1.7.1+cpu" torchvision -f https://download.pytorch.org/whl/torch_stable.html
# Install Jupyter Lab
RUN bash /install/install_jupyter_lab.sh
RUN mkdir -p ${WORKDIR}/data
RUN mkdir -p /.init
RUN cd ${WORKDIR} \
&& git clone https://github.com/dmlc/gluon-nlp \
&& cd gluon-nlp \
&& git checkout master \
&& python3 -m pip install -U -e ."[extras,dev]"
# Stage-CI
FROM base as ci
WORKDIR ${WORKDIR}/gluon-nlp
ADD gluon_nlp_job.sh .
RUN chmod +x gluon_nlp_job.sh
# Stage-Devel
FROM base as devel
COPY start_jupyter.sh /start_jupyter.sh
COPY devel_entrypoint.sh /devel_entrypoint.sh
RUN chmod +x /devel_entrypoint.sh
EXPOSE 8888
EXPOSE 8787
EXPOSE 8786
WORKDIR ${WORKDIR}
# Add Tini
ARG TINI_VERSION=v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT [ "/tini", "--", "/devel_entrypoint.sh" ]
CMD ["/bin/bash"]