Skip to content

Commit

Permalink
working version on Fiware environment!!
Browse files Browse the repository at this point in the history
  • Loading branch information
justb4 committed Apr 25, 2016
1 parent b2d1be9 commit 1cd3b0d
Showing 1 changed file with 52 additions and 46 deletions.
98 changes: 52 additions & 46 deletions docs/platform/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ this chapter will describe the actual "hands-on" installation steps.
Bootstrap
=========

In order to start installing Docker images and other tooling we need to "bootstrap" the system.
In order to start installing Docker images and other tooling we need to "bootstrap" the system
within the Fiware environment. For development purposes we also setup a "Local" system using Vagrant.

Fiware Lab NL
-------------
Expand Down Expand Up @@ -192,7 +193,7 @@ Within the UB we are on a standard Ubuntu commandline, running a general Ubuntu
$ sudo apt-get update
$ sudo apt-get -y upgrade

The next steps are standard Docker install (see next section). After the setup is tested by building and running one of
The next steps are standard Docker install (see next section below). After the setup is tested by building and running one of
our Docker files. Getting access to our Dockerfiles is easy, for example: ::

sudo ln -s /vagrant/git ~/git
Expand Down Expand Up @@ -288,6 +289,55 @@ Some handly Docker commands: ::
Docker Images
-------------

Below the Docker images: how they are built/acquired and how they are run using local mappings, data and configs.

PostGIS
~~~~~~~

PostGIS Docke image from Kartoza (Tim Sutton, QGIS lead),
see https://hub.docker.com/r/kartoza/postgis/ and https://github.com/kartoza/docker-postgis ::

$ sudo docker pull kartoza/postgis:9.4-2.1
$ sudo docker run --name "postgis" -p 5432:5432 -d -t kartoza/postgis:9.4-2.1
$ sudo apt-get install postgresql-client-9.3
$ psql -h localhost -U docker -l
Password for user docker: (also 'docker')
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
------------------+----------+-----------+---------+-------+-----------------------
gis | docker | UTF8 | C | C |
postgres | postgres | SQL_ASCII | C | C |
template0 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
template_postgis | postgres | UTF8 | C | C |
(5 rows)


This shorthand script ``~/git/services/postgis/run-postgis.sh`` will (re)run the ``postgis`` container.

.. literalinclude:: ../../services/postgis/run-postgis.sh
:language: bash

ETL - Last Measurements
~~~~~~~~~~~~~~~~~~~~~~~

Uses the ``geonovum/stetl`` image with Stetl config from GitHub. ::

# build stetl image
cd ~/git/docker/stetl
sudo docker build -t geonovum/stetl .

# run last measurements ETL, linking to postgis image
cd ~/git/etl
./last.sh

# before first run do ./db-init.sh to create DB schema and tables

The ``last.sh`` script is a wrapper to run the generic Docker ``geonovum/stetl`` with our
local ETL-config and PostGIS.

Apache2
~~~~~~~

Expand Down Expand Up @@ -333,47 +383,3 @@ Debugging, start/stop Apache quickly within container: ::
# Start Apache from commandline
/bin/bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND"

PostGIS
~~~~~~~

PostGIS from Kartoza, see https://hub.docker.com/r/kartoza/postgis/ and https://github.com/kartoza/docker-postgis ::

$ sudo docker pull kartoza/postgis:9.4-2.1
$ sudo docker run --name "postgis" -p 5432:5432 -d -t kartoza/postgis:9.4-2.1
$ sudo apt-get install postgresql-client-9.3
$ psql -h localhost -U docker -l
Password for user docker: (also 'docker')
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
------------------+----------+-----------+---------+-------+-----------------------
gis | docker | UTF8 | C | C |
postgres | postgres | SQL_ASCII | C | C |
template0 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | SQL_ASCII | C | C | =c/postgres +
| | | | | postgres=CTc/postgres
template_postgis | postgres | UTF8 | C | C |
(5 rows)


This shorthand script ``~/git/services/postgis/run-postgis.sh`` will (re)run the ``postgis`` container.

.. literalinclude:: ../../services/postgis/run-postgis.sh
:language: bash

ETL - Last Measurements
~~~~~~~~~~~~~~~~~~~~~~~

Uses the ``geonovum/stetl`` image with Stetl config from GitHub. ::

# build stetl image
cd ~/git/docker/stetl
sudo docker build -t geonovum/stetl .

# run last measurements ETL, linking to postgis image
cd ~/git/etl
./last.sh

# may first do ./db-init.sh to create DB schema and tables


0 comments on commit 1cd3b0d

Please sign in to comment.