Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade development environment to PostgreSQL 9.6 #3147

Merged
merged 1 commit into from Aug 22, 2019

Conversation

@hectcastro
Copy link
Contributor

hectcastro commented Aug 15, 2019

Overview

In addition to adding support for PostgreSQL 9.6, upgrade PostGIS to 2.3, which coincides with the version utilized by RDS in staging and production.

Lastly, the project specific init script for PostgreSQL was removed because it only existed to emit a postgresql-started event for the pgweb service configuration to subscribe to.

Fixes #3045

Testing Instructions

  • To avoid mixing up state between the PostgreSQL 9.4 and 9.6 installations, I recreated all of the project virtual machines from scratch. The app, tiler, and worker virtual machines should be recreated in addition to the services virtual machine because they install PostgreSQL client libraries too.
$ vagrant destroy -f
$ vagrant up
  • Next, apply migrations and load some of the boundary data:
$ ./scripts/manage.sh migrate
$ vagrant ssh app
vagrant@app:~$ cd /vagrant/scripts/aws/
vagrant@app:/vagrant/scripts/aws$ ./setupdb.sh ...
  • Test the application, the tile service, and background jobs to ensure that database connectivity works
  • Lastly, validate the versions of PostgreSQL and PostGIS
$ vagrant ssh services
$ sudo su postgres
postgres@services:/home/vagrant$ psql
psql (9.6.15)
Type "help" for help.

postgres=# \c mmw
You are now connected to database "mmw" as user "postgres".
mmw=# select version();
                                                                     version
-------------------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 9.6.15 on x86_64-pc-linux-gnu (Ubuntu 9.6.15-1.pgdg16.04+1), compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609, 64-bit
(1 row)

mmw=# select postgis_version();
            postgis_version
---------------------------------------
 2.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
(1 row)
In addition to adding support for PostgreSQL 9.6, upgrade PostGIS to
2.3, which coincides with the version utilized by RDS in staging and
production.

Lastly, the project specific init script for PostgreSQL was removed
because it only existed to emit a `postgresql-started` event for the
`pgweb` service configuration to subscribe to.
@hectcastro hectcastro requested a review from rbreslow Aug 15, 2019
postgresql_support_repository_channel: "main"
postgresql_support_libpq_version: "11.*.pgdg16.04+1"
postgresql_support_psycopg2_version: "2.7"
postgis_version: "2.2"
postgis_package_version: "2.2.*.pgdg16.04+1"
postgis_version: "2.3"

This comment has been minimized.

Copy link
@hectcastro

hectcastro Aug 15, 2019

Author Contributor

PostGIS version 2.3.x is used by PostgreSQL 9.6 on Amazon RDS.

@@ -1,11 +1,4 @@
---
- name: Configure PostgreSQL service definition

This comment has been minimized.

Copy link
@hectcastro

hectcastro Aug 15, 2019

Author Contributor

This template is no longer necessary because we don't need to emit a custom Upstart event for other services to subscribe to.

@@ -100,7 +100,7 @@ def get_env_setting(setting):
}

POSTGIS_VERSION = tuple(
map(int, environ.get('DJANGO_POSTGIS_VERSION', '2.1.3').split("."))
map(int, environ.get('DJANGO_POSTGIS_VERSION', '2.3.7').split("."))

This comment has been minimized.

Copy link
@hectcastro

hectcastro Aug 15, 2019

Author Contributor

Defaulted to the exact version provided by Amazon RDS on PostgreSQL 9.6.

See: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html

@hectcastro hectcastro requested review from rajadain and removed request for rbreslow Aug 19, 2019
@rajadain rajadain self-assigned this Aug 19, 2019
@rajadain

This comment has been minimized.

Copy link
Member

rajadain commented Aug 19, 2019

Since reviewing this requires destroying my VMs, I'll take a look at this in the later half of the day.

Copy link
Member

rajadain left a comment

+1 tested. This is working well. I ran migrations, imported all the tables, ran MapShed, created accounts, and ran tests. Everything is A-Okay 👍

@rajadain rajadain assigned hectcastro and unassigned rajadain Aug 20, 2019
@hectcastro

This comment has been minimized.

Copy link
Contributor Author

hectcastro commented Aug 20, 2019

Thanks for the assist, Terence.

@hectcastro hectcastro merged commit 277e866 into develop Aug 22, 2019
2 checks passed
2 checks passed
default Build finished.
Details
model-my-watershed-pull-requests Build #4086 succeeded in 44 min
Details
@hectcastro hectcastro deleted the feature/hmc/upgrade-to-postgresql-9.6 branch Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.