Skip to content

Commit

Permalink
Docker-based Travis build. Docker is now used to provide Travis
Browse files Browse the repository at this point in the history
dependencies. See https://hub.docker.com/r/pdal/dependencies/ for
the dependencies image. The Dockerfile to rebuild the configuration
is at ./scripts/docker/dependencies
  • Loading branch information
hobu committed Dec 2, 2015
1 parent 4139f12 commit 2b9cf8a
Show file tree
Hide file tree
Showing 9 changed files with 332 additions and 103 deletions.
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@
# Configure Travis CI service for http://github.com/PDAL
language: cpp


sudo:
required

services:
docker

compiler:
- g++
- clang

env:
- PDAL_OPTIONAL_COMPONENTS=all
- PDAL_OPTIONAL_COMPONENTS=none


before_install: ./scripts/ci/before_install.sh

script: ./scripts/ci/script.sh
script:
docker run -v $TRAVIS_BUILD_DIR:/pdal -e CXX="$CXX" -e CC="$CC" -e PDAL_OPTIONAL_COMPONENTS="$PDAL_OPTIONAL_COMPONENTS" -t pdal/dependencies:latest /bin/sh -c "/pdal/scripts/ci/script.sh"

notifications:
on_success: always
Expand Down
76 changes: 76 additions & 0 deletions doc/docker.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
.. _docker:

******************************************************************************
Docker
******************************************************************************

:Author: Howard Butler
:Contact: howard@hobu.co
:Date: 12/02/2015

.. index:: Docker

Introduction
------------------------------------------------------------------------------

It's a giant pain to build everything yourself. Like the :ref:`vagrant` configuration,
a PDAL build based on `Docker`_ is also available. This document describes how
to use it to operate on data.


.. seealso::
The `What is Docker <https://www.docker.com/what-docker>`__ document describes
in more detail what exactly Docker is. Think of it as a virtualization platform
that doesn't have to be "built" every time from scratch like :ref:`vagrant`.

Prerequisites
------------------------------------------------------------------------------

Install `Docker`_.

* `Windows <http://docs.docker.com/windows/started/>`__
* `OSX <http://docs.docker.com/mac/started/>`__
* `Linux <http://docs.docker.com/linux/started/>`__

.. note::

This tutorial will assume you are running on Windows, but the same commands should
work in OSX or Linux too.

Data
------------------------------------------------------------------------------

Copy some LAS data to the directory you're running the shell


What you get
------------------------------------------------------------------------------

The :ref:`docker`_ configuration that PDAL provides contains nearly
every possible feature except for `Oracle Point Cloud`_ support. Things it
includes are:

* :ref:`filters.hexbin`
* :ref:`filters.reprojection`
* :ref:`readers.nitf` and :ref:`writers.nitf`
* `LASzip`_ support in :ref:`readers.las` and :ref:`writers.las`
* Interpolation with `Points2Grid`_ using :ref:`writers.p2g`
* Python manipulation using :ref:`filters.predicate` and :ref:`filters.programmable`
* `PCL`_ support via :ref:`filters.pclblock`, :ref:`readers.pcd`,
:ref:`writers.pcd`, :ref:`ground_command`, and :ref:`pcl_command`
* :ref:`writers.geowave`

Head to :ref:`pipeline` for more information on using PDAL pipelines. Two pipelines
are provided in ``/home/vagrant`` that are used to load the ``st-helens-small.las``
file into `pgpointcloud`_.

.. _`Points2Grid`: https://github.com/CRREL/points2grid
.. _`Oracle Point Cloud`: http://docs.oracle.com/cd/B28359_01/appdev.111/b28400/sdo_pc_pkg_ref.htm
.. _`pgpointcloud`: https://github.com/pramsey/pointcloud

.. _`LASzip`: http://laszip.org
.. _`VirtualBox`: https://www.virtualbox.org/
.. _`GDAL`: http://gdal.org
.. _`MapServer`: http://mapserver.org
.. _`Mapnik`: http://mapnik.org
.. _`PCL`: http://www.pointclouds.org
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Documentation
community
stages/index
tutorial/index
vagrant
docker
pipeline
faq
development/index
Expand Down
84 changes: 1 addition & 83 deletions scripts/ci/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,86 +2,4 @@
# Installs requirements for PDAL
source ./scripts/ci/common.sh

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 16126D3A3E5C1192
sudo mv /etc/apt/sources.list.d/pgdg-source.list* /tmp
sudo apt-get update -qq

sudo apt-get install \
software-properties-common \
python-software-properties \
libeigen3-dev
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo add-apt-repository ppa:boost-latest/ppa -y
sudo add-apt-repository ppa:kalakris/cmake -y
sudo add-apt-repository ppa:pdal/travis -y
sudo apt-get update -qq

sudo apt-get -qq remove postgis

# From main
if [[ $PDAL_CMAKE_GENERATOR == "Ninja" ]]
then
sudo apt-get install ninja-build
fi

# From ppa:ubuntu-toolchain-r/test
# Install g++-4.8 (even if we're building clang) for updated libstdc++
sudo apt-get install g++-4.8

# From ppa:boost-latest/ppa
sudo apt-get install boost1.55

# From ppa:kalakris/cmake
sudo apt-get install cmake

# From ppa:ubuntugis/ubuntugis-unstable
sudo apt-get install \
libgdal1h \
libgdal-dev

if [[ $PDAL_OPTIONAL_COMPONENTS == "all" ]]
then
# From main
sudo apt-get install \
libflann-dev \
libhdf5-serial-dev \
libtiff4-dev \
postgresql-server-dev-9.1 \
python-numpy

# From ppa:ubuntugis/ppa
sudo apt-get install \
libgeotiff-dev \
libxml2-dev

# From ppa:ubuntugis/ubuntugis-unstable
sudo apt-get install \
libgeos++-dev \
libproj-dev

# From ppa:pdal/travis
sudo apt-get install \
hexboundary \
laz-perf \
pgpointcloud \
points2grid
fi

#
# LasZIP
#

mkdir laszip
cd laszip
wget https://github.com/LASzip/LASzip/releases/download/v2.2.0/laszip-src-2.2.0.tar.gz &&
tar xzf laszip-src-2.2.0.tar.gz &&
cd laszip-src-2.2.0 &&
./configure &&
make &&
sudo make install &&
sudo ldconfig &&
(cd /usr/local/include && sudo mkdir laszip && cd laszip && sudo ln -s ../las*.hpp .)

gcc --version
clang --version
docker pull pdal/dependencies
8 changes: 4 additions & 4 deletions scripts/ci/common.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
if [[ "$TRAVIS" != "true" ]] ; then
echo "Running this script makes no sense outside of travis-ci.org"
exit 1
fi
# if [[ "$TRAVIS" != "true" ]] ; then
# echo "Running this script makes no sense outside of travis-ci.org"
# exit 1
# fi

# Functions
tmstamp() { echo -n "[$(date '+%H:%M:%S')]" ; }
Expand Down
23 changes: 10 additions & 13 deletions scripts/ci/script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash -e
# Builds and tests PDAL

clang --version

cd /pdal
source ./scripts/ci/common.sh

mkdir -p _build || exit 1
Expand All @@ -17,10 +21,6 @@ case "$PDAL_OPTIONAL_COMPONENTS" in
exit 1
esac

if [[ "$CXX" == "g++" ]]
then
export CXX="g++-4.8"
fi

cmake \
-DBUILD_PLUGIN_ATTRIBUTE=$OPTIONAL_COMPONENT_SWITCH \
Expand All @@ -32,8 +32,9 @@ cmake \
-DBUILD_PLUGIN_NITF=OFF \
-DBUILD_PLUGIN_OCI=OFF \
-DBUILD_PLUGIN_P2G=$OPTIONAL_COMPONENT_SWITCH \
-DBUILD_PLUGIN_PCL=OFF \
-DBUILD_PLUGIN_PCL=$OPTIONAL_COMPONENT_SWITCH \
-DBUILD_PLUGIN_PGPOINTCLOUD=$OPTIONAL_COMPONENT_SWITCH \
-DBUILD_PGPOINTCLOUD_TESTS=OFF \
-DBUILD_PLUGIN_SQLITE=$OPTIONAL_COMPONENT_SWITCH \
-DBUILD_PLUGIN_RIVLIB=OFF \
-DBUILD_PLUGIN_PYTHON=$OPTIONAL_COMPONENT_SWITCH \
Expand All @@ -42,21 +43,17 @@ cmake \
-DWITH_LAZPERF=$OPTIONAL_COMPONENT_SWITCH \
-DWITH_GEOTIFF=$OPTIONAL_COMPONENT_SWITCH \
-DWITH_LASZIP=$OPTIONAL_COMPONENT_SWITCH \
-DLASZIP_INCLUDE_DIR:PATH=/usr/local/include \
-DLASZIP_LIBRARY:FILEPATH=/usr/local/lib/liblaszip.so \
-DLASZIP_INCLUDE_DIR:PATH=/usr/include \
-DLASZIP_LIBRARY:FILEPATH=/usr/lib/liblaszip.so \
-DWITH_TESTS=ON \
-G "$PDAL_CMAKE_GENERATOR" \
..

if [[ $PDAL_CMAKE_GENERATOR == "Unix Makefiles" ]]
then
MAKECMD=make
else
MAKECMD=ninja
fi
MAKECMD=ninja

# Don't use ninja's default number of threads becuase it can
# saturate Travis's available memory.
NUMTHREADS=2
${MAKECMD} -j ${NUMTHREADS} && \
LD_LIBRARY_PATH=./lib && \
sudo PGUSER=postgres ctest -V && \
Expand Down
33 changes: 33 additions & 0 deletions scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM pdal/dependencies:latest
MAINTAINER Howard Butler <howard@hobu.co>

RUN git clone https://github.com/PDAL/PDAL \
&& cd PDAL \
&& mkdir build \
&& cd build \
&& cmake \
-DBUILD_PLUGIN_ATTRIBUTE=ON \
-DBUILD_PLUGIN_CPD=OFF \
-DBUILD_PLUGIN_GREYHOUND=ON \
-DBUILD_PLUGIN_HEXBIN=ON \
-DBUILD_PLUGIN_ICEBRIDGE=ON \
-DBUILD_PLUGIN_MRSID=ON \
-DBUILD_PLUGIN_NITF=ON \
-DBUILD_PLUGIN_OCI=OFF \
-DBUILD_PLUGIN_P2G=ON \
-DBUILD_PLUGIN_PCL=ON \
-DBUILD_PLUGIN_PGPOINTCLOUD=ON \
-DBUILD_PLUGIN_SQLITE=ON \
-DBUILD_PLUGIN_RIVLIB=OFF \
-DBUILD_PLUGIN_PYTHON=ON \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_CTEST=OFF \
-DWITH_APPS=ON \
-DWITH_LAZPERF=ON \
-DWITH_GEOTIFF=ON \
-DWITH_LASZIP=ON \
-DWITH_TESTS=ON \
.. \
&& make -j4 \
&& make install

Loading

0 comments on commit 2b9cf8a

Please sign in to comment.