Skip to content
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.

Add setup script for FeatureService DB #38

Merged
merged 3 commits into from Jun 30, 2017
Merged

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 June 30, 2017 17:46
Copy link
Contributor

@jcjimenez jcjimenez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+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 Compare June 30, 2017 23:09
Copy link
Contributor

@erikschlegel erikschlegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

c-w added 3 commits June 30, 2017 16:32
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 Compare June 30, 2017 23:33
@c-w c-w merged commit 8169c46 into master Jun 30, 2017
@c-w c-w deleted the install-feature-service-db branch June 30, 2017 23:39
@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
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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants