Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document docker action usage #8

Open
aplr opened this issue Sep 5, 2023 · 2 comments
Open

Document docker action usage #8

aplr opened this issue Sep 5, 2023 · 2 comments

Comments

@aplr
Copy link

aplr commented Sep 5, 2023

Quite a edge-case probably, but an easy fix if documented.

I'm running cloud-sql-proxy in combination with tailscale to access my postgres instance w/ private address in Google Cloud.

The proxy exposes the connection on a port on the github runner's localhost.

As this action runs in a docker container itself, connecting to localhost, does of course not connect to the github runner's "localhost".

The fix is using 172.17.0.1 as a host, instead of localhost:

- name: Deploy Atlas Migrations
  uses: ariga/atlas-deploy-action@v0
  env:
    DB_HOST: "172.17.0.1"
    DB_PORT: "1234"
    DB_USERNAME: pg
    DB_PASSWORD: pg
    DB_NAME: pg
  with:
    url: postgres://${{ env.DB_USERNAME }}:${{ env.DB_PASSWORD }}@${{ env.DB_HOST }}:${{ env.DB_PORT }}/${{ env.DB_NAME }}?search_path=public&sslmode=disable

Probably it'd be good to document that this action is running in a docker container, as I was looking too long on my end.
And also, how to connect to localhost then.

@giautm
Copy link
Member

giautm commented Sep 5, 2023

honestly, I don't know how to connect to localhost from inside of the action yet. I just write to update you that we already supported for CloudSQL IAM authenticator using the new data source: https://atlasgo.io/atlas-schema/projects#data-source-gcp_cloudsql_token

@aplr
Copy link
Author

aplr commented Sep 5, 2023

I'm actively running migrations using ariga/atlas-deploy-action, connecting to runner's localhost by using 172.17.0.1 as the host. Working fine as far as I can tell :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants