This is a longshot but has anyone tried getting Me...
# announcements
a
This is a longshot but has anyone tried getting Meltano up and running on Google Cloud Run using Google Cloud SQL as Meltano's datastore? I'm using Postgres as it doesn't make sense to use sqlite in a production setting
I've got a Docker image and the
MELTANO_DATABSE_URI
env var is configured in the .env file, but when I deploy in Cloud Run I'm getting errors about Meltano not being able to connect to Cloud SQL
Before I go down the rabbit hole, I thought I'd see if anyone else has tried this
k
You’re further in the rabbit hole than I am, I am planning to implement the same cloud run + cloud sql in prod too. Did you add the connection on the cloud run front too? https://cloud.google.com/sql/docs/mysql/connect-run I am curious about how you are implementing your main.py for cloud run
a
Thanks for that link, that helped me get it running!
I actually didn't do anything special - Cloud Run just runs Meltano by invoking
meltano ui
as per the Dockerfile
I just got it running at https://meltano-conhde2ava-ts.a.run.app but getting errors when trying to set up the extractors - going further down the rabbit hole now although it's 10.25pm, should probably call it a night soon
k
Wait, you’re in OZ ? That’s the time on my clock too LOL
a
haha yup, in Sydney. Whereabouts are you?
k
Melbourne, just closed the border to prevent y’all from infecting us tho 😛
a
haha yep, been hearing about the stage 3 stuff...this lockdown has given me more time to look at Meltano 😛
d
I just got it running at https://meltano-conhde2ava-ts.a.run.app but getting errors when trying to set up the extractors
@al_whatmough What errors? 🙂
a
@douwe_maan in the logs I'm seeing this error:
Copy code
sqlalchemy.exc.ProgrammingError: (pg8000.core.ProgrammingError) {'S': 'FATAL', 'V': 'FATAL', 'C': '53300', 'M': 'remaining connection slots are reserved for non-replication superuser connections', 'F': 'postinit.c', 'L': '828', 'R': 'InitPostgres'} (Background on this error at: <http://sqlalche.me/e/f405>)
pg8000 is the library I'm using to set up the connection to Cloud SQL (the connection string is defined in the .env file). This looks to be specifically to do with the connections to that db, so it's either something wrong with Cloud SQL itself or maybe the way Meltano is handling the connection
d
Hmm, where are you seeing this error exactly? In the ELT output?
a
I see it in the Cloud SQL logs and it seems to be happening at various points, even just loading the Extractors page in the UI. I created a pipeline via the UI and I'm currently trying to run it, but this also triggers the error
e.g. calls to /api/v1/orchestrations/jobs/state seem to trigger it
d
"remaining connection slots are reserved for non-replication superuser connections" looks like a legit Postgres error to me, and Google suggests the same
SQLAlchemy/pg8000 is just surfacing the error message
a
yeah and the FATAL bit doesn't fill me with any reassurance, so I guess I'll need to have a look at how my Cloud SQL instance is configured
k
Have you given up on this ? what’s the learning ?
m
Hi @al_whatmough, I'd love to hear if this has worked and if there was any learning.
a
Hey @keat and @murilo_tavolaro_de_nigris - sorry only just saw these, I sometimes have Slack threads fail and miss seeing replies to a thread
k
It’s okay, Melbourne is still in lockdown and I can wait ❤️
a
unfortunately I never managed to get Meltano running on Google Cloud Run using cloud SQL. I actually never figured out the issue with the Postgres connections running out, but it's possible that because I was trying to get this running on a very small instance it just didn't have enough resources and the connection pool was being used up. It was just for a proof of concept so I didn't actually want to spend much money, but in a real environment I'd set up a more powerful instance
I'm still interested in getting it running, however - so I'm hoping to take another look at it. I can document it this time too, it could definitely be a nice option for running Meltano so if it works, it'd be good to have it on the official docs
m
Thank you for the reply @al_whatmough (I miss threads sometimes too haha) I was just curious, but I decided to deploy my first project on a normal instance for now. If you do and document, it would be great, but no rush on this 🙂
r
Hey everyone! Following up on this thread to see if you ever got this working. Considering going this route in GCP
a
Hi @ricky_renner! I'd also be interested to hear if anyone got this working. I never pursued it in the end. I've seen someone in the introductions channel mention that they're deploying Meltano on GKE and using Composer rather than the Airflow which is included in Meltano. This is also an interesting approach, but I'm guessing that the costs could be a bit higher than running the whole thing on GCP
Hi @aaronsteers, just thought I'd loop you into this discussion. Thanks for your reply to the issue - I'll need to go back and remind myself of the exact details of the issues I was having when trying to get Meltano running on Cloud Run, but this is a good starting point - if you scroll up you should be able to see an error I was having with postgres
it's possible that I was just trying this with an under resourced environment, so that particular error could possibly be solved by using a larger instance
d
(The issue Al is referring to: https://gitlab.com/meltano/meltano/-/issues/2635)