Skip to content

Commit

Permalink
Merge pull request #2990 from SEED-platform/develop
Browse files Browse the repository at this point in the history
Release: 2.12.2
  • Loading branch information
macintoshpie committed Nov 4, 2021
2 parents f0509c1 + 49ccf7b commit 6a31f3d
Show file tree
Hide file tree
Showing 89 changed files with 19,532 additions and 809 deletions.
1 change: 1 addition & 0 deletions .github/workflows/stale.yml
Expand Up @@ -14,3 +14,4 @@ jobs:
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity within 60 days. It will be closed if no further activity occurs. Thank you for your contributions.'
close-issue-message: 'This issue has been closed automatically. If this still affects you please re-open this issue with a comment or contact us so we can look into resolving it.'
exempt-issue-labels: 'P-1,Impact-1'
operations-per-run: 500
47 changes: 47 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,50 @@
# SEED Version 2.12.2

Date Range: 09/28/21 - 11/04/21

Closed Issues and Features (Total: 36):
- Feature [#2524]( https://github.com/SEED-platform/seed/issues/2524 ), Export CSV -- Need a status bar or spinner or something to indicate that program is still working
- Feature [#2557]( https://github.com/SEED-platform/seed/issues/2557 ), Create Analyses Section
- Fixed [#2587]( https://github.com/SEED-platform/seed/issues/2587 ), Add admin tools
- Fixed [#2651]( https://github.com/SEED-platform/seed/issues/2651 ), Analysis and Merge/Link Matches on Property Detail view on production server (and shouldn't be)
- Fixed [#2751]( https://github.com/SEED-platform/seed/issues/2751 ), Update EKS Kubernetes version to 1.18
- Maintenance [#2787]( https://github.com/SEED-platform/seed/issues/2787 ), Move to BETTER Production API
- Fixed [#2810]( https://github.com/SEED-platform/seed/issues/2810 ), Bug: check meters tab on spreadsheet is broken
- Fixed [#2830]( https://github.com/SEED-platform/seed/issues/2830 ), Write tests for updated Audit Template import
- Feature [#2840]( https://github.com/SEED-platform/seed/issues/2840 ), BETTER - show which records had 0 savings in the Analyses view
- Fixed [#2871]( https://github.com/SEED-platform/seed/issues/2871 ), Analysis detail page trying to fetch bad pages
- Feature [#2872]( https://github.com/SEED-platform/seed/issues/2872 ), Create eGRID emissions analysis
- Fixed [#2877]( https://github.com/SEED-platform/seed/issues/2877 ), Tweak EUI Analysis
- Fixed [#2884]( https://github.com/SEED-platform/seed/issues/2884 ), Remove usage of address line 1 in BETTER analysis
- Fixed [#2886]( https://github.com/SEED-platform/seed/issues/2886 ), Update values parsed from BETTER analysis
- Fixed [#2898]( https://github.com/SEED-platform/seed/issues/2898 ), Update "contact us" mailto for the maintenance page
- Fixed [#2899]( https://github.com/SEED-platform/seed/issues/2899 ), v2.11 fails to load page after login
- Maintenance [#2908]( https://github.com/SEED-platform/seed/issues/2908 ), Bump BETTER BSync version to v2.3
- Fixed [#2913]( https://github.com/SEED-platform/seed/issues/2913 ), After importing Meter Data, program shows the previous Mapping screen
- Fixed [#2917]( https://github.com/SEED-platform/seed/issues/2917 ), BETTER: fails to create Buildings (too many meters?)
- Feature [#2921]( https://github.com/SEED-platform/seed/issues/2921 ), Analyses: Add a Creation Date to analyses
- Fixed [#2924]( https://github.com/SEED-platform/seed/issues/2924 ), [10-14-2021] Update staging:
- Fixed [#2925]( https://github.com/SEED-platform/seed/issues/2925 ), update priority spreadsheet
- Fixed [#2926]( https://github.com/SEED-platform/seed/issues/2926 ), move remaining BETTER tasks from spreadsheet into tickets
- Fixed [#2928]( https://github.com/SEED-platform/seed/issues/2928 ), BETTER: display building report above portfolio report
- Fixed [#2929]( https://github.com/SEED-platform/seed/issues/2929 ), BuildingSync: improve UI/UX for initial validation
- Fixed [#2936]( https://github.com/SEED-platform/seed/issues/2936 ), Remove old members from LBL AWS
- Fixed [#2938]( https://github.com/SEED-platform/seed/issues/2938 ), BuildingSync: add v2.4 to SEED
- Fixed [#2944]( https://github.com/SEED-platform/seed/issues/2944 ), release: v2.12.1 patch -- fix reset password url
- Fixed [#2956]( https://github.com/SEED-platform/seed/issues/2956 ), EKS RBAC Roles
- Fixed [#2961]( https://github.com/SEED-platform/seed/issues/2961 ), BuildingSync: ignore scenarios without meters or measures
- Fixed [#2963]( https://github.com/SEED-platform/seed/issues/2963 ), Columns: create eGRID Subregion Code column
- Fixed [#2965]( https://github.com/SEED-platform/seed/issues/2965 ), Add database/mediafiles backup to dev1
- Fixed [#2969]( https://github.com/SEED-platform/seed/issues/2969 ), Analysis: use organization's "Property Display Field" in analysis tables
- Fixed [#2987]( https://github.com/SEED-platform/seed/issues/2987 ), Analysis: indicate analysis functionality is BETA

# SEED Version 2.12.1

Minor patch to fix resetting passwords.

Closed Issues:
- Fixed [#2941]( https://github.com/SEED-platform/seed/issues/2941 ), Password reset error

# SEED Version 2.12.0

Date Range: 06/22/21 - 09/27/21
Expand Down
51 changes: 2 additions & 49 deletions charts/README.md
@@ -1,52 +1,5 @@
## Deploy on Kubernetes
### Note: this deployment requires an existing Amazon EKS cluster

Download and configure the AWS CLI with instructions [here](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html)
```
aws configure
AWS Access Key ID [None]: <insert key> (from account)
AWS Secret Access Key [None]: <insert secret key> (from account)
Default region name [None]: us-east-1
Default output format [None]: json
```
_Note: this deployment requires an existing Amazon EKS cluster. Instructions below show how to create the cluster, but many configurations options are available and show be reviewed._

Download Kubectl:

- [Windows](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-windows)
- Mac
```
brew install kubectl
```

Download Helm:
- [Windows](https://github.com/helm/helm/releases)
- Mac
```
brew install helm
```

### For a new deployment
From the charts directory:
```
helm install --generate-name persistentvolumes
helm install --generate-name seed
```

Configure kubeconfig
```
aws eks --region us-east-1 update-kubeconfig --name seed
```

View the deployments and services
```
kubectl get all
```

### For an existing deployment
Update the web container
```
kubectl delete pod/web-<assigned-hash>
```
Note: the service will restart the pod and re-pull the image

Common kubectl actions can be found [here](https://kubernetes.io/docs/reference/kubectl/cheatsheet/)
See the instructions in [k8s deployment](../docs/source/kubernetes_deployment.rst) or in the [readthedocs](https://seed-platform.readthedocs.io/en/stable/kubernetes_deployment.html). The instructions in readthedocs may be slightly behind the other documentation.
4 changes: 3 additions & 1 deletion charts/seed/templates/db-postgres-deployment.yaml
Expand Up @@ -34,6 +34,8 @@ spec:
value: super-secret-password
- name: POSTGRES_USER
value: seeduser
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
image: timescale/timescaledb-postgis:latest-pg12
imagePullPolicy: Always
name: db-postrgres
Expand All @@ -50,7 +52,7 @@ spec:
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/lib/postgresql/data
- mountPath: /var/lib/postgresql/data/db-files
name: seed-pgdata
- mountPath: /seed-backups/backups
name: seed-backups
Expand Down
121 changes: 63 additions & 58 deletions charts/seed/templates/web-deployment.yaml
Expand Up @@ -27,68 +27,73 @@ spec:
io.kompose.service: web
spec:
containers:
- env:
- name: AWS_ACCESS_KEY_ID
value: AKIAJOAFWCAB5FZA5FBA
- name: AWS_SECRET_ACCESS_KEY
value: <secret_access_key>
- name: AWS_SES_REGION_NAME
value: us-west-2
- name: AWS_SES_REGION_ENDPOINT
value: email.us-west-2.amazonaws.com
- name: SERVER_EMAIL
value: info@seed-platform.org
- name: DJANGO_SETTINGS_MODULE
value: config.settings.docker
- name: POSTGRES_DB
value: seed
- name: POSTGRES_PASSWORD
value: super-secret-password
- name: POSTGRES_PORT
value: "5432"
- name: POSTGRES_USER
value: seeduser
- name: SECRET_KEY
value: <secret>
- name: SEED_ADMIN_ORG
value: default
- name: SEED_ADMIN_PASSWORD
value: super-secret-password
- name: SEED_ADMIN_USER
value: user@seed-platform.org
- name: BSYNCR_SERVER_PORT
value: "5000"
- name: BSYNCR_SERVER_HOST
value: bsyncr
- name: BETTER_HOST
value: https://better-lbnl-development.herokuapp.com
- name: SENTRY_JS_DSN
value: <enter-dsn>
- name: SENTRY_RAVEN_DSN
value: <enter-dsn>
- name: GOOGLE_RECAPTCHA_SECRET_KEY
value: <reCAPTCHA-key>
- name: INCLUDE_SEED_V2_APIS
value: TRUE
image: seedplatform/seed:develop
imagePullPolicy: Always
name: web
ports:
- containerPort: 80
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /seed/media
name: seed-media
- env:
- name: AWS_ACCESS_KEY_ID
value: <aws_access_key>
- name: AWS_SECRET_ACCESS_KEY
value: <secret_access_key>
- name: AWS_SES_REGION_NAME
value: us-west-2
- name: AWS_SES_REGION_ENDPOINT
value: email.us-west-2.amazonaws.com
- name: SERVER_EMAIL
value: info@seed-platform.org
- name: DJANGO_SETTINGS_MODULE
value: config.settings.docker
- name: POSTGRES_DB
value: seed
- name: POSTGRES_PASSWORD
value: super-secret-password
- name: POSTGRES_PORT
value: "5432"
- name: POSTGRES_USER
value: seeduser
- name: SECRET_KEY
# secret key generator -- https://djskgen.herokuapp.com
value: <secret>
- name: SEED_ADMIN_ORG
value: default
- name: SEED_ADMIN_PASSWORD
value: super-secret-password
- name: SEED_ADMIN_USER
value: user@seed-platform.org
- name: BSYNCR_SERVER_PORT
value: "5000"
- name: BSYNCR_SERVER_HOST
value: bsyncr
- name: BETTER_HOST
value: https://better-lbnl-development.herokuapp.com
- name: SENTRY_JS_DSN
value: <enter-dsn>
- name: SENTRY_RAVEN_DSN
value: <enter-dsn>
- name: GOOGLE_RECAPTCHA_SITE_KEY
value: <reCAPTCHA-site-key>
- name: GOOGLE_RECAPTCHA_SECRET_KEY
value: <reCAPTCHA-secret-key>
- name: INCLUDE_SEED_V2_APIS
value: "TRUE"
- name: INCLUDE_ACCT_REG
value: "TRUE"
image: seedplatform/seed:develop
imagePullPolicy: Always
name: web
ports:
- containerPort: 80
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /seed/media
name: seed-media
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- name: seed-media
persistentVolumeClaim:
claimName: seed-media
- name: seed-media
persistentVolumeClaim:
claimName: seed-media
status: {}
9 changes: 4 additions & 5 deletions config/urls.py
Expand Up @@ -6,6 +6,7 @@
"""
from django.conf import settings
from django.conf.urls import include, url
from django.urls import path
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

Expand Down Expand Up @@ -38,14 +39,12 @@
password_reset_complete,
name='password_reset_complete',
),
url(
(
r'^accounts/password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/'
'(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$'
),
path(
'accounts/password/reset/confirm/<uidb64>/<token>/',
password_reset_confirm,
name='password_reset_confirm'
),

# Application
url(r'^', include(('seed.landing.urls', "seed.landing"), namespace="landing")),
url(r'^app/', include(('seed.urls', "seed"), namespace="seed")),
Expand Down
39 changes: 39 additions & 0 deletions docker/backup_k8s/Dockerfile
@@ -0,0 +1,39 @@
# Author: Nicholas Long
#
# This docker container is used to create a backup of the seed database and
# mediafiles, then push the backups to S3. The script itself is the backup_database.sh
# script that is copied into this container for use by helm/k8s batch/CronJob.

# docker build -t seedplatform/seed-backup-k8s .
# docker push seedplatform/seed-backup-k8s:latest

FROM ubuntu:20.04

# Keys to access the s3 backups
ENV AWS_ACCESS_KEY_ID ""
ENV AWS_SECRET_ACCESS_KEY ""
ENV AWS_DEFAULT_REGION ""
ENV S3_BUCKET_NAME ""

# Run the Update and install k8s key
RUN apt update && \
apt upgrade -y && \
apt install -y \
python3 \
curl \
apt-transport-https \
ca-certificates \
gnupg \
python3-pip && \
ln -s /usr/bin/python3 /usr/bin/python && \
pip install --upgrade pip && \
pip install awscli && \
# install postgres client for pg_dump for backup - SEED is currently on pg12
# This is hardcoded with the ubuntu 20 (focal) release.
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
apt update && \
apt install -y postgresql-client-12

WORKDIR /app
ADD backup_database.sh /app/

0 comments on commit 6a31f3d

Please sign in to comment.