Skip to content

Commit

Permalink
gisquick: work on installation section in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
landam committed Jun 21, 2017
1 parent 96fdf4b commit fae64a8
Show file tree
Hide file tree
Showing 9 changed files with 290 additions and 198 deletions.
18 changes: 9 additions & 9 deletions docs/.substitutions
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.. |tip| image:: img/paragraphs/tip.png
.. |tip| image:: ../img/paragraphs/tip.png
:width: 2.5em
.. |att| image:: img/paragraphs/attention.png
.. |att| image:: ../img/paragraphs/attention.png
:width: 2.5em
.. |todo| image:: img/paragraphs/todo.png
.. |todo| image:: ../img/paragraphs/todo.png
:width: 1.5em
.. |see| image:: img/paragraphs/see.png
.. |see| image:: ../img/paragraphs/see.png
:width: 1.5em
.. |note| image:: img/paragraphs/note.png
.. |note| image:: ../img/paragraphs/note.png
:width: 1.5em
.. |imp| image:: img/paragraphs/important.png
.. |imp| image:: ../img/paragraphs/important.png
:width: 1.5em
.. |danger| image:: img/paragraphs/danger.png
.. |danger| image:: ../img/paragraphs/danger.png
:width: 1.5em
.. |problem| image:: img/paragraphs/problem.png
.. |problem| image:: ../img/paragraphs/problem.png
:width: 1em
.. |solution| image:: img/paragraphs/solution.png
.. |solution| image:: ../img/paragraphs/solution.png
:width: 1em
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

# General information about the project.
project = u'Gisquick'
copyright = u'2016-2017, GIS.lab team'
copyright = u'2016-2017, Gisquick team'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -90,7 +90,7 @@
#keep_warnings = False

rst_epilog = """
.. include:: .substitutions
.. include:: ../.substitutions
"""

# -- Options for HTML output ----------------------------------------------
Expand Down Expand Up @@ -197,7 +197,7 @@
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'Gisquick.tex', u'Gisquick Documentation',
u'GIS.lab team', 'manual'),
u'Gisquick team', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -241,7 +241,7 @@
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Gisquick', u'Gisquick',
u'GIS.lab team', 'Gisquick', 'One line description of project.',
u'Gisquick team', 'Gisquick', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
6 changes: 3 additions & 3 deletions docs/environment-web.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _environment-web:

===========
Environment
===========
==============
User Interface
==============

----------
Print tool
Expand Down
39 changes: 20 additions & 19 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,40 @@
==========

Gisquick is an open source geospatial data publishing platform
developed for rapid sharing of `QGIS <http://qgis.org>`__ projects in
developed for rapid sharing `QGIS <http://qgis.org>`__ projects on the
web.

Gisquick has been originally developed for `GIS.lab
<http://web.gislab.io>`__ system with aim to produce generally usable
web client interface. Later it was separated into a new independent
project usable *with or without* GIS.lab infrastructure. It is how
Gisquick was born.

It provides responsive web design, legend, identification possibilities.
It allows creating topics from layers list, adding base and overlay layers,
attribute table data filtering, measuring coordinates, length or area
and handy project printing from web.
Gisquick provides responsive web design, legend, or identification
possibilities. It allows creating topics from layers list, adding base
and overlay layers, attribute table data filtering, measuring
coordinates, length or area, and handy project printing from
ready-to-use web application.

To get the better idea what Gisquick is, see video below.
Following subsections describe all closely related information.


.. raw:: html

<center><iframe width="560" height="315" src="https://www.youtube.com/embed/7vBM1X5QuqE" frameborder="0" allowfullscreen></iframe></center>
<p>
<center><iframe width="560" height="315"
src="https://www.youtube.com/embed/7vBM1X5QuqE" frameborder="0"
allowfullscreen></iframe></center> <p>

An integral part of whole mechanism is :ref:`Gisquick QGIS plugin
<gisquick-qgis-plugin>`. Following subsections give a detailed insight
into whole mechanism.
An integral part of publishing mechanism is a :ref:`Gisquick QGIS
plugin <gisquick-qgis-plugin>`. Following subsections give a detailed
insight into whole technology.

.. toctree::
:maxdepth: 2
:numbered:

installation-web
installation/index
project-publishing
environment-web
datasets
other

.. note:: Gisquick has been originally developed for `GIS.lab
<http://web.gislab.io>`__ system with aim to produce generally
usable web client interface. Later it was separated into a new
independent project usable with or without GIS.lab
infrastructure.

163 changes: 0 additions & 163 deletions docs/installation-web.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,173 +4,10 @@
Installation
============

As it was noticed in previous subsection, very important part is represented
by :ref:`Gisquick QGIS plugin <gisquick-qgis-plugin>`.

This plugin is part of ``gisquick`` source code, so all necessary files
are downloaded with cloning process. But let us stick to this order of
things. See instructions below.

--------------------------------
Creating development environment
--------------------------------

At first, it is necessary to clone source code with Git.

.. code:: sh
git clone https://github.com/gislab-npo/gisquick.git
Then optionaly GIS.lab Mobile can be enabled by adding configuration variable
to ``provision/host_vars/gisquick`` file as ``GISLAB_CLIENT_MOBILE: yes``.

Development environment is started after running following, well known
command from source code root directory.

.. code-block:: sh
:emphasize-lines: 1
$ vagrant up
Bringing machine 'gisquick' up with 'virtualbox' provider...
==> gisquick: Clearing any previously set forwarded ports...
==> gisquick: Clearing any previously set network interfaces...
==> gisquick: Preparing network interfaces based on configuration...
gisquick: Adapter 1: nat
==> gisquick: Forwarding ports...
gisquick: 90 => 8090 (adapter 1)
gisquick: 8000 => 8000 (adapter 1)
gisquick: 8100 => 8100 (adapter 1)
gisquick: 8200 => 8200 (adapter 1)
gisquick: 35729 => 35729 (adapter 1)
gisquick: 22 => 2222 (adapter 1)
==> gisquick: Running 'pre-boot' VM customizations...
==> gisquick: Booting VM...
==> gisquick: Waiting for machine to boot. This may take a few minutes...
gisquick: SSH address: 127.0.0.1:2222
gisquick: SSH username: vagrant
gisquick: SSH auth method: private key
gisquick: Warning: Connection timeout. Retrying...
gisquick: Warning: Remote connection disconnect. Retrying...
==> gisquick: Machine booted and ready!
==> gisquick: Checking for guest additions in VM...
==> gisquick: Setting hostname...
==> gisquick: Mounting shared folders...
gisquick: /vagrant => /home/ludka/git/gisquick
==> gisquick: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> gisquick: flag to force provisioning. Provisioners marked to run always will still run.
.. note:: |note| Minimum version of Ansible is ``2+``, see :ref:`Ansible installation <ansible-installation>`.
.. note:: |note| To speed up provisioning using **Apt proxy server**, set
``APT_PROXY`` variable before running above command like
``$ export APT_PROXY=http://192.168.99.118:3142``.
See :ref:`Apt Cacher server <apt-cacher-service>` instructions for more details
in this matter. Thanks to that, with next installation of server it can be faster
because software packages will have not to be downloaded again.
After, one can log in to virtual machine - still from source code root directory.
.. code-block:: sh
:emphasize-lines: 1
$ vagrant ssh
Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-83-generic i686)
* Documentation: https://help.ubuntu.com/
System information disabled due to load higher than 1.0
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
Last login: Wed Apr 13 08:49:28 2016 from 10.0.2.2
At this moment virtual machine is launched. Development services are started
after command below.
.. code-block:: sh
:emphasize-lines: 1
$ /vagrant/utils/tmux-dev.sh
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
System check identified no issues (0 silenced).
May 01, 2016 - 22:17:09
Django version 1.8.9, using settings 'devproj.settings'
Starting development server at https://0.0.0.0:8000/
Using SSL certificate: /home/vagrant/.virtualenvs/gisquick/local/lib/python2.7/site-packages/sslserver/certs/development.crt
Using SSL key: /home/vagrant/.virtualenvs/gisquick/local/lib/python2.7/site-packages/sslserver/certs/development.key
Quit the server with CONTROL-C.
─────────────────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────
sudo tail -n 0 -f /var/log/lighttpd/access.lo│sudo tail -n 0 -f /var/log/lighttpd/qgis-map
g /var/log/lighttpd/error.log │server.log
vagrant@gisquick:~$ sudo tail -n 0 -f /var/│vagrant@gisquick:~$ sudo tail -n 0 -f /var
log/lighttpd/access.log /var/log/lighttpd/error.log │/log/lighttpd/qgis-mapserver.log
==> /var/log/lighttpd/access.log <== │
==> /var/log/lighttpd/error.log <== │
[developme 0:servers* "gisquick" 20:17 01-May-16

.. _gisquick-qgis-plugin:

---------------
Gisquick plugin
---------------
Gisquick plugin builds GIS.lab web bundle from any QGIS desktop project.
It allows adding base layers, creating topics from layers list,
setting access constraints or project expiration.
.. _gisquick-qgis-plugin-logo:
.. figure:: img/gisquick-qgis-plugin-logo.svg
:align: center
:width: 150
Gisquick QGIS plugin icon.
All installed QGIS plugins are usually located in ``.qgis/python/plugins``
directory.
If ``gisquick`` repository is correctly cloned, for GIS.lab QGIS plugin
installation just symbolic link is enough. Create it from ``gisquick``
source code directory.
.. code:: sh
ln -s $(pwd)/qgis/gisquick ~/.qgis2/python/plugins/gisquick
Let's continue in QGIS environment. Create ordinary QGIS project or use some
existing one.
.. _qgis-project:
.. figure:: img/qgis-project.png
:align: center
:width: 750
Some QGIS project.
Go to :menuselection:`Plugins --> Manage and install plugins` and
in ``Installed`` tab of dialog window find **Gisquick plugin**.
Activate this plugin by checking the toggle beside it, see figure
:num:`#install-gisquick-plugin`.
.. _install-gisquick-plugin:
.. figure:: img/install-gisquick-plugin.png
:align: center
:width: 750
Gisquick QGIS plugin activation.
Assuming that QGIS project is saved, run GIS.lab plugin wizard as
:menuselection:`Web --> Gisquick` or just click on plugin's icon in menu bar.
Pass through ``Base layer``, ``Layers`` and ``Project`` dialog windows
Expand Down
68 changes: 68 additions & 0 deletions docs/installation/docker.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Installation using Docker containers
====================================

Gisquick application is split into 3 services running in Docker
containers:

#. **QGIS server** (``gisquick/qgis-server`` image)
#. **Django Application served with Gunicorn** (``gisquick/django`` image)
#. **Nginx Server** (``gisquick/nginx`` image)

These Docker images can be put together using ``docker-compose``
command. This command reads configuration file in YAML
language. Example of such confuguration is available in Gisquick
source code (`docker/example.docker-compose.yml
<https://github.com/gislab-npo/gisquick/blob/master/docker/example.docker-compose.yml>`__). Another
example is shown below.

.. code-block:: yaml
:emphasize-lines: 7
:linenos:
version: "2"
services:
qgisserver:
restart: always
image: gisquick/qgis-server
volumes:
- ./_data/publish:/publish/:ro
ports:
- "9000:90"
django:
restart: always
image: gisquick/django
links:
- qgisserver
volumes:
- ./_data/media:/var/www/gisquick/media/
- ./_data/data:/var/www/gisquick/data/
environment:
- GUNICORN_ERRORLOG=-
- GUNICORN_ACCESSLOG=-
nginx:
restart: unless-stopped
image: gisquick/nginx
links:
- django
volumes_from:
- django:ro
volumes:
- ./_data/etc/letsencrypt/:/etc/letsencrypt/
ports:
- "433:443"
It is important to set up shared directories mounted by Docker images
as volumes. *QGIS Server* requires setting up :file:`publish` directory
used for published Gisquick projects (see line ``7``).

Useful tips
-----------

Example of accessing Bash on ``gisquick/django`` container:

.. code-block:: bash
export DJANGO_CONTAINER_ID=`docker ps -qf "ancestor=gisquick/django"`
docker exec -it $DJANGO_CONTAINER_ID bash

0 comments on commit fae64a8

Please sign in to comment.