Closed munishchouhan closed 11 months ago
@marcodelapierre can you please test this?
The added formula file seems reasonable.
However, as far as I understand (I am new to JReleaser), we also need a jreleaser.yml
in the root dir, with a packages: brew:
section, as per the YAML example in https://jreleaser.org/guide/latest/reference/packagers/homebrew.html .
In fact, I also see that tower-cli
has such a file: https://github.com/seqeralabs/tower-cli/blob/master/jreleaser.yml
Munish can you investigate this aspect?
After this addition, I imagine that testing the github workflow on a test repo (personal fork?) should result in the Brew artifact being created.
Also, note this note in the jreleaser page for homebrew:
JReleaser does not generate a valid homebrew-core formula. The generated formulas are meant to be published as [homebrew taps](https://docs.brew.sh/Taps.html), and in their current form will not be accepted in any of the official homebrew repositories.
This seems to imply some additional steps.
Look at the this brew help output:
$ brew help tap
Usage: brew tap [options] [user/repo] [URL]
Tap a formula repository. If no arguments are provided, list all installed taps.
With URL unspecified, tap a formula repository from GitHub using HTTPS. Since
so many taps are hosted on GitHub, this command is a shortcut for brew tap
user/repo https://github.com/user/homebrew-repo.
I think we should be setting up a seqeralabs/homebrew-SOMETHING
to host our brew formulas.
Then users will be able to do:
# only once
brew tap seqera/SOMETHING
# and then any time needed
brew install wave
brew install tower-agent
brew install tower-cli
......
@pditommaso if this makes sense, then @munishchouhan you could take care of this after the YAML step above is done.
Thoughts?
@pditommaso if this makes sense, then @munishchouhan you could take care of this after the YAML step above is done.
Yes please! what other projects do usually use for the SOMETHING
part?
I think I just love Hashicorp's take, they use tap, as in: seqeralabs/tap
Then:
brew tap seqeralabs/tap
brew install wave-cli
brew install tower-cli
..
# or, equivalently I think, without the initial tap
brew install seqeralabs/tap/wave-cli
brew install seqeralabs/tap/tower-cli
..
https://www.hashicorp.com/blog/announcing-hashicorp-homebrew-tap
It makes sense for us, as we may have a limited number of formulas to provide (currently no more than 5 : wave-cli, tower-cli, tower-agent, seqera-kit?), so I don't see scope for having multiple named SOMETHING.
Ubuntu uses ubuntu/microk8s
, but I cannot see a parallel for us (https://github.com/ubuntu/homebrew-microk8s)
So I suggest creating the new repo github.com/seqeralabs/homebrew-tap
.
@ewels pointed out that having to resort the custom tap can be annoying to users.
This is currently a requirement due to JReleaser restriction.
So:
Phil, how bad of a constraint is this? Should we look into opening an issue with JReleaser to improve on this?
Paolo, would this be a deal breaker vs using JReleaser?
Phil: is it possible to have homebrew core formula collection to accept syncing of our custom tap??
For reference: JReleaser page on Homebrew: https://jreleaser.org/guide/latest/reference/packagers/homebrew.html
I think the custom tap is fine. I've seen many times. The tap
naming is ok!
Phil, how bad of a constraint is this? Should we look into opening an issue with JReleaser to improve on this?
Not bad - as discussed in the meeting, main downside is that it requires people to read the Seqera docs and copy + paste commands rather than just searching Homebrew or doing brew search wave
(ie. better discoverability in core formula).
Phil: is it possible to have homebrew core formula collection to accept syncing of our custom tap??
We looked into this a bit during the meeting and it's not just pushing to the core collection that's an issue, it's that JReleaser creates manifests that are not valid for the core collection. Sounds like there might be quite a bit of work involved (?) so probably not worth it.
@munishchouhan when you are back, I think we are ready to go ahead and work on the updated jreleaser.yml
, see comment further up : https://github.com/seqeralabs/wave-cli/pull/37#issuecomment-1820202263
new repo has been created for home brew tap https://github.com/seqeralabs/homebrew-tap
Thanks for the progress Munish!
Are there any more required steps to enable us testing the functionality?
E.g. we could have a condition on the brew formula workflow, that checks for a string in the commit name, such as [test brew]
FWIW core formulae are supposed to be built from source. At the moment JReleaser builds formulae from binaries, which is why taps are preferred.
Discoverability is hindered a bit when using taps as one must perform one extra step (linking the tap) before installing the target formula. However, it's a known practice up to a certain point.
@aalmiray, thanks for the input, we have created the formula to directly use binaries and for the JReleaser part, is there a way to test the publishing part locally or in a fork?
Yes, you can invoke either the prepare
or package
commands in JReleaser. This will generate the formula inside the out/jreleaser/
directory, which you may install from source using brew
. Be advised that you may need to update the url:
to point to a local path in your filesystem as the formula will expect the published url to be available by default.
I am testing here https://github.com/munishchouhan/wave-cli/actions/runs/
how is the testing going?
Currently, I am getting this warning, so I will create a zip distribution for homebrew
[WARN] distribution.wave-cli.brew was disabled because there are no matching artifacts [.zip]
Be advised on the different types of distributions supported by JReleaser. Given your current setup you need either of these 2
https://jreleaser.org/guide/latest/concepts/distributions/binary.html
https://jreleaser.org/guide/latest/concepts/distributions/flat-binary.html
@marcodelapierre @pditommaso I got this working now you can check https://github.com/munishchouhan/wave-cli/actions/runs/7102346973 https://github.com/munishchouhan/homebrew-tap
But still need to figure out the platform part because we have to publish it for AMR and x86
A new GitHub token is required, which have access to write on https://github.com/seqeralabs/homebrew-tap
@jordigg, can you please generate a Github token with the necessary permissions and put it in the environment of this repository?
A new GitHub token is required, which have access to write on https://github.com/seqeralabs/homebrew-tap
@jordigg, can you please generate a Github token with the necessary permissions and put it in the environment of this repository?
@munishchouhan isn't this something we can do ourselves?
If not, and if Jordi has not actioned this yet, I suggest you raise an internal help-it
request to bring it to his attention.
@marcodelapierre @munishchouhan I reached out via Slack to Munish about this.
As far as I know, there are two types of credentials you can use. Organization credentials or a "service account", and I'm not sure which one you need.
For other CI work, the engineering team uses the seqera-sa-eng
account which is stored in 1Password under the Engineering Vault. You can login and set up anything you need in there. I'm trying not to be a blocker, so I prefer for people to self-serve and if something depends on me we change it.
I have added the seqera-sa-eng
to a ci-automation
group and gave it write
permissions to this repo.
I don't think the Repo has any admin, not sure which team should have this.
Let me know if you need me to do anything.
@jordigg please give this user seqera-sa-eng
write permission on homebrew-repo also
@munishchouhan done.
I have added [ci-automation](https://github.com/orgs/seqeralabs/teams/ci-automation)
to the repo.
@pditommaso @marcodelapierre @jordeu This PR is ready for review you can test this by following the instructions mentioned in the below repository https://github.com/munishchouhan/homebrew-tap
Finally, I propose to expand the readme in the Tap repository: https://github.com/seqeralabs/homebrew-tap/pull/1
Thanks Munish!
@pditommaso Please review this PR
@pditommaso Homebrew support for Wave CLI merged
This PR will add the following: