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

GoReleaser: publish Homebrew formula to a Tap on each new release #460

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

edigaryev
Copy link

@edigaryev edigaryev commented Jan 18, 2024

Currently installing OpenTelemetry Collector on macOS is pretty painful compared to Grafana Agent, see open-telemetry/opentelemetry-collector#7891.

However, publishing a formula to a Homebrew/homebrew-core can be intimidating both for the maintainers and consumers:

  • maintainers: need a tooling to automatically publish new versions (Grafana has a bot for this) or resort to manual work
  • consumers: need to build from source, which takes a lot of time and CPU resources on target machines

A simpler, self-managed and readily available alternative is a Homebrew Tap.

Since OpenTelemetry already uses GoReleaser, and GoReleaser has a Homebrew Taps module, publishing a Tap becomes a no-brainer (see PR diff for a minimally working implementation).

Installing from a Tap is as simple as:

brew install open-telemetry/tap/otelcol-contrib

Requires open-telemetry/homebrew-tap repository to be created and accessible via GITHUB_TOKEN.

Cc: @svrnm, @jpeach

@edigaryev edigaryev requested review from a team and fatsheep9146 January 18, 2024 18:23
@svrnm
Copy link
Member

svrnm commented Jan 19, 2024

hey @edigaryev, thanks for creating this PR and bumping the discussion around the collector in homebrew.

consumers: need to build from source, which takes a lot of time and CPU resources on target machines

With what is called bottles in the homebrew ecosystem this is not the case anymore, those are binary packages, and "Bottles for homebrew/core formulae are created by Brew Test Bot when a pull request is submitted. If the formula builds successfully on each supported platform and a maintainer approves the change, Brew Test Bot updates its bottle do block and uploads each bottle to GitHub Packages." (see https://docs.brew.sh/Bottles#creation)

maintainers: need a tooling to automatically publish new versions (Homebrew/homebrew-core#155035 for this) or resort to manual work
A simpler, self-managed and readily available alternative is a Homebrew Tap.

As I have outlined in my comment my personal preference would be a formulae on homebrew/core, because of discoverability and user expectations, but it's up to the collector maintainers to decide what they think is easier to maintain.

As a final note, I also like to re-iterate on the following:

nobody can be stopped from providing formulae for opentelemetry artifacts to core, e.g. there is one for opentelemetry-cpp already

The initial provider of that formulae (@flier), who initially pushed opentelemetry-cpp is not a maintainer/regular contributor to the opentelemetry-cpp project, so in the same sense anyone can go ahead and create an initial formulae, and from there a bot is nice, but not necessary for future updates, as the history of that formulae shows: https://github.com/Homebrew/homebrew-core/commits/8fe83e930ae16f5559f9d99441e07e8ceea7d404/Formula/o/opentelemetry-cpp.rb

cc @open-telemetry/cpp-approvers please correct me if I am wrong about this package not coming from any member of your SIG?

@edigaryev
Copy link
Author

@svrnm thanks for the input!

I've just realized that this project produces the binaries with CGO_ENABLED=0, which means that hostmetricsreceiver won't emit CPU and disk metrics on macOS, which is in turn a breaker for us.

I went ahead and submitted a PR with a Homebrew formula (inspired by yours one) upstream: Homebrew/homebrew-core#160730, so closing this one.

@edigaryev edigaryev closed this Jan 23, 2024
@edigaryev edigaryev deleted the homebrew-tap branch January 23, 2024 15:02
@edigaryev edigaryev restored the homebrew-tap branch January 23, 2024 18:57
@edigaryev edigaryev reopened this Jan 23, 2024
@edigaryev
Copy link
Author

Re-opening because it's not possible to upstream the OpenTelemetry Collector into the Homebrew Core, see open-telemetry/opentelemetry-collector#7891 (comment)

@atoulme
Copy link
Contributor

atoulme commented Apr 26, 2024

Please help resolve conflicts?

@edigaryev
Copy link
Author

Please help resolve conflicts?

Done in b4cfdb9 👌

edigaryev and others added 2 commits April 28, 2024 08:37
Co-authored-by: Antoine Toulme <antoine@toulme.name>
Co-authored-by: Antoine Toulme <antoine@toulme.name>
@edigaryev edigaryev requested a review from atoulme April 28, 2024 04:37
@atoulme
Copy link
Contributor

atoulme commented Apr 28, 2024

Please see the CI

@edigaryev
Copy link
Author

Please see the CI

Moved the "brews:"-related GoReleaser configuration generation to the Golang codebase in 3b48905.

@TylerHelmuth
Copy link
Member

Should the k8s distro have a formula?

@svrnm
Copy link
Member

svrnm commented Apr 29, 2024

Note that going down the road of having our own tap requires a dedicated repository:

Requires open-telemetry/homebrew-tap repository to be created and accessible via GITHUB_TOKEN.

@edigaryev
Copy link
Author

Should the k8s distro have a formula?

It seems to be Linux-only (which makes sense):

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

Successfully merging this pull request may close these issues.

4 participants