forked from facebookresearch/projectaria_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.fedora
64 lines (51 loc) · 2.25 KB
/
Dockerfile.fedora
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
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Start from a Fedora container
FROM docker.io/dokken/fedora-38 as base
# Ensure a SUDO command is available in the container
RUN if type sudo 2>/dev/null; then \
echo "The sudo command already exists... Skipping."; \
else \
echo "#!/bin/sh\n\${@}" > /usr/sbin/sudo; \
chmod +x /usr/sbin/sudo; \
fi
# Install build essentials
RUN sudo dnf install -y git cmake gcc gcc-c++ make
# Install python pip essentials
RUN sudo dnf install -y python3-devel; pip3 install --upgrade pip; pip3 install pybind11[global] numpy
# Install VRS dependencies and compile/install VRS
RUN sudo dnf install -y gtest-devel gmock-devel glog-devel \
fmt-devel lz4-devel libzstd-devel xxhash-devel \
boost-devel libpng-devel libjpeg-turbo-devel turbojpeg-devel;
# Code
ADD ./ /opt/projectaria_tools
# Configure
RUN mkdir /opt/projectaria_tools_Build; cd /opt/projectaria_tools_Build; cmake -DBUILD_UNIT_TEST=ON /opt/projectaria_tools;
# Build
RUN cd /opt/projectaria_tools_Build; make -j2;
# Build python bindings
RUN cd /opt/projectaria_tools;\
pip install --upgrade pip --user; \
CMAKE_BUILD_PARALLEL_LEVEL=4 pip3 install --global-option=build_ext .;
# See multistage docker file
# https://docs.docker.com/language/java/run-tests/#multi-stage-dockerfile-for-testing
FROM base as test
# Run C++ unit test
RUN cd /opt/projectaria_tools_Build; ctest -j;
# Run Python unit test
RUN cd /opt/projectaria_tools; \
export TEST_FOLDER="/opt/projectaria_tools/data/"; \
python3 -m unittest core/python/test/corePyBindTest.py; \
python3 -m unittest core/python/test/mpsPyBindTest.py; \
python3 -m unittest core/python/sophus/test/sophusPybindTest.py;