0

I have a docker image of Apache Superset running in Google Cloud Run. I have configured it to use our Cloud SQL host for its metadata DB. Due to how you connect Cloud Run to Cloud SQL, this required using the unix socket style connection string in SQL Alchemy to get it to connect ( as per the instructions here.). Postgres is the DB in use (although I doubt that matters).

I was pretty happy with myself (as my Docker/Cloud Run knowledge is low), and it was running well - but then I went to add some data sources. Of course the config dialog for DB connection information ONLY allows you to enter a host and IP:

Superset DB configuration

It is very disappointing to get this far and be blocked by a UI limitation. The host I want to connect to is THE SAME HOST that it is using for its metadata DB - so clearly it CAN connect to it. ...I just have no way to express to it how to connect to it.

Is there anything I can do to configure Superset with unix socket connection string for the target DBs for data sources (not metadata, which already works)?

I see it even allows me to provide additional parameters which is where you specify the unix socket - but since host IP and port are required fields and it tests against them, it won't accept it.

I want to avoid the additional cost of a VPC (and I have no idea how to set one up as I am not an admin and anything happening outside of an IDE gives me PTSD).

If I can't sort it out I'll have to deploy it to our K8s cluster which we are trying to replace with serverless options (Cloud Run, GAE, etc).

WillyC
  • 101
  • 3
  • From the image you have provided here it seems you are using 34 .1. 1 which doesn't seem correct. Can you add what you are using in place of Host ? – Prabir Sep 20 '21 at 12:26
  • I removed most of the IP there from the image as it was a real IP. When using Unix sockets you do not provide an IP at all but there’s no way to submit the form with no IP. The image was just to show where I am setting this up in the product. – WillyC Sep 20 '21 at 13:11
  • Is the IP you are using is of the Cloud SQL instance? – Prabir Sep 21 '21 at 12:24
  • I would like to but since from cloud run I have to use a Unix socket and not an IP at all, I simply can’t connect to a cloud sql instance. – WillyC Sep 21 '21 at 14:39

1 Answers1

0

The issue is with the Apache Superset UI and I recommend you to follow the GitHub issue to resolve this.

For now, configuring your serverless environment as below will help resolve the issue:

  1. Configure a Private IP for the Cloud SQL instance
  2. Setup a VPC Serverless Access Connector
  3. Configure Cloud Run to use the connector
  4. Finally connect using the private IP and port

The steps provided are well explained in the documentation and are straight-forward to execute.

Prabir
  • 103
  • 2