Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into AH/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
haneslinger committed Dec 19, 2023
2 parents 384f43b + acd8337 commit b3c6784
Show file tree
Hide file tree
Showing 58 changed files with 1,167 additions and 754 deletions.
4 changes: 4 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"backend",
"backends",
"badpass",
"Baseload",
"basestring",
"bashrc",
"bedes",
Expand Down Expand Up @@ -202,6 +203,7 @@
"lokalize",
"lookup",
"lte",
"lxml",
"MapItem",
"mappable",
"mapquest",
Expand Down Expand Up @@ -234,6 +236,7 @@
"noqa",
"npm",
"nrows",
"nsmap",
"num",
"Octant",
"officedocument",
Expand Down Expand Up @@ -313,6 +316,7 @@
"serializer",
"serializers",
"servlet",
"Setpoints",
"setUp",
"setUpClass",
"sha",
Expand Down
62 changes: 60 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,63 @@
# SEED Version 2.21.0

<!-- Release notes generated using configuration in .github/release.yml at develop -->

## What's Changed
### New Features 🎉
* Provide environment variable to disable wait-for-it condition in deployments by @dhaley in https://github.com/SEED-platform/seed/pull/4377
* Add healthcheck to docker web container by @axelstudios in https://github.com/SEED-platform/seed/pull/4374
* Audit Template report submission endpoint by @kflemin in https://github.com/SEED-platform/seed/pull/4411
* Remove Summary charts by @haneslinger in https://github.com/SEED-platform/seed/pull/4402
* Add count to default reports by @haneslinger in https://github.com/SEED-platform/seed/pull/4423
### Improvements 📈
* Property Insights UI enhancements by @kflemin in https://github.com/SEED-platform/seed/pull/4384
* Add distance to target in table under property insights graph by @kflemin in https://github.com/SEED-platform/seed/pull/4386
* Populate default report using cycles by @haneslinger in https://github.com/SEED-platform/seed/pull/4420
* Analyses performance improvement by @haneslinger in https://github.com/SEED-platform/seed/pull/4434
* Additional analyses performance improvement by @haneslinger in https://github.com/SEED-platform/seed/pull/4438
### Maintenance 🧹
* Updated developer resources documentation by @axelstudios in https://github.com/SEED-platform/seed/pull/4373
* Bump django from 3.2.20 to 3.2.23 in /requirements by @dependabot in https://github.com/SEED-platform/seed/pull/4379
* Updated salesforce pg_restore docs by @axelstudios in https://github.com/SEED-platform/seed/pull/4382
### Bug Fixes 🐛
* Fix CO2 analysis column naming by @ebeers-png in https://github.com/SEED-platform/seed/pull/4410
* Salesforce scheduling issues by @axelstudios in https://github.com/SEED-platform/seed/pull/4387
* Custom report name field location by @kflemin in https://github.com/SEED-platform/seed/pull/4385
* Order cycles by start date on program setup by @kflemin in https://github.com/SEED-platform/seed/pull/4428
* Property Insights tooltip refinement by @kflemin in https://github.com/SEED-platform/seed/pull/4425


**Full Changelog**: https://github.com/SEED-platform/seed/compare/v2.20.1...v2.21.0

# SEED Version 2.20.1

<!-- Release notes generated using configuration in .github/release.yml at develop -->

## What's Changed
### New Features 🎉
* Feature to enable Redis for ElastiCache by @dhaley in https://github.com/SEED-platform/seed/pull/4288
* Health check endpoint by @axelstudios in https://github.com/SEED-platform/seed/pull/4371
### Improvements 📈
* Update dependencies and fonts by @axelstudios in https://github.com/SEED-platform/seed/pull/3941
* Update Redis config to support encryption in transit with AWS ElastiCache by @dhaley in https://github.com/SEED-platform/seed/pull/4258
* Decrease BETTER polling rate 5x, increase timeout 5x by @axelstudios in https://github.com/SEED-platform/seed/pull/4280
* Increase ESPM max timeout by @anchapin in https://github.com/SEED-platform/seed/pull/4296
* Update list of BETTER's measures returned by @nllong in https://github.com/SEED-platform/seed/pull/4300
### Maintenance 🧹
* Code Cleanup by @axelstudios in https://github.com/SEED-platform/seed/pull/3539
### Bug Fixes 🐛
* Fix mapping of BETTER's measures with empty strings to false by @nllong in https://github.com/SEED-platform/seed/pull/4276
* Enable natural sorting of Inventory List columns by @axelstudios in https://github.com/SEED-platform/seed/pull/4281
* Handle ambiguous timestamps by @axelstudios in https://github.com/SEED-platform/seed/pull/4287
* Fix cycle deletion modal by @axelstudios in https://github.com/SEED-platform/seed/pull/4291
* Handle nonexistent timestamps by @axelstudios in https://github.com/SEED-platform/seed/pull/4294
* Add failing logic to AT export if AT credentials are invalid by @perryr16 in https://github.com/SEED-platform/seed/pull/4282
* Add analysis description translations by @kflemin in https://github.com/SEED-platform/seed/pull/4304
* Fix showing derived column values on the inventory list page by @axelstudios in https://github.com/SEED-platform/seed/pull/4364


**Full Changelog**: https://github.com/SEED-platform/seed/compare/v2.20.0...v2.20.1

# SEED Version 2.20.0

<!-- Release notes generated using configuration in .github/release.yml at develop -->
Expand Down Expand Up @@ -64,8 +124,6 @@
* Include x and y in property insights tables by @haneslinger in https://github.com/SEED-platform/seed/pull/4075
* Add percentages to program overview by @haneslinger in https://github.com/SEED-platform/seed/pull/4077
* Add matching criteria to report export by @haneslinger in https://github.com/SEED-platform/seed/pull/4072
* Default to excluding Address Line 1 as a matching criteria by @axelstudios in https://github.com/SEED-platform/seed/pull/4256
* Refactor map page for functionality and performance by @axelstudios in https://github.com/SEED-platform/seed/pull/4260
### Maintenance 🧹
* Bump django from 3.2.18 to 3.2.19 in /requirements by @dependabot in https://github.com/SEED-platform/seed/pull/4034
* Improve inventory load times by @ebeers-png in https://github.com/SEED-platform/seed/pull/3990
Expand Down
21 changes: 13 additions & 8 deletions config/settings/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,20 @@
if not locals().get(loc):
raise Exception("%s Not defined as env variables" % loc)

DEBUG = False
DEBUG = os.environ.get('Debug', False)
COMPRESS_ENABLED = False
# COMPRESS_STORAGE = 'compressor.storage.GzipCompressorFileStorage'
# COMPRESS_OFFLINE = True

# Make sure to disable secure cookies and csrf when using Cloudflare
SESSION_COOKIE_SECURE = False
CSRF_COOKIE_SECURE = False
SESSION_COOKIE_SECURE = os.environ.get('SESSION_COOKIE_SECURE', False)
CSRF_COOKIE_SECURE = os.environ.get('CSRF_COOKIE_SECURE', False)

ALLOWED_HOSTS = ['*']
ALLOWED_HOSTS_ENV = os.environ.get('ALLOWED_HOSTS')
if ALLOWED_HOSTS_ENV:
ALLOWED_HOSTS = ALLOWED_HOSTS_ENV.split(',')
else:
ALLOWED_HOSTS = ['*']

# By default we are using SES as our email client. If you would like to use
# another backend (e.g., SMTP), then please update this model to support both and
Expand Down Expand Up @@ -80,14 +84,15 @@
'OPTIONS': {
'DB': 1,
"CLIENT_CLASS": "django_redis.client.DefaultClient",
'PASSWORD': os.environ.get('REDIS_PASSWORD')
'PASSWORD': os.environ.get('REDIS_PASSWORD'),
"SSL": True # If your AWS Elasticache is set up for SSL, set this to True
},
'TIMEOUT': 300
}
}
CELERY_BROKER_URL = 'rediss://:%s@%s/%s' % (
CELERY_BROKER_URL = 'rediss://:%s@%s:6379/%s?ssl_cert_reqs=required' % (
CACHES['default']['OPTIONS']['PASSWORD'],
CACHES['default']['LOCATION'],
os.environ.get('REDIS_HOST'),
CACHES['default']['OPTIONS']['DB']
)
elif 'REDIS_PASSWORD' in os.environ:
Expand Down Expand Up @@ -145,7 +150,7 @@
'loggers': {
'django': {
'handlers': ['console'],
'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG'),
'level': os.getenv('DJANGO_LOG_LEVEL', 'ERROR'),
},
},
}
Expand Down
3 changes: 2 additions & 1 deletion config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
password_reset_confirm,
password_reset_done
)
from seed.views.main import angular_js_tests, version
from seed.views.main import angular_js_tests, health_check, version

schema_view = get_schema_view(
openapi.Info(
Expand Down Expand Up @@ -63,6 +63,7 @@ def trigger_error(request):
re_path(r'^robots\.txt', robots_txt, name='robots_txt'),

# API
re_path(r'^api/health_check/$', health_check, name='health_check'),
re_path(r'^api/swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
re_path(r'^api/version/$', version, name='version'),
re_path(r'^api/', include((api, "seed"), namespace='api')),
Expand Down
1 change: 1 addition & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
environment:
- DJANGO_SETTINGS_MODULE=config.settings.docker_dev
- DJANGO_LOG_LEVEL
- EEEJ_LOAD_SMALL_TEST_DATASET=True
volumes:
- ref_seed_media:/seed/media
- ./seed/:/seed/seed/
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ services:
- seed_media:/seed/media
ports:
- "80:80"
healthcheck:
test: curl -f http://localhost/api/health_check/ || exit 1
interval: 1m
timeout: 10s
retries: 1
start_period: 45s
logging:
options:
max-size: 50m
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ services:
- seed_media:/seed/media
ports:
- "80:80"
healthcheck:
test: curl -f http://localhost/api/health_check/ || exit 1
interval: 1m
timeout: 10s
retries: 1
start_period: 45s
logging:
options:
max-size: 50m
Expand Down
56 changes: 28 additions & 28 deletions docker/start_celery_docker.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
#!/bin/bash

cd /seed

echo "Waiting for postgres to start"
if [ -v POSTGRES_HOST ];
then
POSTGRES_ACTUAL_HOST=$POSTGRES_HOST
# Check if 'DISABLE_SERVICE_CHECKS_ON_START' is not set or if its value is 'TRUE'
if [[ "${DISABLE_SERVICE_CHECKS_ON_START}" == "on" ]]; then
echo "'DISABLE_SERVICE_CHECKS_ON_START' is set and equal to 'on'. Skipping wait-for-it.sh execution."
else
POSTGRES_ACTUAL_HOST=db-postgres
cd /seed

echo "Waiting for postgres to start"
if [ -v POSTGRES_HOST ]; then
POSTGRES_ACTUAL_HOST=$POSTGRES_HOST
else
POSTGRES_ACTUAL_HOST=db-postgres
fi
/usr/local/wait-for-it.sh --strict -t 0 $POSTGRES_ACTUAL_HOST:$POSTGRES_PORT

echo "Waiting for redis to start"
if [ -v REDIS_HOST ]; then
REDIS_ACTUAL_HOST=$REDIS_HOST
else
REDIS_ACTUAL_HOST=db-redis
fi
/usr/local/wait-for-it.sh --strict -t 0 $REDIS_ACTUAL_HOST:6379

echo "Waiting for web to start"
if [ -v WEB_HOST ]; then
WEB_ACTUAL_HOST=$WEB_HOST
else
WEB_ACTUAL_HOST=web
fi
/usr/local/wait-for-it.sh --strict -t 0 $WEB_ACTUAL_HOST:80
fi
/usr/local/wait-for-it.sh --strict -t 0 $POSTGRES_ACTUAL_HOST:$POSTGRES_PORT

echo "Waiting for redis to start"
if [ -v REDIS_HOST ];
then
REDIS_ACTUAL_HOST=$REDIS_HOST
else
REDIS_ACTUAL_HOST=db-redis
fi

/usr/local/wait-for-it.sh --strict -t 0 $REDIS_ACTUAL_HOST:6379

echo "Waiting for web to start"
if [ -v WEB_HOST ];
then
WEB_ACTUAL_HOST=$WEB_HOST
else
WEB_ACTUAL_HOST=web
fi

/usr/local/wait-for-it.sh --strict -t 0 $WEB_ACTUAL_HOST:80

# check if the number of workers is set in the env
if [ -z ${NUMBER_OF_WORKERS} ]; then
Expand Down
37 changes: 21 additions & 16 deletions docker/start_uwsgi_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@

cd /seed

echo "Waiting for postgres to start"
if [ -v POSTGRES_HOST ];
then
POSTGRES_ACTUAL_HOST=$POSTGRES_HOST
# Check if 'DISABLE_SERVICE_CHECKS_ON_START' is not set or if its value is 'TRUE'
if [[ "${DISABLE_SERVICE_CHECKS_ON_START}" == "on" ]]; then
echo "'DISABLE_SERVICE_CHECKS_ON_START' is set and equal to 'on'. Skipping wait-for-it.sh execution."
else
POSTGRES_ACTUAL_HOST=db-postgres
cd /seed

echo "Waiting for postgres to start"
if [ -v POSTGRES_HOST ]; then
POSTGRES_ACTUAL_HOST=$POSTGRES_HOST
else
POSTGRES_ACTUAL_HOST=db-postgres
fi
/usr/local/wait-for-it.sh --strict $POSTGRES_ACTUAL_HOST:$POSTGRES_PORT

echo "Waiting for redis to start"
if [ -v REDIS_HOST ]; then
REDIS_ACTUAL_HOST=$REDIS_HOST
else
REDIS_ACTUAL_HOST=db-redis
fi

/usr/local/wait-for-it.sh --strict $REDIS_ACTUAL_HOST:6379
fi
/usr/local/wait-for-it.sh --strict $POSTGRES_ACTUAL_HOST:$POSTGRES_PORT

echo "Waiting for redis to start"
if [ -v REDIS_HOST ];
then
REDIS_ACTUAL_HOST=$REDIS_HOST
else
REDIS_ACTUAL_HOST=db-redis
fi

/usr/local/wait-for-it.sh --strict $REDIS_ACTUAL_HOST:6379

# collect static resources before starting and compress the assets
./manage.py collectstatic --no-input -i package.json -i npm-shrinkwrap.json -i node_modules/openlayers-ext/index.html
Expand Down
Loading

0 comments on commit b3c6784

Please sign in to comment.