Merged
Conversation
Updating config for cloudsql instances
jamessynge
approved these changes
Sep 17, 2018
| msg_port: 6510 | ||
|
|
||
| ############ Google Network ############ | ||
| # By default all images are stored on google |
Contributor
There was a problem hiding this comment.
I'm sure we could fit this text on two lines instead of four! ;-)
| #################################### | ||
| # connect_clouddb_proxy.py | ||
| # | ||
| # This is a simple wrapper that looks up |
Contributor
There was a problem hiding this comment.
I recall advocating for 80 column lines, but this is really short! ;-)
Member
Author
There was a problem hiding this comment.
Soon I'm going to push for 2-character lines! ;)
|
|
||
| def main(instance_id, local_port, verbose=False): | ||
| proxy_cmd = os.path.join(os.environ['POCS'], 'bin', 'cloud_sql_proxy') | ||
| connection_str = '-instances={}=tcp:{}'.format(instance_id, local_port) |
Contributor
There was a problem hiding this comment.
connection_str seems like the wrong name for this var. Not sure if the following makes sense:
connection_str = '{}=tcp:{}'.format(instance_id, local_port)
instances_arg = '-instances={}'.format(connection_str)
Adding a reference to the proxy script.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #599, depends on #600.
Adds the
cloud_sql_proxyfrom google for connecting to cloud sql instances. Also includes a simple wrapper script that will pull the setup information from the config.Adds a few utility functions:
get_db_proxy_connget_cursormeta_insertadd_header_to_dbNote As of now this still requires the user to set a PGPASSWORD to authenticate against the actual database table. We might want to look at ways to mitigate that.