Skip to content

Commit f760e0f

Browse files
Alessio FabianimattiagiupponimarthamarealRicardo Garcia Silvameomancer
authored
GNIP 89: Architecture Design - Resource and Storage Manager Modules (GeoNode#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 GeoNode#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 GeoNode#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 GeoNode#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 GeoNode#224 * Initial integration with resource_manager for the GeoNode harvester * [Fixes GeoNode#7692] Layers caching problem (GeoNode#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 GeoNode#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 GeoNode#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 GeoNode#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 GeoNode#298] Add state property to resources endpoint response * Rename endpoint from layers to datasets * [WIP][ISSUE GeoNode#299] Expose resource manager methods as resource REST API endpoints * [WIP][ISSUE GeoNode#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 GeoNode#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 GeoNode#885 Co-authored-by: mattiagiupponi <mattia.giupponi@gmail.com> Co-authored-by: mattiagiupponi <51856725+mattiagiupponi@users.noreply.github.com> Co-authored-by: marthamareal <marthamareal@gmail.com> Co-authored-by: Ricardo Garcia Silva <ricardo@kartoza.com> Co-authored-by: meomancer <meomancer@gmail.com> Co-authored-by: Giovanni Allegri <571129+giohappy@users.noreply.github.com> Co-authored-by: Giovanni Allegri <giohappy@gmail.com>
1 parent dcaaed9 commit f760e0f

File tree

865 files changed

+32540
-15549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

865 files changed

+32540
-15549
lines changed

.circleci/config.yml

+7-32
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@ jobs:
9393
command: docker logs django4geonode --tail 500
9494
when: on_fail
9595

96-
- run:
97-
name: Invoke logs (debug)
98-
command: docker exec -it django4geonode sh -c 'tail -1000 /usr/src/geonode/invoke.log'
99-
when: on_fail
100-
10196
- when:
10297
condition: <<parameters.test_suite>>
10398
steps:
@@ -126,44 +121,24 @@ workflows:
126121
jobs:
127122
- build:
128123
name: geonode_test_suite_smoke
129-
load_docker_cache: true
130-
save_docker_cache: true
124+
load_docker_cache: false
125+
save_docker_cache: false
131126
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
132127
- build:
133128
name: geonode_test_suite
134-
load_docker_cache: true
129+
load_docker_cache: false
135130
save_docker_cache: false
136131
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
137-
requires:
138-
- geonode_test_suite_smoke
139132
- build:
140133
name: geonode_test_rest_apis
141-
load_docker_cache: true
134+
load_docker_cache: false
142135
save_docker_cache: false
143-
test_suite: ./test.sh geonode.base.api.tests geonode.layers.api.tests geonode.maps.api.tests geonode.documents.api.tests geonode.geoapps.api.tests
144-
requires:
145-
- geonode_test_suite_smoke
136+
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
146137
- build:
147138
name: geonode_test_integration_csw
148-
load_docker_cache: true
139+
load_docker_cache: false
149140
save_docker_cache: false
150141
test_suite: ./test_csw.sh
151-
requires:
152-
- geonode_test_suite_smoke
153-
- build:
154-
name: geonode_test_integration_monitoring
155-
load_docker_cache: true
156-
save_docker_cache: false
157-
test_suite: ./test.sh geonode.tests.smoke geonode.monitoring.tests.integration
158-
requires:
159-
- geonode_test_suite_smoke
160-
- build:
161-
name: geonode_test_integration_upload
162-
load_docker_cache: true
163-
save_docker_cache: false
164-
test_suite: ./test.sh geonode.upload.api.tests
165-
requires:
166-
- geonode_test_suite_smoke
167142

168143
# TODO
169144
# - build:
@@ -184,7 +159,7 @@ workflows:
184159
# name: tests_geoserver_integration
185160
# load_docker_cache: true
186161
# save_docker_cache: false
187-
# test_suite: 'geonode.geoserver.tests.integration'
162+
# test_suite: 'geonode.geoserver.tests.integration geonode.monitoring.tests.integration'
188163
# requires:
189164
# - geonode_test_suite_smoke
190165

.env

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ BACKUPS_VOLUME_DRIVER=local
88

99
C_FORCE_ROOT=1
1010
FORCE_REINIT=false
11+
INVOKE_LOG_STDOUT=true
1112

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

1516
DJANGO_SETTINGS_MODULE=geonode.settings
1617
GEONODE_INSTANCE_NAME=geonode
17-
GEONODE_LB_HOST_IP
18-
GEONODE_LB_PORT
18+
GEONODE_LB_HOST_IP=
19+
GEONODE_LB_PORT=
1920

2021
# #################
2122
# backend
@@ -119,7 +120,7 @@ DEFAULT_FROM_EMAIL='GeoNode <no-reply@geonode.org>'
119120
# Session/Access Control
120121
LOCKDOWN_GEONODE=False
121122
CORS_ORIGIN_ALLOW_ALL=True
122-
X_FRAME_OPTIONS=ALLOW-FROM ALL
123+
X_FRAME_OPTIONS="ALLOW-FROM ALL"
123124
SESSION_EXPIRED_CONTROL_ENABLED=True
124125
DEFAULT_ANONYMOUS_VIEW_PERMISSION=True
125126
DEFAULT_ANONYMOUS_DOWNLOAD_PERMISSION=True

.env_test

+68-42
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@ DOCKER_API_VERSION="1.24"
77
BACKUPS_VOLUME_DRIVER=local
88

99
C_FORCE_ROOT=1
10+
FORCE_REINIT=false
11+
INVOKE_LOG_STDOUT=true
1012

11-
DEBUG=False
13+
# LANGUAGE_CODE=pt
14+
# LANGUAGES=(('en','English'),('pt','Portuguese'))
1215

1316
DJANGO_SETTINGS_MODULE=geonode.settings
1417
GEONODE_INSTANCE_NAME=geonode
1518
GEONODE_LB_HOST_IP=
1619
GEONODE_LB_PORT=
1720

21+
# #################
22+
# backend
23+
# #################
1824
POSTGRES_USER=postgres
1925
POSTGRES_PASSWORD=postgres
2026
GEONODE_DATABASE=geonode
@@ -23,6 +29,8 @@ GEONODE_GEODATABASE=geonode_data
2329
GEONODE_GEODATABASE_PASSWORD=geonode_data
2430
GEONODE_DATABASE_SCHEMA=public
2531
GEONODE_GEODATABASE_SCHEMA=public
32+
DATABASE_HOST=db
33+
DATABASE_PORT=5432
2634
DATABASE_URL=postgis://geonode:geonode@db:5432/geonode
2735
GEODATABASE_URL=postgis://geonode_data:geonode_data@db:5432/geonode_data
2836
GEONODE_DB_CONN_MAX_AGE=0
@@ -33,12 +41,9 @@ ASYNC_SIGNALS=True
3341

3442
SITEURL=http://localhost:8001/
3543

36-
STATIC_ROOT=/mnt/volumes/statics/static/
37-
MEDIA_ROOT=/mnt/volumes/statics/uploaded/
38-
GEOIP_PATH=/mnt/volumes/statics/geoip.db
39-
4044
ALLOWED_HOSTS="['django', '*']"
4145

46+
# Data Uploader
4247
DEFAULT_BACKEND_UPLOADER=geonode.importer
4348
TIME_ENABLED=True
4449
MOSAIC_ENABLED=False
@@ -47,20 +52,10 @@ HAYSTACK_ENGINE_URL=http://elasticsearch:9200/
4752
HAYSTACK_ENGINE_INDEX_NAME=haystack
4853
HAYSTACK_SEARCH_RESULTS_PER_PAGE=200
4954

50-
CACHE_BUSTING_STATIC_ENABLED=False
51-
CACHE_BUSTING_MEDIA_ENABLED=False
52-
53-
MEMCACHED_ENABLED=False
54-
MEMCACHED_BACKEND=django.core.cache.backends.memcached.PyMemcacheCache
55-
MEMCACHED_LOCATION=127.0.0.1:11211
56-
MEMCACHED_LOCK_EXPIRE=3600
57-
MEMCACHED_LOCK_TIMEOUT=10
58-
59-
MAX_DOCUMENT_SIZE=2
60-
CLIENT_RESULTS_LIMIT=5
61-
API_LIMIT_PER_PAGE=1000
62-
55+
# #################
56+
# nginx
6357
# HTTPD Server
58+
# #################
6459
GEONODE_LB_HOST_IP=localhost
6560
GEONODE_LB_PORT=80
6661

@@ -83,7 +78,9 @@ LETSENCRYPT_MODE=disabled
8378

8479
RESOLVER=127.0.0.11
8580

86-
# GIS Server
81+
# #################
82+
# geoserver
83+
# #################
8784
GEOSERVER_WEB_UI_LOCATION=http://localhost:8001/geoserver/
8885
GEOSERVER_PUBLIC_LOCATION=http://localhost:8001/geoserver/
8986
GEOSERVER_LOCATION=http://geoserver:8080/geoserver/
@@ -96,29 +93,10 @@ OGC_REQUEST_BACKOFF_FACTOR=0.3
9693
OGC_REQUEST_POOL_MAXSIZE=10
9794
OGC_REQUEST_POOL_CONNECTIONS=10
9895

99-
# GIS Client
100-
GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY=mapstore
101-
MAPBOX_ACCESS_TOKEN=
102-
BING_API_KEY=
103-
GOOGLE_API_KEY=
104-
105-
# Monitoring
106-
MONITORING_ENABLED=True
107-
MONITORING_DATA_TTL=365
108-
USER_ANALYTICS_ENABLED=True
109-
USER_ANALYTICS_GZIP=True
110-
CENTRALIZED_DASHBOARD_ENABLED=False
111-
MONITORING_SERVICE_NAME=local-geonode
112-
MONITORING_HOST_NAME=geonode
113-
114-
# Other Options/Contribs
115-
MODIFY_TOPICCATEGORY=True
116-
AVATAR_GRAVATAR_SSL=True
117-
AVATAR_DEFAULT_URL=/geonode/img/avatar.png
118-
119-
EXIF_ENABLED=True
120-
CREATE_LAYER=True
121-
FAVORITE_ENABLED=True
96+
# Java Options & Memory
97+
ENABLE_JSONP=true
98+
outFormat=text/javascript
99+
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"
122100

123101
# #################
124102
# Security
@@ -166,3 +144,51 @@ OAUTH2_CLIENT_SECRET=rCnp5txobUo83EpQEblM8fVj3QT5zb5qRfxNsuPzCqZaiRyIoxM4jdgMiZK
166144
# GeoNode APIs
167145
API_LOCKDOWN=False
168146
TASTYPIE_APIKEY=
147+
148+
# #################
149+
# Production and
150+
# Monitoring
151+
# #################
152+
DEBUG=False
153+
154+
SECRET_KEY='myv-y4#7j-d*p-__@j#*3z@!y24fz8%^z2v6atuy4bo9vqr1_a'
155+
156+
STATIC_ROOT=/mnt/volumes/statics/static/
157+
MEDIA_ROOT=/mnt/volumes/statics/uploaded/
158+
GEOIP_PATH=/mnt/volumes/statics/geoip.db
159+
160+
CACHE_BUSTING_STATIC_ENABLED=False
161+
CACHE_BUSTING_MEDIA_ENABLED=False
162+
163+
MEMCACHED_ENABLED=False
164+
MEMCACHED_BACKEND=django.core.cache.backends.memcached.MemcachedCache
165+
MEMCACHED_LOCATION=127.0.0.1:11211
166+
MEMCACHED_LOCK_EXPIRE=3600
167+
MEMCACHED_LOCK_TIMEOUT=10
168+
169+
MAX_DOCUMENT_SIZE=2
170+
CLIENT_RESULTS_LIMIT=5
171+
API_LIMIT_PER_PAGE=1000
172+
173+
# GIS Client
174+
GEONODE_CLIENT_LAYER_PREVIEW_LIBRARY=mapstore
175+
MAPBOX_ACCESS_TOKEN=
176+
BING_API_KEY=
177+
GOOGLE_API_KEY=
178+
179+
# Monitoring
180+
MONITORING_ENABLED=True
181+
MONITORING_DATA_TTL=365
182+
USER_ANALYTICS_ENABLED=True
183+
USER_ANALYTICS_GZIP=True
184+
CENTRALIZED_DASHBOARD_ENABLED=False
185+
MONITORING_SERVICE_NAME=local-geonode
186+
MONITORING_HOST_NAME=geonode
187+
188+
# Other Options/Contribs
189+
MODIFY_TOPICCATEGORY=True
190+
AVATAR_GRAVATAR_SSL=True
191+
EXIF_ENABLED=True
192+
CREATE_LAYER=True
193+
FAVORITE_ENABLED=True
194+

Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ RUN chmod +x /usr/bin/celery-commands
6464
COPY celery-cmd /usr/bin/celery-cmd
6565
RUN chmod +x /usr/bin/celery-cmd
6666

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

7373
RUN pip install --upgrade --no-cache-dir --src /usr/src -r requirements.txt
7474
RUN pip install --upgrade -e .

entrypoint.sh

+28-37
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
# Exit script in case of error
44
set -e
55

6+
INVOKE_LOG_STDOUT=${INVOKE_LOG_STDOUT:-FALSE}
7+
invoke () {
8+
if [ $INVOKE_LOG_STDOUT = 'true' ] || [ $INVOKE_LOG_STDOUT = 'True' ]
9+
then
10+
/usr/local/bin/invoke $@
11+
else
12+
/usr/local/bin/invoke $@ > /usr/src/geonode/invoke.log 2>&1
13+
fi
14+
echo "$@ tasks done"
15+
}
16+
617
# Start cron && memcached services
718
service cron restart
819
service memcached restart
@@ -12,7 +23,7 @@ echo "-----------------------------------------------------"
1223
echo "STARTING DJANGO ENTRYPOINT $(date)"
1324
echo "-----------------------------------------------------"
1425

15-
/usr/local/bin/invoke update > /usr/src/geonode/invoke.log 2>&1
26+
invoke update
1627

1728
source $HOME/.bashrc
1829
source $HOME/.override_env
@@ -30,8 +41,7 @@ echo MONITORING_HOST_NAME=$MONITORING_HOST_NAME
3041
echo MONITORING_SERVICE_NAME=$MONITORING_SERVICE_NAME
3142
echo MONITORING_DATA_TTL=$MONITORING_DATA_TTL
3243

33-
/usr/local/bin/invoke waitfordbs > /usr/src/geonode/invoke.log 2>&1
34-
echo "waitfordbs task done"
44+
invoke waitfordbs
3545

3646
cmd="$@"
3747

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

43-
echo "running migrations"
44-
/usr/local/bin/invoke migrations > /usr/src/geonode/invoke.log 2>&1
45-
echo "migrations task done"
46-
/usr/local/bin/invoke prepare > /usr/src/geonode/invoke.log 2>&1
47-
echo "prepare task done"
48-
/usr/local/bin/invoke fixtures > /usr/src/geonode/invoke.log 2>&1
49-
echo "fixture task done"
53+
invoke migrations
54+
invoke prepare
55+
invoke fixtures
5056

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

5662
else
5763

58-
echo "install requirements for development"
59-
/usr/local/bin/invoke devrequirements > /usr/src/geonode/invoke.log 2>&1
60-
echo "refresh static data"
61-
/usr/local/bin/invoke statics > /usr/src/geonode/invoke.log 2>&1
62-
echo "static data refreshed"
64+
invoke devrequirements
65+
invoke statics
6366

6467
echo "Executing standard Django server $cmd for Development"
6568

@@ -71,32 +74,20 @@ else
7174
echo "Executing Celery server $cmd for Production"
7275
else
7376

74-
echo "running migrations"
75-
/usr/local/bin/invoke migrations > /usr/src/geonode/invoke.log 2>&1
76-
echo "migrations task done"
77-
/usr/local/bin/invoke prepare > /usr/src/geonode/invoke.log 2>&1
78-
echo "prepare task done"
77+
invoke migrations
78+
invoke prepare
7979

8080
if [ ${FORCE_REINIT} = "true" ] || [ ${FORCE_REINIT} = "True" ] || [ ! -e "/mnt/volumes/statics/geonode_init.lock" ]; then
81-
/usr/local/bin/invoke updategeoip > /usr/src/geonode/invoke.log 2>&1
82-
echo "updategeoip task done"
83-
/usr/local/bin/invoke fixtures > /usr/src/geonode/invoke.log 2>&1
84-
echo "fixture task done"
85-
/usr/local/bin/invoke monitoringfixture > /usr/src/geonode/invoke.log 2>&1
86-
echo "monitoringfixture task done"
87-
/usr/local/bin/invoke initialized > /usr/src/geonode/invoke.log 2>&1
88-
echo "initialized"
81+
invoke updategeoip
82+
invoke fixtures
83+
invoke monitoringfixture
84+
invoke initialized
8985
fi
9086

91-
echo "refresh static data"
92-
/usr/local/bin/invoke statics > /usr/src/geonode/invoke.log 2>&1
93-
echo "static data refreshed"
94-
/usr/local/bin/invoke waitforgeoserver > /usr/src/geonode/invoke.log 2>&1
95-
echo "waitforgeoserver task done"
96-
/usr/local/bin/invoke geoserverfixture > /usr/src/geonode/invoke.log 2>&1
97-
echo "geoserverfixture task done"
98-
/usr/local/bin/invoke updateadmin > /usr/src/geonode/invoke.log 2>&1
99-
echo "updateadmin task done"
87+
invoke statics
88+
invoke waitforgeoserver
89+
invoke geoserverfixture
90+
invoke updateadmin
10091

10192
echo "Executing UWSGI server $cmd for Production"
10293
fi

geonode/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#########################################################################
32
#
43
# Copyright (C) 2016 OSGeo

0 commit comments

Comments
 (0)