Score:0

Provide Unix Socket connection information for Apache Superset

in flag

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).

Prabir avatar
ck flag
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 ?
WillyC avatar
in flag
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.
Prabir avatar
ck flag
Is the IP you are using is of the Cloud SQL instance?
WillyC avatar
in flag
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.
Score:0
ck flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.