Skip to content
This repository has been archived by the owner. It is now read-only.

Add setup script for FeatureService DB #38

Merged
merged 3 commits into from Jun 30, 2017

Conversation

Projects
None yet
3 participants
@c-w
Copy link
Member

commented Jun 30, 2017

This pull request adds a script that sets up a copy of the feature-service database as part of the deployment. First, we create an Azure-hosted Postgres instance. Then we populate the database from a dump of Tim's master database that is hosted on our central Fortis Azure Blob Storage.

To test the script, you need to change the pg_dump variable to the test database dump as I haven't written the script to dump the master database yet.

This is the first required piece to implementing project-fortis#39. The next steps will include writing the script to dump the master database and setting up the featureService repository via deis.

@c-w c-w requested a review from erikschlegel Jun 30, 2017

@c-w c-w added the in progress label Jun 30, 2017

@jcjimenez
Copy link
Contributor

left a comment

LGTM

if ! (command -v jq >/dev/null); then sudo apt-get install -y jq; fi
if ! (command -v psql >/dev/null); then sudo apt-get install -y postgresql postgresql-contrib; fi

echo "!!!! Postgres password for ${pg_admin} set to '${pg_password}' !!!!"

This comment has been minimized.

Copy link
@jcjimenez

jcjimenez Jun 30, 2017

Contributor

Should we remove this echo statement in case this ends up in an unprotected log file?

This comment has been minimized.

Copy link
@c-w

c-w Jun 30, 2017

Author Member

I think we need a way to communicate the password to the user in case they wish to connect to their DB and unfortunately the Azure UI does not expose the password. The alternative would be to ask the user to provide a password but that will likely lead to weak passwords. Thoughts?

This comment has been minimized.

Copy link
@erikschlegel

erikschlegel Jun 30, 2017

Contributor

I'd just generate a password guid in the deployment script which we'd propagate in the kubernetes ConfigMap

This comment has been minimized.

Copy link
@c-w

c-w Jun 30, 2017

Author Member

Moved the password to deis in fce2a39.

readonly location="$1"
readonly resource_group="$2"

readonly pg_dump="https://fortiscentral.blob.core.windows.net/locations/feature-service.v1.sql.gz"

This comment has been minimized.

Copy link
@jcjimenez

jcjimenez Jun 30, 2017

Contributor

+1 on that v1 - thanks!

@c-w c-w force-pushed the install-feature-service-db branch 2 times, most recently from e9ab6da to 1412bd6 Jun 30, 2017

@erikschlegel
Copy link
Contributor

left a comment

LGTM

c-w added some commits Jun 30, 2017

Download database dump locally
This avoids potential issues with long-running pipes and http
connections.
Avoid printing password to console
Instead, set it in the deis config.

@c-w c-w force-pushed the install-feature-service-db branch from 1412bd6 to 31b2b83 Jun 30, 2017

@c-w c-w merged commit 8169c46 into master Jun 30, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@c-w c-w deleted the install-feature-service-db branch Jun 30, 2017

@c-w c-w removed the in progress label Jun 30, 2017

rachelnicole pushed a commit that referenced this pull request Jan 24, 2018

rachelnicole pushed a commit that referenced this pull request Jan 24, 2018

Merge pull request #38 from CatalystCode/edges-resolver
Implement EdgesSchema.{terms,locations}

rachelnicole pushed a commit that referenced this pull request Jan 24, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.