-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #447 from VincentRouvreau/cgal_5_2_for_ci
CGAL 5.2 for pip and CI
- Loading branch information
Showing
14 changed files
with
345 additions
and
124 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
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,90 @@ | ||
# Tests strategy | ||
|
||
This document tries to sum up the tests strategy that has been put in place for gudhi continuous integration. | ||
|
||
The aim is to help maintainers to anticipate third parties modifications, updates. | ||
|
||
## Builds | ||
|
||
### Linux | ||
|
||
As all the third parties are already installed (thanks to docker), the compilations has been seperated by categories to be parallelized: | ||
|
||
* examples (C++) | ||
* tests (C++) | ||
* utils (C++) | ||
* doxygen (C++ documentation that is available in the artefacts) | ||
* python (including documentation and code coverage that are available in the artefacts) | ||
|
||
(cf. `.circleci/config.yml`) | ||
|
||
These build categories are done with and without CGAL, and, with and without Eigen to be sure the users won't be annoyed if a third party is missing. | ||
|
||
With CGAL and with Eigen builds are performed inside the docker image `gudhi/ci_for_gudhi` based on `Dockerfile_for_circleci_image` file. | ||
Without CGAL, and, with or without Eigen builds are performed inside the docker image `gudhi/ci_for_gudhi_wo_cgal` based on `Dockerfile_for_circleci_image_without_cgal` file. | ||
|
||
#### Update docker images | ||
|
||
C++ third parties installation are done thanks to apt on Ubuntu latest LTS. | ||
|
||
Docker images need to be rebuild and push each time `.github/build-requirements`, `.github/test-requirements`, when a new third party is added, when a new CGAL version improves gudhi performances, ... | ||
|
||
```bash | ||
docker build -f Dockerfile_for_circleci_image -t gudhi/ci_for_gudhi:latest . | ||
docker build -f Dockerfile_for_circleci_image_without_cgal -t gudhi/ci_for_gudhi_wo_cgal:latest . | ||
docker login # requires some specific rights on https://hub.docker.com/u/gudhi/repository/docker/gudhi | ||
docker push gudhi/ci_for_gudhi:latest | ||
docker push gudhi/ci_for_gudhi_wo_cgal:latest | ||
``` | ||
|
||
### Windows | ||
|
||
The compilations has been seperated by categories to be parallelized, but I don't know why builds are not run in parallel: | ||
|
||
* examples (C++) | ||
* tests (C++) | ||
* utils (C++) | ||
* python | ||
|
||
Doxygen (C++) is not tested. | ||
(cf. `.appveyor.yml`) | ||
|
||
C++ third parties installation are done thanks to [vcpkg](https://github.com/microsoft/vcpkg/). | ||
In case of installation issue, check in [vcpkg issues](https://github.com/microsoft/vcpkg/issues). | ||
|
||
### OSx | ||
|
||
The compilations has been seperated by categories to be parallelized: | ||
|
||
* examples (C++) | ||
* tests (C++) | ||
* utils (C++) | ||
* python | ||
* Doxygen (C++) | ||
|
||
(cf. `azure-pipelines.yml`) | ||
|
||
C++ third parties installation are done thanks to [brew](https://formulae.brew.sh/formula/). | ||
In case of installation issue, check in formula issues. | ||
|
||
## Pip packaging | ||
|
||
Pip packaging is done in 2 parts: | ||
|
||
* on push and pull requests, the wheels are built (pip package dry-run) | ||
* on releases, the wheels are built and sent to pypi.org (package) | ||
|
||
Only the Linux pip package is based on a docker image (`gudhi/pip_for_gudhi` based on `Dockerfile_for_pip` file) to make it faster. | ||
|
||
### Update docker image | ||
|
||
C++ third parties installation are done thanks to yum on an image based on `quay.io/pypa/manylinux2014_x86_64`. | ||
|
||
Docker image need to be rebuild and push each time `.github/build-requirements`, when a new third party is added, when a new CGAL version improves gudhi performances, ... | ||
As `.github/test-requirements` is not installed, no need to rebuild image when this file is modified. | ||
|
||
```bash | ||
docker build -f Dockerfile_for_pip -t gudhi/pip_for_gudhi:latest . | ||
docker login # requires some specific rights on https://hub.docker.com/u/gudhi/repository/docker/gudhi | ||
docker push gudhi/pip_for_gudhi:latest | ||
``` |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
pytest | ||
pytest-cov | ||
sphinx | ||
sphinxcontrib-bibtex | ||
sphinxcontrib-bibtex==1.0.0 | ||
sphinx-paramlinks | ||
matplotlib | ||
scipy | ||
|
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
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,55 @@ | ||
FROM ubuntu:20.04 | ||
|
||
# Update and upgrade distribution | ||
RUN apt update && \ | ||
apt upgrade -y | ||
|
||
# Tools necessary for installing and configuring Ubuntu | ||
RUN apt install -y \ | ||
apt-utils \ | ||
locales \ | ||
tzdata | ||
|
||
# Timezone | ||
RUN echo "Europe/Paris" | tee /etc/timezone && \ | ||
ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime && \ | ||
dpkg-reconfigure -f noninteractive tzdata | ||
|
||
# Locale with UTF-8 support | ||
RUN echo en_US.UTF-8 UTF-8 >> /etc/locale.gen && \ | ||
locale-gen && \ | ||
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
|
||
# Update again | ||
RUN apt update | ||
|
||
# Required for Gudhi compilation | ||
RUN apt install -y make \ | ||
git \ | ||
g++ \ | ||
cmake \ | ||
perl \ | ||
libboost-all-dev \ | ||
locales \ | ||
python3 \ | ||
python3-pip \ | ||
python3-tk \ | ||
python3-grpcio \ | ||
libfreetype6-dev \ | ||
pkg-config \ | ||
curl | ||
|
||
RUN curl -LO "https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz" \ | ||
&& tar xf eigen-3.3.9.tar.gz | ||
|
||
ADD .github/build-requirements.txt / | ||
ADD .github/test-requirements.txt / | ||
|
||
RUN pip3 install -r build-requirements.txt | ||
RUN pip3 --no-cache-dir install -r test-requirements.txt | ||
|
||
# apt clean up | ||
RUN apt-get autoremove && rm -rf /var/lib/apt/lists/* |
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
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
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
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
60 changes: 60 additions & 0 deletions
60
src/Alpha_complex/test/Weighted_alpha_complex_non_visible_points_unit_test.cpp
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,60 @@ | ||
/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT. | ||
* See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details. | ||
* Author(s): Vincent Rouvreau | ||
* | ||
* Copyright (C) 2020 Inria | ||
* | ||
* Modification(s): | ||
* - YYYY/MM Author: Description of the modification | ||
*/ | ||
|
||
#define BOOST_TEST_DYN_LINK | ||
#define BOOST_TEST_MODULE "weighted_alpha_complex_non_visible_points" | ||
#include <boost/test/unit_test.hpp> | ||
#include <boost/mpl/list.hpp> | ||
|
||
#include <CGAL/Epick_d.h> | ||
#include <CGAL/Epeck_d.h> | ||
|
||
#include <vector> | ||
|
||
#include <gudhi/Alpha_complex.h> | ||
#include <gudhi/Simplex_tree.h> | ||
|
||
|
||
using list_of_1d_kernel_variants = boost::mpl::list<CGAL::Epeck_d< CGAL::Dynamic_dimension_tag >, | ||
CGAL::Epeck_d< CGAL::Dimension_tag<1>>, | ||
CGAL::Epick_d< CGAL::Dynamic_dimension_tag >, | ||
CGAL::Epick_d< CGAL::Dimension_tag<1>> | ||
>; | ||
|
||
BOOST_AUTO_TEST_CASE_TEMPLATE(Weighted_alpha_complex_non_visible_points, Kernel, list_of_1d_kernel_variants) { | ||
// check that for 2 closed weighted 1-d points, one with a high weight to hide the second one with a small weight, | ||
// that the point with a small weight has the same high filtration value than the edge formed by the 2 points | ||
using Point_d = typename Kernel::Point_d; | ||
std::vector<Point_d> points; | ||
std::vector<double> p1 {0.}; | ||
points.emplace_back(p1.begin(), p1.end()); | ||
// closed enough points | ||
std::vector<double> p2 {0.1}; | ||
points.emplace_back(p2.begin(), p2.end()); | ||
std::vector<typename Kernel::FT> weights {100., 0.01}; | ||
|
||
Gudhi::alpha_complex::Alpha_complex<Kernel, true> alpha_complex(points, weights); | ||
Gudhi::Simplex_tree<> stree; | ||
BOOST_CHECK(alpha_complex.create_complex(stree)); | ||
|
||
std::clog << "Iterator on weighted alpha complex simplices in the filtration order, with [filtration value]:" | ||
<< std::endl; | ||
for (auto f_simplex : stree.filtration_simplex_range()) { | ||
std::clog << " ( "; | ||
for (auto vertex : stree.simplex_vertex_range(f_simplex)) { | ||
std::clog << vertex << " "; | ||
} | ||
std::clog << ") -> " << "[" << stree.filtration(f_simplex) << "] " << std::endl; | ||
} | ||
|
||
BOOST_CHECK(stree.filtration(stree.find({0})) == -100.); | ||
BOOST_CHECK(stree.filtration(stree.find({1})) == stree.filtration(stree.find({0, 1}))); | ||
BOOST_CHECK(stree.filtration(stree.find({1})) > 100000); | ||
} |
Oops, something went wrong.