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
Merged

Add setup script for FeatureService DB #38

merged 3 commits into from Jun 30, 2017

Conversation

@c-w
Copy link
Contributor

@c-w c-w 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
Copy link
Contributor

@jcjimenez jcjimenez 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}' !!!!"
Copy link
Contributor

@jcjimenez jcjimenez Jun 30, 2017

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

Copy link
Contributor Author

@c-w c-w Jun 30, 2017

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?

Copy link
Contributor

@erikschlegel erikschlegel Jun 30, 2017

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

Copy link
Contributor Author

@c-w c-w Jun 30, 2017

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"
Copy link
Contributor

@jcjimenez jcjimenez Jun 30, 2017

+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
Copy link
Contributor

@erikschlegel erikschlegel left a comment

LGTM

c-w added 3 commits Jun 30, 2017
This avoids potential issues with long-running pipes and http
connections.
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
@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 issue Jan 24, 2018
rachelnicole pushed a commit that referenced this issue Jan 24, 2018
Implement EdgesSchema.{terms,locations}
rachelnicole pushed a commit that referenced this issue Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants