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

fix(build): make dev builds identical to release builds #1176

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

swiatekm
Copy link

@swiatekm swiatekm commented Jun 23, 2023

Make the dev images identical to release images. We can add debug images containing additional tooling separately, but the dev images should just have a different binary, and be otherwise the same as the release ones.

This also fixes an issue where the dev Dockerfile uses the official Go image as the base for the final stage, and copies journalctl and dependencies from a debian image. This is consistent with the production image, but that uses scratch, while the golang image also uses Debian as base. As a result, if the debian versions diverge, it's possible to get cryptic errors about glibc versions, as has recently happened in our CI. See for example https://github.com/SumoLogic/sumologic-otel-collector/actions/runs/5355217286/jobs/9713524369.

@swiatekm swiatekm requested a review from a team as a code owner June 23, 2023 12:04
@sumo-drosiek
Copy link
Contributor

With that, we are going to introduce the following differences between dev and prod images:

  • different journalctl binary
  • different process of building docker image

Are we fine with it?

@swiatekm
Copy link
Author

With that, we are going to introduce the following differences between dev and prod images:

* different `journalctl` binary

* different process of building docker image

Are we fine with it?

I don't think it's that big a deal, but if we want to stay with the current setup, we should probably use a Debian image and manually install Go instead of using the Go image directly.

Why do we even want the dev image to be different from the prod one? Additional tooling? In that case it should be named differently (debug), and we should publish it for prod as well. WDYT?

@sumo-drosiek
Copy link
Contributor

sumo-drosiek commented Jun 26, 2023

Why do we even want the dev image to be different from the prod one? Additional tooling? In that case it should be named differently (debug), and we should publish it for prod as well. WDYT?

Not sure. I would expect prod image to build. Dev-builds should be as close as possible to production ones. I don;t think it is debug image, and debug images are different topic

@swiatekm swiatekm changed the title fix(build): fix dev Dockerfile fix(build): make dev builds identical to release builds Jun 26, 2023
@github-actions github-actions bot added the github_actions Pull requests that update Github_actions code label Jun 26, 2023
@github-actions github-actions bot removed the github_actions Pull requests that update Github_actions code label Jun 27, 2023
Makefile Outdated
Comment on lines 259 to 261
build-container-multiplatform-dev: REPO_URL="$(OPENSOURCE_REPO_URL)"
build-container-multiplatform-dev: build-container-multiplatform
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it work as expected 😮 ?

Copy link
Author

Choose a reason for hiding this comment

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

No, but it's pretty close. I set REPO_URL to OPENSOURCE_REPO_URL by default, and then used the former in the release targets.

Copy link
Contributor

Choose a reason for hiding this comment

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

so it works as

build-container-multiplatform-dev: REPO_URL="$(OPENSOURCE_REPO_URL)" build-container-multiplatform

?

Copy link
Author

Choose a reason for hiding this comment

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

Works more or less like:

build-container-multiplatform-dev:  
  make build-container-multiplatform REPO_URL="$(OPENSOURCE_REPO_URL)"

except it doesn't start a new shell, and you can do more stuff in the variable assignment.

@swiatekm swiatekm merged commit 976873f into main Jun 27, 2023
27 checks passed
@swiatekm swiatekm deleted the fix/build/dev-dockerfile branch June 27, 2023 15:09
@swiatekm swiatekm mentioned this pull request Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants