-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
161 lines (149 loc) · 4.06 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
161
# syntax=docker/dockerfile:1
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
ENV INST 'env DEBIAN_FRONTEND=noninteractive apt-get install -y'
ENV PIPINST 'python3 -m pip install --no-cache-dir --upgrade'
RUN apt-get update && $INST \
apt-utils \
ca-certificates \
curl \
gnupg \
locales \
locales-all \
software-properties-common && \
rm -rf /var/lib/apt/lists/*
RUN locale-gen en_US.UTF-8 && \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LC_ALL en_US.UTF-8
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
RUN echo "deb [arch=\"$(dpkg --print-architecture)\" signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu \"$(source /etc/os-release && echo "$VERSION_CODENAME")\" main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
RUN apt-get update && apt-get upgrade -y && $INST \
clang-13 \
clang-format-13 \
clang-tidy-13 \
clangd-13 \
cmake \
cppcheck \
ffmpeg \
g++-12 \
gcc \
gdb \
git \
git-lfs \
gnupg \
libboost-python-dev \
libedit-dev \
libglew-dev \
libglfw3-dev \
libglm-dev \
libgtest-dev \
libgtk-3-dev \
libopencv-contrib-dev \
libopencv-dev \
libtinfo-dev \
libv4l-dev \
libvulkan-dev \
libxml2-dev \
libyaml-dev \
llvm-13 \
lsb-release \
make \
ninja-build \
pkg-config \
protobuf-compiler \
python3-dev \
python3-flake8 \
python3-flake8-docstrings \
python3-opencv \
python3-pip \
python3-pytest-cov \
python3-rosdep \
python3-setuptools \
python3-vcstool \
python3-venv \
rapidjson-dev \
ros-dev-tools \
spirv-tools \
sudo \
unzip \
valgrind \
vim \
vulkan-tools \
vulkan-validationlayers-dev \
wget \
xterm \
zlib1g-dev \
&& apt-get -y clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*
RUN $PIPINST \
Cython==0.29.35 \
Pillow \
argcomplete \
astunparse \
boto3 \
botocore \
cmake \
flake8-blind-except \
flake8-builtins \
flake8-class-newline \
flake8-comprehensions \
flake8-deprecated \
flake8-import-order \
flake8-quotes \
isort \
jsonschema \
matplotlib \
memory_profiler \
mock \
numpy \
onnx \
onnxruntime \
onnxruntime_gpu \
pandas \
pip \
pre-commit \
psutil \
pycocotools \
pytest \
pytest-repeat \
pytest-rerunfailures \
scikit_learn \
scipy \
setuptools \
tqdm \
wheel && \
ldconfig
RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo && \
chmod a+x /usr/local/bin/repo
RUN ln -s /usr/bin/python3 /usr/bin/python
# ROS
WORKDIR /ros2-build
RUN mkdir src && \
apt-get update && \
vcs import --input https://raw.githubusercontent.com/ros2/ros2/humble/ros2.repos --recursive --workers "$(nproc)" src && \
rosdep init --rosdistro=humble && \
rosdep update --rosdistro=humble && \
rosdep install --rosdistro=humble --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers ignition-math6 ignition-cmake2" && \
apt-get remove -y pybind11-dev && \
$PIPINST "pybind11[global]" && \
colcon build --install-base /opt/ros && \
rm -rf /ros2-build && \
rm -rf /var/lib/apt/lists/*
WORKDIR /
COPY ./third-party/vision_opencv /vision_opencv
WORKDIR /vision_opencv/cv_bridge
RUN source /opt/ros/setup.sh && \
colcon build --install-base /opt/ros && \
rm -rf /vision_opencv
WORKDIR /
# TVM
COPY ./third-party/tvm /tvm
COPY ./tvm-config.cmake /tvm-config.cmake
WORKDIR /tvm/build
RUN cp /tvm-config.cmake config.cmake && \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. && \
make -j"$(nproc)" && make install && \
CONDA_BUILD=yes LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH $PIPINST /tvm/python && \
rm -rf /tvm/build && ldconfig
WORKDIR /