cloud-sql-proxy
cloud-sql-proxy copied to clipboard
Feature Request: Better support for running as a daemon process
I'm trying to run cloud_sql_proxy in a Google Colab notebook. We can authenticate and the proxy is actually running.
!./cloud_sql_proxy --instances=my-project:my-region:my-instance
However the notebook will not let me execute other cells, as the cloud_sql_proxy command does not terminate. I would hope that if we send the task to background, the notebook will continue processing.
Note that adding a &
to run in the background doesn't seem to work in the notebook. The process continues to run foreground.
Please see https://stackoverflow.com/a/49142801 for a complete example.
I added this as a comment to the Stackoverflow question, but a workaround that might be simpler than screen
is daemonize. It should be sufficient for this use case, although not for #290.
As @dhduvall notes in #290, this now also includes
making sure that systemd doesn't mark the proxy service as online until the proxy is ready to take requests
Partially a duplicate of https://github.com/GoogleCloudPlatform/cloud-sql-proxy/issues/1567, which we'll be addressing soon.
For Colab Notebook support, see the Python connector which will be the best option: https://github.com/GoogleCloudPlatform/cloud-sql-python-connector (there's a badge that will take you straight to an example).