forked from OpenDroneMap/OpenSfM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add docker build with Ceres 2 (mapillary#702)
Summary: Add a docker file that builds with Ceres 2. Add a github workflow to build and run tests on that dockerfile. Pull Request resolved: mapillary#702 Reviewed By: YanNoun Differential Revision: D26222552 Pulled By: paulinus fbshipit-source-id: d0ba73062ed45f87a3c8740d3decd41aece8f300
- Loading branch information
1 parent
42c5f8f
commit 1b864bd
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Docker CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
build-test: | ||
name: Build docker installing CeresSolver 2 and run tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Build the Docker image | ||
run: docker build . --file Dockerfile.ceres2 --tag mapillary/opensfm.ceres2:$GITHUB_SHA | ||
|
||
- name: Run C++ tests | ||
run: docker run mapillary/opensfm.ceres2:$GITHUB_SHA /bin/sh -c "cd cmake_build && ctest" | ||
|
||
- name: Run Python tests | ||
run: docker run mapillary/opensfm.ceres2:$GITHUB_SHA python3 -m pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
FROM ubuntu:20.04 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install apt-getable dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
build-essential \ | ||
cmake \ | ||
git \ | ||
libeigen3-dev \ | ||
libgoogle-glog-dev \ | ||
libopencv-dev \ | ||
libsuitesparse-dev \ | ||
python3-dev \ | ||
python3-numpy \ | ||
python3-opencv \ | ||
python3-pip \ | ||
python3-pyproj \ | ||
python3-scipy \ | ||
python3-yaml \ | ||
curl \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
|
||
# Install Ceres 2 | ||
RUN \ | ||
mkdir -p /source && cd /source && \ | ||
curl -L http://ceres-solver.org/ceres-solver-2.0.0.tar.gz | tar xz && \ | ||
cd /source/ceres-solver-2.0.0 && \ | ||
mkdir -p build && cd build && \ | ||
cmake .. -DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF && \ | ||
make -j4 install && \ | ||
cd / && rm -rf /source/ceres-solver-2.0.0 | ||
|
||
|
||
COPY . /source/OpenSfM | ||
|
||
WORKDIR /source/OpenSfM | ||
|
||
RUN pip3 install -r requirements.txt && \ | ||
python3 setup.py build |