-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
91 lines (73 loc) · 2.63 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
ARG ARCH="amd64"
FROM timeloopaccelergy/accelergy-timeloop-infrastructure:latest-${ARCH}
LABEL maintainer="[email protected]"
# Arguments
ARG BUILD_DATE
ARG VCS_REF
ARG BUILD_VERSION
# Labels - org.local-schema
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.name="timeloopaccelergy/timeloop-accelergy-pytorch"
LABEL org.label-schema.description="Infrastructure for Timeloop/Accelergy and Pytorch"
LABEL org.label-schema.url="http://accelergy.mit.edu/"
LABEL org.label-schema.vcs-url="https://github.com/Accelergy-Project/timeloop-accelergy-pytorch"
LABEL org.label-schema.vcs-ref=$VCS_REF
LABEL org.label-schema.vendor="Emer"
LABEL org.label-schema.version=$BUILD_VERSION
LABEL org.label-schema.docker.cmd="docker run -it --rm -v ~/workspace:/home/workspace timeloopaccelergy/timeloop-accelergy-pytorch"
ENV SRC_DIR=/usr/local/src
ENV LIB_DIR=/usr/local/lib
ENV BIN_DIR=/usr/local/bin
RUN echo "**** create container user and make folders ****" && \
userdel workspace && \
useradd -u 911 -U -d /home/workspace -s /bin/bash workspace && \
usermod -G users workspace
#
# Python tools
#
RUN pip3 install pandas seaborn numpy scipy matplotlib ipykernel jupyter && \
pip3 install plyplus pyyaml && \
pip3 install tqdm matplotlib svgutils
RUN pip3 install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 \
--extra-index-url https://download.pytorch.org/whl/cpu
RUN python3 -m pip install torchprofile
#
# Install pytorch2timeloop converter
#
RUN python3 -m pip install git+https://github.com/Accelergy-Project/pytorch2timeloop-converter
#
# Install fibertree and associated requirements
#
RUN echo "**** install required packages ****" && \
apt-get update && \
apt-get install -y --no-install-recommends \
libgl1 \
fonts-freefont-ttf \
fonts-dejavu && \
echo "**** cleanup ****" && \
apt-get clean && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/*
RUN python3 -m pip install git+https://github.com/Fibertree-Project/fibertree
#
# Set up root
#
COPY /root /
USER $NB_USER
WORKDIR /home/workspace/
#
# Install notebook extension
#
#RUN pip3 install --no-cache jupyter_nbextensions_configurator && \
# pip3 install git+https://github.com/NII-cloud-operation/Jupyter-LC_index
#RUN jupyter nbextensions_configurator enable --sys-prefix && \
# jupyter nbextension install --py notebook_index --sys-prefix && \
# jupyter nbextension enable --py notebook_index --sys-prefix
#
# Install Yaml Widgets
#
RUN python3 -m pip install git+https://github.com/jsemer/yamlwidgets
EXPOSE 8888
ENTRYPOINT ["/init"]