Skip to content

Commit

Permalink
GNIP 89: Architecture Design - Resource and Storage Manager Modules (#…
Browse files Browse the repository at this point in the history
…7670)

* Generalization of update method, rename gs_resource and fix regiorns

* Refactor append and replace with resource_manager

* [Resource Manager] Move Security logic to the Resource Manager

* [Resource Manager] Move Security logic to the Resource Manager

* [Resource Manager] Move Security logic to the Resource Manager

* Handling resource storing via replace or append

* Handling resource storing via replace or append

* Enrich replace/append, fix broken thumburl in panels

* Add storage of files for resource_manager.append

* Pr comments: fix layer permission error, add header in new file, remove dependencies with gs_catalog from resource_manager, add layer storage into revise_resource_value

* Fix curated_thumbnail and let it store the file via storage_manager. Add new def to storages and rollback curated thumb for app and doc

* Fix curated_thumbnail and let it store the file via storage_manager. Add new def to storages and rollback curated thumb for app and doc

* Add missign migration file for curatedthub

* [Minor][Code Cleanup] rename "_storage_manager" to "_concrete_storage_manager"

* Rename storeType value in geonode

* Fix pr comments

* Fix pr comments

* Missing migration files

* Flake8 formatting

* Update requirements.txt

* [Pep8] Using f-strings instead of concatenated strings

* [Dependencies] typo on the requirements repo definition

* [Dependencies] Align setup.cfg to requirements.txt

* First draft of adding blob field to ResourceBase

* [Resource Manager] Fix "set_permissions" removal method

* [Dependencies] Align setup.cfg to requirements.txt

* Fix data serializer in order to retreive data blob only if required

* Resourcebase migration file

* [Dependencies] Align setup.cfg to requirements.txt

* [LGTM] Fix LGTM Issues

* [LGTM] Fix LGTM Issues

* Remove unused models

* Remove unused models

* [Dependencies] Align setup.cfg to requirements.txt

* - Fix "synch_guardian" celery task

* Fix geostory value update

* [Ref #7298] json field dependency confusion

* Fix migrations process

* - Update docker entries logs and ngix image

* Fix Map creation

* Fix Map creation

* - Move data/blob serializer to ResourceBase

* - Pep8 issues

* - Fix geoapp serializer

* [CircleCI] Test fixes

* [GeoStories] Fix data save as JSON

* Fix error in save geostory metadata

* Exclude blob and files from resourcebase form

* [CircleCI] Test fixes

* [CircleCI] Test fixes

* [CircleCI] Test fixes

* Minor bugfix for maps and resource update

* Fix storage manager tests

* [CircleCI] Test fixes

* Fix storage manager tests

* [CircleCI] Test fixes

* [CircleCI] Test fixes

* [CircleCI] Test fixes

* [CircleCI] Test fixes

* [CircleCI] Test fixes

* [CircleCI] Test fixes

* - Fixes GeoServer append/replace operation

* - Fixes GeoServer append/replace operation

* [Fixes geosolutions-it/nexus-geonode#225] Legends links on maps are broken

* FIx serializer

* [CircleCI] Test fixes

* [Fixes #7675] Problem creating thumbnail

* [LGTM] Do not modify the source dictionary

* [WIP] [Resource Manager] Copy operation

* [Code Quality] Run pyupgrade to ensure the code is modernized.

* [Dependencies] Align setup.cfg to requirements.txt

* [LGTM] Fix LGTM issues

* [LGTM] Fix LGTM issues

* [Resource Manager] Implemented "copy" method

* [Fixes #220]: Trying to delete a resource from the main page fails

* [LGTM] Fix LGTM issues

* - Fix and merge migrations

* Initial draft of new harvesting app

* Continue implementation of base harvesting infrastructure

* Add string representation to harvester model

* Add django_celery_results to enable storing results integrated with django

Also:

- Add resource descriptor base classes
- Start parsing CSW record
- Draft harvesting task

* Extract relevant information from a remote GeoNode resource

* Add ability to parse harvester type specific config with jsonschema

Also add a stricter XML parser and use it

* Use API v1 for the GeoNode legacy harvester

This is now being used over the CSW API because there doesn't seem to be any way to filter specific resource types (document, layer, etc) when using the CSW API.

Also begin adding a WMS harvester

* Continue implementation

* Add harvestable resource list and some way to control them - wip

* Refactor harvesting in order to take into account selection of which resources should be harvested

* Automatically check harvestable resources when creating a harvester

This is done when creating a harvester both on the django admin and also via REST API

* Made BaseHarvesterWorker a proper AbstractBaseClass

This shall make the interface that child harvesters neet to implement be more evident.

Also refactored API endpoints for accessing a harvester's harvestable resources and managing their respective `should_be_harvested` property.

Implementation is relying on nested routers, as provided by the drf-extensions package

* Work on REST API for harvesting

A harvester reource's status can be set to one of the predefined values in order to request updates of the harvester data

* Implement regeneration of harvestable resources when worker config is changed via admin and API

* Refactor base harvester worker

The harvesting async workflow seems to be mostly modelled now, with the GeoNode legacy harvester as a reference implementation of a worker

This commit has some other WIP changes

* Launch update of harvestble resources with django's on_commit in order to ensure correct behavior

* Add some docstrings

* fix some bugs and add support for django 3.2

* Store a list of CRSs instead of a single one

* base harvester provides a concrete implementation of update_geonode_resource

Previously this was an abstract method, but it is more sensible to provide a default. Note that the actual implementation of this method is not done yet.

* Adjust name of harvesting dispatcher task in serializers.py

* Update harvester to update using ResourceManager

* Fix jsonfield error

* adapting base worker

* fix failing test

* [Resource Manager] Implement "copy" resource method #224

* Initial integration with resource_manager for the GeoNode harvester

* [Fixes #7692] Layers caching problem (#7691)

* Implement removal of harvestable resources that are no longer relevant

Also improved GeoNodeLegacyHarvester's abilities to report on existing remote resources. This now takes into account the current preferences for harvesting layers, maps and documents

* [CircleCI] Trying to speed up tests

* [CircleCI] Trying to speed up tests

* [CircleCI] Trying to speed up tests

* [CircleCI] Trying to speed up tests

* [CircleCI] Trying to speed up tests

* [CircleCI] Fix and speeding up tests: api.tests base.tests

* [CircleCI] Fix and speeding up tests: api.tests base.tests

* [Issue 80] Add name and typename to legacy api

* [Issue 80] Add links to v2 api

* [Issue 80] rollback unwanted changes

* Implement removal of orphaned resources

* [CircleCI] Fix and speeding up tests: api.tests base.tests

* [CircleCI] Fix and speeding up tests: api.tests base.tests

* Implement saving a document's URL and thumbnail in the GeoNode harvesting worker

* [CircleCI] Fix and speeding up tests: api.tests base.tests

* - PEP8 issues plus a minor refactoring of the harvesting api urls pattern

* - PEP8 issues use logger.exception accordingly to the doc and remove unneeded exceptions concat

* get rid of redundant exception logging

* Fix error pk assignee by sequnce object

* - Make sure the "saved_layer" is valid

* Extend HarvesterWorkerBase to allow creating other types of geonode resources

* [LGTM] Fix LGTM issues

* - Add "rabbitmqadmin" shell utility command

* [CircleCI] Fix and speedup security tests

* Make resource description more flexible in order to handle missing values

* [Pep8] Fix issues

* [CircleCI] Fix and speed-up Test Cases

* [Fixes #7717] Temporary files created under static root are never removed

* [Pep8] Fix issues

* [CircleCI] Fix and speed-up Test Cases

* [CircleCI] Fix and speed-up Test Cases

* [Fixes #7717] Temporary files created under static root are never removed

* [CircleCI] Fix and speed-up Test Cases

* Missing changes from 7693

* Missing changes from 7693

* [CircleCI] Fix and speed-up Test Cases

* [Fixes #262] Rename Layer / Layers to Dataset / Datasets inside operations pages

* [CircleCI] Fix and speed-up Test Cases

* Add mo files

* [CircleCI] Fix and speed-up Test Cases

* [CircleCI] Fix and speed-up Test Cases

* [CircleCI] Fix and speed-up Test Cases

* [CircleCI] Fix and speed-up Test Cases

* [CircleCI] Fix and speed-up Test Cases

* [CircleCI] Fix and speed-up Test Cases

* [CircleCI] Fix and speed-up Test Cases

* Modify button links

* - Typo: UnboundLocalError: local variable '_disable_layer_cache' referenced before assignment

* [Resource Manager] Make the RM able to set thumbs for Documents also

* - Avoid redundant logs on error stdout

* - Added local enviroment to simplify people advanced install setup

* [Hardening] Improve background error logging and avoid usefulness cycles in the case the image is good

* [Dependencies] Align "setup.cfg" to the "requirements.txt" file

* Fix MetaData update redirect

* [Resource Manager] Ingest method

* [Hardening] Catch IntegrityError on contributios migrations

* ISSUE 277: add storetype to resourcebase

* [Resource Manager] GeoServer concrete "ingest": make a temporary local copy of the stored files

* [CircleCI] Tests fixes

* [Pep8] Fix pep8 issues

(cherry picked from commit 7360cdb)

* [CircleCI] Tests fixes

* [CircleCI] Tests fixes

* ISSUE 277: rename storetype for layers

* [CircleCI] Tests fixes

* [CircleCI] Tests fixes

* [CircleCI] Tests fixes

* [ISSUE  #298] Add state property to resources endpoint response

* Rename endpoint from layers to datasets

* [WIP][ISSUE #299] Expose resource manager methods as resource REST API endpoints

* [WIP][ISSUE #299] Expose resource manager methods as resource REST API endpoints

* [CircleCI] Tests fixes

* change Layer to Dataset

* [CircleCI] Tests fixes

* [CircleCI] Tests fixes

* [WIP][ISSUE #299] Expose resource manager methods as resource REST API endpoints

* [CircleCI] Tests fixes

* [CircleCI] Tests fixes

* - Optimize migrations

 - Fix wrong field on resource/utils.py methods

* - Fix Migrations

* - Bump django-geonode-mapstore-client to version 4.0.0

* [CircleCI] Test fixes

* [CircleCI] Test fixes

* Rename endpoint from layers to datasets #885

Co-authored-by: mattiagiupponi <[email protected]>
Co-authored-by: mattiagiupponi <[email protected]>
Co-authored-by: marthamareal <[email protected]>
Co-authored-by: Ricardo Garcia Silva <[email protected]>
Co-authored-by: meomancer <[email protected]>
Co-authored-by: Giovanni Allegri <[email protected]>
Co-authored-by: Giovanni Allegri <[email protected]>
  • Loading branch information
8 people authored Jul 8, 2021
1 parent dcaaed9 commit f760e0f
Show file tree
Hide file tree
Showing 865 changed files with 32,540 additions and 15,549 deletions.
39 changes: 7 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ jobs:
command: docker logs django4geonode --tail 500
when: on_fail

- run:
name: Invoke logs (debug)
command: docker exec -it django4geonode sh -c 'tail -1000 /usr/src/geonode/invoke.log'
when: on_fail

- when:
condition: <<parameters.test_suite>>
steps:
Expand Down Expand Up @@ -126,44 +121,24 @@ workflows:
jobs:
- build:
name: geonode_test_suite_smoke
load_docker_cache: true
save_docker_cache: true
load_docker_cache: false
save_docker_cache: false
test_suite: ./test.sh geonode.tests.smoke geonode.tests.test_message_notifications geonode.tests.test_rest_api geonode.tests.test_search geonode.tests.test_utils
- build:
name: geonode_test_suite
load_docker_cache: true
load_docker_cache: false
save_docker_cache: false
test_suite: ./test.sh $(python -c "import sys;from geonode import settings;sys.stdout.write('\'' '\''.join([a+'\''.tests'\'' for a in settings.GEONODE_APPS]))") geonode.catalogue.backends.tests geonode.thumbs.tests
requires:
- geonode_test_suite_smoke
- build:
name: geonode_test_rest_apis
load_docker_cache: true
load_docker_cache: false
save_docker_cache: false
test_suite: ./test.sh geonode.base.api.tests geonode.layers.api.tests geonode.maps.api.tests geonode.documents.api.tests geonode.geoapps.api.tests
requires:
- geonode_test_suite_smoke
test_suite: ./test.sh geonode.base.api.tests geonode.layers.api.tests geonode.maps.api.tests geonode.documents.api.tests geonode.geoapps.api.tests geonode.upload.api.tests
- build:
name: geonode_test_integration_csw
load_docker_cache: true
load_docker_cache: false
save_docker_cache: false
test_suite: ./test_csw.sh
requires:
- geonode_test_suite_smoke
- build:
name: geonode_test_integration_monitoring
load_docker_cache: true
save_docker_cache: false
test_suite: ./test.sh geonode.tests.smoke geonode.monitoring.tests.integration
requires:
- geonode_test_suite_smoke
- build:
name: geonode_test_integration_upload
load_docker_cache: true
save_docker_cache: false
test_suite: ./test.sh geonode.upload.api.tests
requires:
- geonode_test_suite_smoke

# TODO
# - build:
Expand All @@ -184,7 +159,7 @@ workflows:
# name: tests_geoserver_integration
# load_docker_cache: true
# save_docker_cache: false
# test_suite: 'geonode.geoserver.tests.integration'
# test_suite: 'geonode.geoserver.tests.integration geonode.monitoring.tests.integration'
# requires:
# - geonode_test_suite_smoke

Expand Down
7 changes: 4 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ BACKUPS_VOLUME_DRIVER=local

C_FORCE_ROOT=1
FORCE_REINIT=false
INVOKE_LOG_STDOUT=true

# LANGUAGE_CODE=pt
# LANGUAGES=(('en','English'),('pt','Portuguese'))

DJANGO_SETTINGS_MODULE=geonode.settings
GEONODE_INSTANCE_NAME=geonode
GEONODE_LB_HOST_IP
GEONODE_LB_PORT
GEONODE_LB_HOST_IP=
GEONODE_LB_PORT=

# #################
# backend
Expand Down Expand Up @@ -119,7 +120,7 @@ DEFAULT_FROM_EMAIL='GeoNode <[email protected]>'
# Session/Access Control
LOCKDOWN_GEONODE=False
CORS_ORIGIN_ALLOW_ALL=True
X_FRAME_OPTIONS=ALLOW-FROM ALL
X_FRAME_OPTIONS="ALLOW-FROM ALL"
SESSION_EXPIRED_CONTROL_ENABLED=True
DEFAULT_ANONYMOUS_VIEW_PERMISSION=True
DEFAULT_ANONYMOUS_DOWNLOAD_PERMISSION=True
Expand Down
110 changes: 68 additions & 42 deletions .env_test
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ DOCKER_API_VERSION="1.24"
BACKUPS_VOLUME_DRIVER=local

C_FORCE_ROOT=1
FORCE_REINIT=false
INVOKE_LOG_STDOUT=true

DEBUG=False
# LANGUAGE_CODE=pt
# LANGUAGES=(('en','English'),('pt','Portuguese'))

DJANGO_SETTINGS_MODULE=geonode.settings
GEONODE_INSTANCE_NAME=geonode
GEONODE_LB_HOST_IP=
GEONODE_LB_PORT=

# #################
# backend
# #################
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
GEONODE_DATABASE=geonode
Expand All @@ -23,6 +29,8 @@ GEONODE_GEODATABASE=geonode_data
GEONODE_GEODATABASE_PASSWORD=geonode_data
GEONODE_DATABASE_SCHEMA=public
GEONODE_GEODATABASE_SCHEMA=public
DATABASE_HOST=db
DATABASE_PORT=5432
DATABASE_URL=postgis://geonode:geonode@db:5432/geonode
GEODATABASE_URL=postgis://geonode_data:geonode_data@db:5432/geonode_data
GEONODE_DB_CONN_MAX_AGE=0
Expand All @@ -33,12 +41,9 @@ ASYNC_SIGNALS=True

SITEURL=http://localhost:8001/

STATIC_ROOT=/mnt/volumes/statics/static/
MEDIA_ROOT=/mnt/volumes/statics/uploaded/
GEOIP_PATH=/mnt/volumes/statics/geoip.db

ALLOWED_HOSTS="['django', '*']"

# Data Uploader
DEFAULT_BACKEND_UPLOADER=geonode.importer
TIME_ENABLED=True
MOSAIC_ENABLED=False
Expand All @@ -47,20 +52,10 @@ HAYSTACK_ENGINE_URL=http://elasticsearch:9200/
HAYSTACK_ENGINE_INDEX_NAME=haystack
HAYSTACK_SEARCH_RESULTS_PER_PAGE=200

CACHE_BUSTING_STATIC_ENABLED=False
CACHE_BUSTING_MEDIA_ENABLED=False

MEMCACHED_ENABLED=False
MEMCACHED_BACKEND=django.core.cache.backends.memcached.PyMemcacheCache
MEMCACHED_LOCATION=127.0.0.1:11211
MEMCACHED_LOCK_EXPIRE=3600
MEMCACHED_LOCK_TIMEOUT=10

MAX_DOCUMENT_SIZE=2
CLIENT_RESULTS_LIMIT=5
API_LIMIT_PER_PAGE=1000

# #################
# nginx
# HTTPD Server
# #################
GEONODE_LB_HOST_IP=localhost
GEONODE_LB_PORT=80

Expand All @@ -83,7 +78,9 @@ LETSENCRYPT_MODE=disabled

RESOLVER=127.0.0.11

# GIS Server
# #################
# geoserver
# #################
GEOSERVER_WEB_UI_LOCATION=http://localhost:8001/geoserver/
GEOSERVER_PUBLIC_LOCATION=http://localhost:8001/geoserver/
GEOSERVER_LOCATION=http://geoserver:8080/geoserver/
Expand All @@ -96,29 +93,10 @@ OGC_REQUEST_BACKOFF_FACTOR=0.3
OGC_REQUEST_POOL_MAXSIZE=10
OGC_REQUEST_POOL_CONNECTIONS=10

# GIS Client
GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY=mapstore
MAPBOX_ACCESS_TOKEN=
BING_API_KEY=
GOOGLE_API_KEY=

# Monitoring
MONITORING_ENABLED=True
MONITORING_DATA_TTL=365
USER_ANALYTICS_ENABLED=True
USER_ANALYTICS_GZIP=True
CENTRALIZED_DASHBOARD_ENABLED=False
MONITORING_SERVICE_NAME=local-geonode
MONITORING_HOST_NAME=geonode

# Other Options/Contribs
MODIFY_TOPICCATEGORY=True
AVATAR_GRAVATAR_SSL=True
AVATAR_DEFAULT_URL=/geonode/img/avatar.png

EXIF_ENABLED=True
CREATE_LAYER=True
FAVORITE_ENABLED=True
# Java Options & Memory
ENABLE_JSONP=true
outFormat=text/javascript
GEOSERVER_JAVA_OPTS="-Djava.awt.headless=true -Xms2G -Xmx4G -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/var/log/jvm.log -XX:PerfDataSamplingInterval=500 -XX:SoftRefLRUPolicyMSPerMB=36000 -XX:-UseGCOverheadLimit -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Dfile.encoding=UTF8 -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=false -DGEOSERVER_CSRF_DISABLED=true -DPRINT_BASE_URL=http://geoserver:8080/geoserver/pdf -DALLOW_ENV_PARAMETRIZATION=true -Xbootclasspath/a:/usr/local/tomcat/webapps/geoserver/WEB-INF/lib/marlin-0.9.3-Unsafe.jar -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine"

# #################
# Security
Expand Down Expand Up @@ -166,3 +144,51 @@ OAUTH2_CLIENT_SECRET=rCnp5txobUo83EpQEblM8fVj3QT5zb5qRfxNsuPzCqZaiRyIoxM4jdgMiZK
# GeoNode APIs
API_LOCKDOWN=False
TASTYPIE_APIKEY=

# #################
# Production and
# Monitoring
# #################
DEBUG=False

SECRET_KEY='myv-y4#7j-d*p-__@j#*3z@!y24fz8%^z2v6atuy4bo9vqr1_a'

STATIC_ROOT=/mnt/volumes/statics/static/
MEDIA_ROOT=/mnt/volumes/statics/uploaded/
GEOIP_PATH=/mnt/volumes/statics/geoip.db

CACHE_BUSTING_STATIC_ENABLED=False
CACHE_BUSTING_MEDIA_ENABLED=False

MEMCACHED_ENABLED=False
MEMCACHED_BACKEND=django.core.cache.backends.memcached.MemcachedCache
MEMCACHED_LOCATION=127.0.0.1:11211
MEMCACHED_LOCK_EXPIRE=3600
MEMCACHED_LOCK_TIMEOUT=10

MAX_DOCUMENT_SIZE=2
CLIENT_RESULTS_LIMIT=5
API_LIMIT_PER_PAGE=1000

# GIS Client
GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY=mapstore
MAPBOX_ACCESS_TOKEN=
BING_API_KEY=
GOOGLE_API_KEY=

# Monitoring
MONITORING_ENABLED=True
MONITORING_DATA_TTL=365
USER_ANALYTICS_ENABLED=True
USER_ANALYTICS_GZIP=True
CENTRALIZED_DASHBOARD_ENABLED=False
MONITORING_SERVICE_NAME=local-geonode
MONITORING_HOST_NAME=geonode

# Other Options/Contribs
MODIFY_TOPICCATEGORY=True
AVATAR_GRAVATAR_SSL=True
EXIF_ENABLED=True
CREATE_LAYER=True
FAVORITE_ENABLED=True

10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ RUN chmod +x /usr/bin/celery-commands
COPY celery-cmd /usr/bin/celery-cmd
RUN chmod +x /usr/bin/celery-cmd

# Install "geonode-contribs" apps
RUN cd /usr/src; git clone https://github.com/GeoNode/geonode-contribs.git -b master
# Install logstash and centralized dashboard dependencies
RUN cd /usr/src/geonode-contribs/geonode-logstash; pip install --upgrade -e . \
cd /usr/src/geonode-contribs/ldap; pip install --upgrade -e .
# # Install "geonode-contribs" apps
# RUN cd /usr/src; git clone https://github.com/GeoNode/geonode-contribs.git -b master
# # Install logstash and centralized dashboard dependencies
# RUN cd /usr/src/geonode-contribs/geonode-logstash; pip install --upgrade -e . \
# cd /usr/src/geonode-contribs/ldap; pip install --upgrade -e .

RUN pip install --upgrade --no-cache-dir --src /usr/src -r requirements.txt
RUN pip install --upgrade -e .
Expand Down
65 changes: 28 additions & 37 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
# Exit script in case of error
set -e

INVOKE_LOG_STDOUT=${INVOKE_LOG_STDOUT:-FALSE}
invoke () {
if [ $INVOKE_LOG_STDOUT = 'true' ] || [ $INVOKE_LOG_STDOUT = 'True' ]
then
/usr/local/bin/invoke $@
else
/usr/local/bin/invoke $@ > /usr/src/geonode/invoke.log 2>&1
fi
echo "$@ tasks done"
}

# Start cron && memcached services
service cron restart
service memcached restart
Expand All @@ -12,7 +23,7 @@ echo "-----------------------------------------------------"
echo "STARTING DJANGO ENTRYPOINT $(date)"
echo "-----------------------------------------------------"

/usr/local/bin/invoke update > /usr/src/geonode/invoke.log 2>&1
invoke update

source $HOME/.bashrc
source $HOME/.override_env
Expand All @@ -30,8 +41,7 @@ echo MONITORING_HOST_NAME=$MONITORING_HOST_NAME
echo MONITORING_SERVICE_NAME=$MONITORING_SERVICE_NAME
echo MONITORING_DATA_TTL=$MONITORING_DATA_TTL

/usr/local/bin/invoke waitfordbs > /usr/src/geonode/invoke.log 2>&1
echo "waitfordbs task done"
invoke waitfordbs

cmd="$@"

Expand All @@ -40,13 +50,9 @@ echo DOCKER_ENV=$DOCKER_ENV
if [ -z ${DOCKER_ENV} ] || [ ${DOCKER_ENV} = "development" ]
then

echo "running migrations"
/usr/local/bin/invoke migrations > /usr/src/geonode/invoke.log 2>&1
echo "migrations task done"
/usr/local/bin/invoke prepare > /usr/src/geonode/invoke.log 2>&1
echo "prepare task done"
/usr/local/bin/invoke fixtures > /usr/src/geonode/invoke.log 2>&1
echo "fixture task done"
invoke migrations
invoke prepare
invoke fixtures

if [ ${IS_CELERY} = "true" ] || [ ${IS_CELERY} = "True" ]
then
Expand All @@ -55,11 +61,8 @@ then

else

echo "install requirements for development"
/usr/local/bin/invoke devrequirements > /usr/src/geonode/invoke.log 2>&1
echo "refresh static data"
/usr/local/bin/invoke statics > /usr/src/geonode/invoke.log 2>&1
echo "static data refreshed"
invoke devrequirements
invoke statics

echo "Executing standard Django server $cmd for Development"

Expand All @@ -71,32 +74,20 @@ else
echo "Executing Celery server $cmd for Production"
else

echo "running migrations"
/usr/local/bin/invoke migrations > /usr/src/geonode/invoke.log 2>&1
echo "migrations task done"
/usr/local/bin/invoke prepare > /usr/src/geonode/invoke.log 2>&1
echo "prepare task done"
invoke migrations
invoke prepare

if [ ${FORCE_REINIT} = "true" ] || [ ${FORCE_REINIT} = "True" ] || [ ! -e "/mnt/volumes/statics/geonode_init.lock" ]; then
/usr/local/bin/invoke updategeoip > /usr/src/geonode/invoke.log 2>&1
echo "updategeoip task done"
/usr/local/bin/invoke fixtures > /usr/src/geonode/invoke.log 2>&1
echo "fixture task done"
/usr/local/bin/invoke monitoringfixture > /usr/src/geonode/invoke.log 2>&1
echo "monitoringfixture task done"
/usr/local/bin/invoke initialized > /usr/src/geonode/invoke.log 2>&1
echo "initialized"
invoke updategeoip
invoke fixtures
invoke monitoringfixture
invoke initialized
fi

echo "refresh static data"
/usr/local/bin/invoke statics > /usr/src/geonode/invoke.log 2>&1
echo "static data refreshed"
/usr/local/bin/invoke waitforgeoserver > /usr/src/geonode/invoke.log 2>&1
echo "waitforgeoserver task done"
/usr/local/bin/invoke geoserverfixture > /usr/src/geonode/invoke.log 2>&1
echo "geoserverfixture task done"
/usr/local/bin/invoke updateadmin > /usr/src/geonode/invoke.log 2>&1
echo "updateadmin task done"
invoke statics
invoke waitforgeoserver
invoke geoserverfixture
invoke updateadmin

echo "Executing UWSGI server $cmd for Production"
fi
Expand Down
1 change: 0 additions & 1 deletion geonode/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
Expand Down
Loading

0 comments on commit f760e0f

Please sign in to comment.