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

[enhancement] Add OCB docker image release #671

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

Conversation

jackgopack4
Copy link
Contributor

@jackgopack4 jackgopack4 commented Sep 20, 2024

Per open-telemetry/opentelemetry-collector#5712, we wish to release a docker image to allow users to more easily build their own custom collectors.

This PR adds a Dockerfile as well as steps in the Github Actions and GoReleaser workflows to build and publish a default ocb image that will allow users to pull the image, mount their local directory (and manifest/builder-config file), and use the binary without worrying about installing dependencies locally.

This docker image also respects environment variables such as GOOS and GOARCH, allowing users to build binaries for different platforms, as well as other commands such as --skip-compilation and --skip-generate

This PR also adds signing to the ocb binaries and docker images, similar to the signing for the distribution docker images/binaries. This should give a "green check" that makes everything look nice and verified.

update-version.yaml workflow was moved to PR #684 Additionally, this PR adds an update-version.yaml Github Action workflow to simplify updating the manifests in this repo as quality of life enhancement for the collector release process. My opentelemetry-collector core PR will update the documentation to add documentation about this as well.

Corresponding PR for documentation update: open-telemetry/opentelemetry-collector#11234

Notably, this PR does not remove any binaries or change any existing user flows, only adds more options to how ocb can be used.

Edit: See the docker images built and pushed automatically to my personal dockerhub repo: https://hub.docker.com/r/johnpeterson785/opentelemetry-collector-builder/tags

As well as a successful release in my repo:
https://github.com/jackgopack4/opentelemetry-collector-releases/releases/tag/cmd%2Fbuilder%2Fv0.108.0

@jackgopack4 jackgopack4 marked this pull request as ready for review September 20, 2024 16:53
@jackgopack4 jackgopack4 requested a review from a team as a code owner September 20, 2024 16:53
@jackgopack4 jackgopack4 marked this pull request as draft September 20, 2024 17:13
bogdandrutu pushed a commit to open-telemetry/opentelemetry-collector that referenced this pull request Sep 28, 2024
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Adding documentation for corresponding [PR #671 in
opentelemetry-collector-releases](open-telemetry/opentelemetry-collector-releases#671)

<!-- Issue number if applicable -->
#### Link to tracking issue
Closes #5712 

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Github Actions and releases in personal fork,
github.com/jackgopack4/opentelemetry-collector-releases

<!--Describe the documentation added.-->
#### Documentation
updates to cmd/builder/README.md for OCB instructions and
docs/release.md for an automation that I also added in the releases PR
<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Andrzej Stencel <[email protected]>
Co-authored-by: Yang Song <[email protected]>
@mx-psi
Copy link
Member

mx-psi commented Oct 3, 2024

I originally added release:blocker since it had the bits on #684 but now that they are separate this is not a blocker.

@jackgopack4 jackgopack4 changed the title [feature] Add OCB docker image release [enhancement] Add OCB docker image release Oct 3, 2024
cmd/builder/Dockerfile Outdated Show resolved Hide resolved
cmd/builder/Dockerfile Outdated Show resolved Hide resolved
cmd/builder/Dockerfile Outdated Show resolved Hide resolved
mx-psi pushed a commit to open-telemetry/opentelemetry-collector that referenced this pull request Oct 7, 2024
…ge" (#11379)

Reverts #11234

The PR to publish container images for builder
open-telemetry/opentelemetry-collector-releases#671
has not been merged yet (neither has the one adding "Update version"
workflow
open-telemetry/opentelemetry-collector-releases#684).
We should only publish these docs after the images are published.

Fixes
#11347
jackgopack4 added a commit to jackgopack4/opentelemetry-collector that referenced this pull request Oct 8, 2024
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Adding documentation for corresponding [PR open-telemetry#671 in
opentelemetry-collector-releases](open-telemetry/opentelemetry-collector-releases#671)

<!-- Issue number if applicable -->
#### Link to tracking issue
Closes open-telemetry#5712 

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Github Actions and releases in personal fork,
github.com/jackgopack4/opentelemetry-collector-releases

<!--Describe the documentation added.-->
#### Documentation
updates to cmd/builder/README.md for OCB instructions and
docs/release.md for an automation that I also added in the releases PR
<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Andrzej Stencel <[email protected]>
Co-authored-by: Yang Song <[email protected]>
@@ -73,3 +73,24 @@ push-tags:
@git tag -a ${TAG} -s -m "Version ${TAG}"
@echo "Pushing tag ${TAG}"
@git push ${REMOTE} ${TAG}

# Used for debug only

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment correct? If those lines are really just for debug, should we remove them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it's not used for production release, it was making it much easier to troubleshoot and add/modify the build/release workflows (more easily pushing and deleting/repeating tag push to trigger the appropriate workflows in my fork), so I thought it appropriate/helpful to leave them for other devs.

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