-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathDockerfile
84 lines (70 loc) · 2.82 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
FROM python:3.8-slim
ARG DEBIAN_FRONTEND=noninteractive
# Set up locale
RUN apt-get update && apt-get install -y locales \
&& locale-gen en_US.UTF-8 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
bzip2 \
build-essential \
ca-certificates \
g++ \
git \
libglfw3-dev \
libgles2-mesa-dev \
libglib2.0-0 \
nano \
sudo \
libboost-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set user and group
RUN groupadd -g 555 devgroup && \
useradd -l -u 556 -g devgroup -m -s /bin/bash devuser && \
echo devuser ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/devuser && \
chmod 0440 /etc/sudoers.d/devuser
# Copy code into container
COPY . /home/devuser/now_evaluation
# Change ownership of the now_evaluation directory
RUN chown -R devuser:devgroup /home/devuser/now_evaluation
# Switch to non-root user
USER devuser
WORKDIR /home/devuser
# Clone and set up projects
RUN git clone https://github.com/MPI-IS/mesh /home/devuser/mesh && \
cd /home/devuser/mesh && \
git checkout 49e70425cf373ec5269917012bda2944215c5ccd && \
sed -i 's/--install-option/--config-settings/g' Makefile && \
make all
RUN git clone https://github.com/Rubikplayer/flame-fitting /home/devuser/flame-fitting && \
cd /home/devuser/flame-fitting && \
git checkout ca806ce13a8964231136bd226bf3255fc2e476de && \
cd /home/devuser && \
cp -r flame-fitting/smpl_webuser now_evaluation/smpl_webuser && \
cp -r flame-fitting/sbody now_evaluation/sbody
RUN git clone https://gitlab.com/libeigen/eigen.git /home/devuser/eigen && \
cd /home/devuser/eigen && \
git checkout 3.4.0 && \
cp -r /home/devuser/eigen /home/devuser/now_evaluation/sbody/alignment/mesh_distance/eigen
# Install Python dependencies
RUN pip install --upgrade pip && \
pip install -r /home/devuser/now_evaluation/requirements.txt && \
cd /home/devuser/now_evaluation/sbody/alignment/mesh_distance && \
sed -i 's/\.\/eigen/\/home\/devuser\/now_evaluation\/sbody\/alignment\/mesh_distance\/eigen/g' setup.py && \
make
RUN pip install jupyterlab "numpy==1.23" tqdm
# Persist command history across sessions
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/home/devuser/.history/.bash_history" \
&& mkdir -p /home/devuser/.history \
&& touch /home/devuser/.history/.bash_history \
&& echo "$SNIPPET" >> "/home/devuser/.bashrc"
RUN git clone --depth 1 https://github.com/junegunn/fzf.git /home/devuser/.fzf && \
/home/devuser/.fzf/install --all
# Set entrypoint
ENTRYPOINT ["python", "/home/devuser/now_evaluation/compute_error.py", "--dataset_folder", "/dataset", "--predicted_mesh_folder", "/preds"]