Skip to content

Commit

Permalink
Docker for development (#2593)
Browse files Browse the repository at this point in the history
* Refactor to align with updated PG Geogig plugin: calls the plugin only to create the geogig repo, and calls gsconfig to create the datastore

* prevent auto redirect when additional information is required.

* bump gsconfig to 1.0.6

*  - Paver setup_geoserver using the new 2.9.x

*  - remove layer_is FK constraints from layer_styles migrations

* Added documentation for configuring an AWS S3 Bucket with GeoNode

* fix broken og:image link in meta tag in head

* Revert " - remove layer_is FK constraints from layer_styles migrations"

This reverts commit ea2b292.

*  - test travis script with Java 8 (#2584)

- test travis script with Java 8

 - test travis script with Java 8

* No specific versions in setup.py, only minimum

* Bump version to start 2.5 cycle

* Use published image for development

* Added docker-compose and docker-compose.override

* Pinned requirements

* Pull image in deployment, build image in development

* Makefile for tasks

* Added pull target

* Avoid autocompletelight 3

* Switch to 'latest' geonode/docker

* Requirements from travis

* Downgrade requirements

* Use requirements file

* Don't use project_name

* Use specific docker images

* s/genode/geonode

* Use geoserver latest

* Use latest tag for nginx

* Fix migration problems

* Use run instead of exec

* Fix requirements.txt

* Revert "Fix migration problems"

This reverts commit aa33ce6.

* Fix httplib version

* Fix tests

* Call docker-django from latest
  • Loading branch information
ingenieroariel authored Aug 21, 2016
1 parent a5dc49f commit 8791e4e
Show file tree
Hide file tree
Showing 8 changed files with 228 additions and 62 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ install:
- sudo apt-get update
- sudo apt-get install -y --force-yes oracle-java8-installer ant maven2 libjai-imageio-core-java --no-install-recommends
- sudo update-java-alternatives --set java-8-oracle
- pip install -e . --use-mirrors
- pip install -r requirements.txt --use-mirrors
- pip install -e . --use-mirrors --no-deps

before_script:
- paver setup
Expand Down
20 changes: 2 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
FROM ubuntu:14.04

RUN \
apt-get update && \
apt-get install -y build-essential && \
apt-get install -y libxml2-dev libxslt1-dev libjpeg-dev gettext git python-dev python-pip zlib1g-dev && \
apt-get install -y python-pillow python-lxml python-psycopg2 python-django python-bs4 python-multipartposthandler transifex-client python-paver python-nose python-django-nose python-gdal python-django-pagination python-django-jsonfield python-django-extensions python-django-taggit python-httplib2 && \
apt-get install -y --force-yes openjdk-6-jdk ant maven2 --no-install-recommends

WORKDIR /geonode
ADD . /geonode

RUN pip install -e /geonode
RUN paver setup

CMD ["paver", "start", "-b 0.0.0.0:8000","-f"]
EXPOSE 8000
EXPOSE 8080
FROM geonode/django
MAINTAINER GeoNode development team
37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
up:
# bring up the services
docker-compose up -d

build:
docker-compose build django
docker-compose build celery

sync:
# set up the database tablea
docker-compose run django python manage.py makemigrations --noinput
docker-compose run django python manage.py migrate account --noinput
docker-compose run django python manage.py migrate --noinput

wait:
sleep 5

logs:
docker-compose logs --follow

down:
docker-compose down

pull:
docker-compose pull

smoketest:
docker-compose run django python manage.py test geonode.tests.smoke nosetests geonode.tests.smoke --nocapture --detailed-errors --verbosity=1 --failfast

unittest:
docker-compose run django python manage.py test geonode.people.tests geonode.base.tests geonode.layers.tests geonode.maps.tests geonode.proxy.tests geonode.security.tests geonode.social.tests geonode.catalogue.tests geonode.documents.tests geonode.api.tests geonode.groups.tests geonode.services.tests geonode.geoserver.tests geonode.upload.tests geonode.tasks.tests --noinput --failfast

test: smoketest unittest

reset: down up wait sync

hardreset: pull build reset
22 changes: 22 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '2'

services:
django:
build: .
# Loading the app is defined here to allow for
# autoreload on changes it is mounted on top of the
# old copy that docker added when creating the image
volumes:
- '.:/usr/src/app'
environment:
- DEBUG=True

celery:
build: .
# Loading the app is defined here to allow for
# autoreload on changes it is mounted on top of the
# old copy that docker added when creating the image
volumes:
- '.:/usr/src/app'
environment:
- DEBUG=True
54 changes: 54 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: '2'
services:

postgres:
image: postgres

elasticsearch:
image: elasticsearch

rabbitmq:
image: rabbitmq

django:
image: geonode/django
links:
- postgres
- elasticsearch
- rabbitmq
environment:
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres
- BROKER_URL=amqp://guest:guest@rabbitmq:5672/
- DJANGO_SETTINGS_MODULE=geonode.settings
- GEOSERVER_BASE_URL="http://geoserver:8080/geoserver/"
- ALLOWED_HOSTS=['django',]

celery:
image: geonode/django:geonode
links:
- rabbitmq
- postgres
- elasticsearch
command: celery worker --app=geonode.celeryapp:app -B -l INFO
environment:
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres
- BROKER_URL=amqp://guest:guest@rabbitmq:5672/
- GEOSERVER_BASE_URL="http://geoserver:8080/geoserver/"
- DJANGO_SETTINGS_MODULE=geonode.settings
- ALLOWED_HOSTS=['django',]
- C_FORCE_ROOT=1

geoserver:
image: geonode/geoserver
links:
- postgres
ports:
- "8080"

nginx:
image: geonode/nginx
links:
- django
- geoserver
ports:
- "80:80"
2 changes: 1 addition & 1 deletion geonode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import os

__version__ = (2, 4, 0, 'alpha', 0)
__version__ = (2, 5, 0, 'alpha', 0)


class GeoNodeException(Exception):
Expand Down
68 changes: 68 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Django==1.8.7
MultipartPostHandler==0.1.0
OWSLib==0.11.0
Paver==1.2.1
Shapely==1.5.13
Unidecode==0.4.19
amqp==1.4.9
anyjson==0.3.3
awesome-slugify==1.6.2
beautifulsoup4==4.2.1
billiard==3.3.0.23
boto==2.38.0
celery==3.1.17
django-activity-stream==0.6.1
django-appconf==0.5
django-autocomplete-light==2.3.3
django-bootstrap3-datetimepicker==2.2.3
django-celery==3.1.16
django-downloadview==1.2
django-extensions==1.6.1
django-forms-bootstrap==3.0.1
django-friendly-tag-loader==1.2.1
django-geoexplorer==4.0.5
django-guardian==1.4.1
django-haystack==2.1.0
django-jsonfield==0.9.16
django-leaflet==0.13.7
django-modeltranslation==0.11
django-mptt==0.8.0
django-nose==1.4.4
django-pagination==1.0.7
django-polymorphic==0.9.2
django-storages==1.1.8
django-taggit==0.18.0
django-tastypie==0.12.2
flake8==2.3.0
geolinks==0.2.0
geonode-agon-ratings==0.3.5
geonode-announcements==1.0.8
geonode-arcrest==10.2
geonode-avatar==2.1.6
geonode-dialogos==0.6
geonode-notification==1.1.1
geonode-user-accounts==1.0.12
geonode-user-messages==0.1.4
gisdata==0.5.4
gsconfig==1.0.6
gsimporter==1.0.0
httplib2==0.9.2
kombu==3.0.35
lxml==3.6.4
mccabe==0.5.2
pep8==1.6.2
pillow==3.3.1
pinax-theme-bootstrap==3.0a11
pinax-theme-bootstrap-account==1.0b2
pycsw==2.0.0
pyelasticsearch==0.6.1
pyflakes==1.2.3
pyproj==1.9.5.1
python-dateutil==2.5.3
python-mimeparse==1.5.2
pytz==2016.6.1
pyyaml==3.11
regex==2016.7.21
requests==2.11.1
transifex-client==0.10
xmltodict==0.9.2
84 changes: 42 additions & 42 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,42 +84,42 @@ def fullsplit(path, result=None):
# native dependencies
"pillow>=3.1.1", # python-pillow
"lxml>=3.4.4", # python-lxml
# "psycopg2==2.4.5", # python-psycopg2
"Django==1.8.7", # python-django
"psycopg2>=2.4.5", # python-psycopg2
"Django >=1.8.7, < 1.9a0", # python-django

# Other
"pyyaml==3.11",
"beautifulsoup4==4.2.1", # python-bs4
"MultipartPostHandler==0.1.0", # python-multipartposthandler
"httplib2==0.9.2", # python-httplib2
"transifex-client==0.10", # transifex-client
"Paver==1.2.1", # python-paver
"pyyaml>=3.11",
"beautifulsoup4>=4.2.1", # python-bs4
"MultipartPostHandler>=0.1.0", # python-multipartposthandler
"httplib2>=0.9.2", # python-httplib2
"transifex-client>=0.10", # transifex-client
"Paver>=1.2.1", # python-paver
"nose>=1.3.1", # python-nose
"django-nose>=1.4", # python-django-nose
"awesome-slugify==1.6.2",
"awesome-slugify>=1.6.2",

# Django Apps
"django-pagination >=1.0.5, <=1.0.7", # python-django-pagination
"django-jsonfield==0.9.16", # python-django-jsonfield
"django-extensions==1.6.1", # python-django-extensions
"django-taggit==0.18.0", # python-django-taggit
"django-mptt==0.8.0", # django-mptt
"django-guardian==1.4.1", # django-guardian
# "django-admin-bootstrapped==1.6.5", # django-admin-bootstrapped
"django-jsonfield>=0.9.16", # python-django-jsonfield
"django-extensions>=1.6.1", # python-django-extensions
"django-taggit>=0.18.0", # python-django-taggit
"django-mptt>=0.8.0", # django-mptt
"django-guardian>=1.4.1", # django-guardian
# "django-admin-bootstrapped>=1.6.5", # django-admin-bootstrapped

# # Apps with packages provided in GeoNode's PPA on Launchpad.
"pinax-theme-bootstrap==3.0a11",
"pinax-theme-bootstrap-account==1.0b2",
"django-forms-bootstrap==3.0.1",
"django-friendly-tag-loader==1.2.1",
"django-activity-stream==0.6.1",
"django-downloadview==1.2",
"django-tastypie==0.12.2",

"django-polymorphic==0.9.2",
"django-leaflet==0.13.7",
"django-autocomplete-light==2.3.3",
"django-modeltranslation==0.11",
"pinax-theme-bootstrap>=3.0a11",
"pinax-theme-bootstrap-account>=1.0b2",
"django-forms-bootstrap>=3.0.1",
"django-friendly-tag-loader>=1.2.1",
"django-activity-stream>=0.6.1",
"django-downloadview>=1.2",
"django-tastypie>=0.12.2",

"django-polymorphic>=0.9.2",
"django-leaflet>=0.13.7",
"django-autocomplete-light>=2.3.3, <3.0a0",
"django-modeltranslation>=0.11",

# GeoNode org maintained apps.
"django-geoexplorer>=4.0.5",
Expand All @@ -128,33 +128,33 @@ def fullsplit(path, result=None):
"geonode-announcements>=1.0.8",
"geonode-agon-ratings>=0.3.5",
"geonode-user-accounts>=1.0.12",
"geonode-arcrest==10.2",
"geonode-arcrest>=10.2",
"geonode-notification>=1.1.1",
"geonode-dialogos>=0.5",
"gsconfig==1.0.6",
"gsimporter==1.0.0",
"gsconfig>=1.0.6",
"gsimporter>=1.0.0",
"gisdata>=0.5.4",

# geopython dependencies
"OWSLib==0.11.0",
"pycsw==2.0.0-alpha1",
"OWSLib>=0.11.0",
"pycsw>=2.0.0-alpha1",
"pyproj>=1.9.3",
"Shapely==1.5.13",
"Shapely>=1.5.13",

# haystack/elasticsearch, uncomment to use
"django-haystack==2.1.0",
"pyelasticsearch==0.6.1",
"celery==3.1.17",
"django-celery==3.1.16",
"django-haystack>=2.1.0",
"pyelasticsearch>=0.6.1",
"celery>=3.1.17",
"django-celery>=3.1.16",

# datetimepicker widget
"django-bootstrap3-datetimepicker==2.2.3",
"flake8==2.3.0",
"pep8==1.6.2",
"django-bootstrap3-datetimepicker>=2.2.3",
"flake8>=2.3.0",
"pep8>=1.6.2",

#AWS S3 dependencies
"django-storages==1.1.8",
"boto==2.38.0"
"django-storages>=1.1.8",
"boto>=2.38.0"
],
zip_safe=False,
)

0 comments on commit 8791e4e

Please sign in to comment.