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

Publish v2 Proxy via Homebrew #95

Closed
mattes opened this issue Jun 10, 2017 · 33 comments
Closed

Publish v2 Proxy via Homebrew #95

mattes opened this issue Jun 10, 2017 · 33 comments
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@mattes
Copy link

mattes commented Jun 10, 2017

Is someone working on a brew formula?

@Carrotman42
Copy link
Contributor

Carrotman42 commented Jun 10, 2017 via email

@mattes
Copy link
Author

mattes commented Jun 10, 2017

https://brew.sh/

@mattes
Copy link
Author

mattes commented Jun 10, 2017

After thinking about it more, there are some obstacles:

  • cloudsql-proxy either looks at GOOGLE_APPLICATION_CREDENTIALS env variable
    or at the flag -credential_file.
  • When using/installing gcloud, neither the env variable is set nor is there a service account key file.

So gcloud and cloudsql-proxy are not compatible as of today, I believe.

Ultimately, it would be really nice if the proxy would be available with:

gcloud sql instances proxy <instance>

@Carrotman42
Copy link
Contributor

Carrotman42 commented Jun 11, 2017 via email

@mattes
Copy link
Author

mattes commented Jun 11, 2017

word! just tried again, no idea what I was doing wrong before.

@Carrotman42
Copy link
Contributor

I have zero experience with homebrew, but if you would like to submit a formula I would be very gracious!

@mattes
Copy link
Author

mattes commented Jun 14, 2017

I will look into this prob within the next days.

@Carrotman42
Copy link
Contributor

Any updates? If not we can leave the issue open as a feature request for anyone who finds the time, but this isn't something I will be able to spend time on personally.

@mattes
Copy link
Author

mattes commented Aug 16, 2017

Priorities shifted unfortunately. I'm not actively looking into this right now.

@kurtisvg
Copy link
Contributor

Closing - this issue hasn't been updated for over 6 months and appears to be abandoned.

@andrmueller
Copy link

andrmueller commented Nov 4, 2019

I know this issue is outdated, but just in case anyone wonders how to install cloud_sql_proxy via brew it is possible now by using gcloud:

  • brew cask install google-cloud-sdk
  • gcloud components install cloud_sql_proxy

EDIT: You can then find the binary in:
/usr/local/google-cloud-sdk/bin/cloud_sql_proxy

@liam-mclaughlin
Copy link

A follow up on @andrmueller point; The binaries are now stored in

/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin

@jgonera
Copy link

jgonera commented Aug 25, 2020

This seems to be installing an old version (1.13, latest is 1.17). Am I doing something wrong? I tried running gcloud components update but it still wants to install 1.13.

@kurtisvg
Copy link
Contributor

@jgonera Unfortunately the gcloud version being outdated is a known issue - see #408

@Stoicdata
Copy link

Hello I actually might need some similar help with /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin/cloud_sql_proxy -instances= server info

When i run this i get: No such file or directory
anyone know what the issue might be?

@AlexandreCassagne
Copy link

Was any work done on this?

@AlexandreCassagne
Copy link

Never mind. Just saw the last message! Good day.

@enocom
Copy link
Member

enocom commented Nov 18, 2021

There is an unofficial brew formula here: https://github.com/tclass/homebrew-cloud_sql_proxy.

However, it compiles from source which requires Go. It remains easiest to just download the latest version from the Releases page.

yosatak pushed a commit to yosatak/cloud-sql-proxy that referenced this issue Feb 26, 2023
Ensure requested env variables are set during builds
@erdemkeren
Copy link

erdemkeren commented Jun 9, 2023

another A follow-up on @andrmueller point; The binaries are now here:

/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin/cloud_sql_proxy

@enocom enocom changed the title brew formula Publish v2 Proxy via Homebrew Jun 9, 2023
@enocom enocom reopened this Jun 9, 2023
@enocom
Copy link
Member

enocom commented Jun 9, 2023

Re-opening as this would make life easier for lots of folks. Seems worth pursuing, although I can't promise a timeline presently.

@enocom enocom added priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jun 9, 2023
@enocom
Copy link
Member

enocom commented Jun 9, 2023

Likely blocked by #1712.

@enocom
Copy link
Member

enocom commented Jul 25, 2023

@snorremd
Copy link

snorremd commented Jul 25, 2023

I've created an unofficial formulae for the 2.X-version over at https://github.com/snorremd/homebrew-tap/pkgs/container/tap%2Fcloud-sql-proxy. I prefer having one package management system over a lot of different ones, so felt this was nicer than installing via gcloud components.

Note that my CI job unfortunately only builds bottles for amd64 architecture so if you are on arm (e.g. M1 or M2 Mac) you need to compile from source. But Homebrew should install go for you if you don't have it installed, so you don't need to do anything manually.

I've yet to figure out a cheapish way to build bottles for Mac arm processors as you'd need short lived access to a Mac M1 machine/server and Apple requires datacenters to rent on a 24hour basis.

Edit: Because I don't really care to subscribe to Apple's developer program they are not notarized.

@enocom
Copy link
Member

enocom commented Jul 25, 2023

@snorremd Nice!

As an alternative, if you'd like to contribute a formula here, we could take over the cost of running the builds. Do the builds need to be notarized? I've been waiting to pick this up until we fix #1712.

@snorremd
Copy link

snorremd commented Jul 28, 2023

Notarization is not strictly required by MacOS for binaries I believe. So it should be okay to host formula bottles without signing them.

As for the ARM Mac issue the biggest challenge now would be that you'd have to set up and maintain a self-hosted MacOS GitHub Actions runner. GitHub do have GitHub hosted Mac runners on their roadmap for this year, so perhaps it would be wise to wait for those: github/roadmap#528

I'd be happy to help contribute something to the project, but I suppose you'd want to automate this a bit more than my current formula setup. My suggestion would be to set up a new repository, https://github.com/GoogleCloudPlatform/homebrew-tap so you get a proper homebrew tap for all GoogleCloudPlatform binary projects. Users would then add the tap with brew tap GoogleCloudPlatform/tap and could then install your binary with brew install cloud-sql-proxy.

When you mint a new release you could trigger a GitHub actions job that creates a PR for the new release on the tap repository with the new version number and hash, and then allow the tap repository to follow the normal Homebrew CI process of testing the formula, bottling, and uploading packages.

You can use this (i.e. cloud-sql-proxy) repository as a standalone tap, but users would then need to use a URL when adding the tap, and it would only contain the cloud-sql-proxy formula. Making a single tap for all cloud platform related binaries would be nicer for users I think.

@maverick1872
Copy link

Yea this would be awesome. The short term solution would be to at least provide v2 installation via gcloud components as currently the latest appears to be 1.27.0.

@enocom enocom added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Aug 1, 2023
@enocom
Copy link
Member

enocom commented Aug 1, 2023

This seems like an obvious thing to ship. Bumping the priority to reflect that.

Meanwhile, we're working on fixing the gcloud version to support v2, but given the breaking changes, we have to be thoughtful about doing that (and automate it which it's currently not).

@maverick1872
Copy link

@enocom as a follow-up it appears that when installing via gcloud the installed binary is not put into a directory that exists within my $PATH. After installation with gcloud should it be accessible or is it only accessible via gcloud beta sql connect?

@enocom
Copy link
Member

enocom commented Aug 3, 2023

@maverick1872 This has come up before. Would you mind filing an issue here with details (your OS, your gcloud version, your PATH settings)?

@jhandguy
Copy link

Hi there folks, cloud-sql-proxy is now part of homebrew-core (#140782) and can be installed with brew install cloud-sql-proxy.

@enocom
Copy link
Member

enocom commented Aug 31, 2023

Beautiful! Thank you for this awesome contribution!

@enocom enocom closed this as completed Aug 31, 2023
@enocom
Copy link
Member

enocom commented Aug 31, 2023

@jhandguy Does Homebrew Core have automation to update the version?

@enocom
Copy link
Member

enocom commented Sep 1, 2023

Looks like no: https://docs.brew.sh/Formula-Cookbook#updating-formulae.

But we could easily add this to our release process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests