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): Use Debian Bullseye base image for build image #14368

Merged
merged 5 commits into from
Oct 3, 2024

Conversation

chaudum
Copy link
Contributor

@chaudum chaudum commented Oct 3, 2024

What this PR does / why we need it:

This change is necessary to allow the binaries built using the Loki build image to run on operating systems with older libc version.

E.g. Promtail is built with cgo (CGO_ENABLED=1), because the journald target support requires it.

$ docker run --rm -ti --entrypoint=/usr/bin/ldd golang:1.23-bullseye --version
ldd (Debian GLIBC 2.31-13+deb11u11) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

$ docker run --rm -ti --entrypoint=/usr/bin/ldd golang:1.23-bookworm --version
ldd (Debian GLIBC 2.36-9+deb12u8) 2.36
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

Which issue(s) this PR fixes:

Fixes #13393

Further discussion

The .deb and .rpm packages should define the libc version as dependency.

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@loki-gh-app
Copy link
Contributor

loki-gh-app bot commented Oct 3, 2024

Hello @chaudum!
Backport pull requests need to be either:

  • Pull requests which address bugs,
  • Urgent fixes which need product approval, in order to get merged,
  • Docs changes.

Please, if the current pull request addresses a bug fix, label it with the type/bug label.
If it already has the product approval, please add the product-approved label. For docs changes, please add the type/docs label.
If the pull request modifies CI behaviour, please add the type/ci label.
If none of the above applies, please consider removing the backport label and target the next major/minor release.
Thanks!

@loki-gh-app
Copy link
Contributor

loki-gh-app bot commented Oct 3, 2024

Hello @chaudum!
Backport pull requests need to be either:

  • Pull requests which address bugs,
  • Urgent fixes which need product approval, in order to get merged,
  • Docs changes.

Please, if the current pull request addresses a bug fix, label it with the type/bug label.
If it already has the product approval, please add the product-approved label. For docs changes, please add the type/docs label.
If the pull request modifies CI behaviour, please add the type/ci label.
If none of the above applies, please consider removing the backport label and target the next major/minor release.
Thanks!

This change is necessary to allow the binaries built using the Loki
build image to run on operating systems with older libc version.

Signed-off-by: Christian Haudum <[email protected]>
Signed-off-by: Christian Haudum <[email protected]>
@chaudum chaudum force-pushed the chaudum/use-bullseye-build-image branch from 3d71202 to 1ccbe50 Compare October 3, 2024 11:13
@pull-request-size pull-request-size bot added size/M and removed size/S labels Oct 3, 2024
@chaudum chaudum added size/S type/bug Somehing is not working as expected and removed size/M labels Oct 3, 2024
@loki-gh-app
Copy link
Contributor

loki-gh-app bot commented Oct 3, 2024

This PR must be merged before a backport PR will be created.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Oct 3, 2024
Copy link
Contributor

@vlad-diachenko vlad-diachenko left a comment

Choose a reason for hiding this comment

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

lgtm

@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Oct 3, 2024
Signed-off-by: Christian Haudum <[email protected]>
@chaudum chaudum merged commit 3beb8ff into main Oct 3, 2024
61 checks passed
@chaudum chaudum deleted the chaudum/use-bullseye-build-image branch October 3, 2024 18:30
@loki-gh-app
Copy link
Contributor

loki-gh-app bot commented Oct 3, 2024

The backport to release-3.1.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-14368-to-release-3.1.x origin/release-3.1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 3beb8ff9cfe7f765b5d5db87892981a223d72f50

When the conflicts are resolved, stage and commit the changes:

git add . && git cherry-pick --continue

If you have the GitHub CLI installed:

# Push the branch to GitHub:
git push --set-upstream origin backport-14368-to-release-3.1.x
# Create the PR body template
PR_BODY=$(gh pr view 14368 --json body --template 'Backport 3beb8ff9cfe7f765b5d5db87892981a223d72f50 from #14368{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title 'fix(build): Use Debian Bullseye base image for build image (backport release-3.1.x)' --body-file - --label 'size/M' --label 'type/build' --label 'type/docs' --label 'type/bug' --label 'backport' --base release-3.1.x --milestone release-3.1.x --web

Or, if you don't have the GitHub CLI installed (we recommend you install it!):

# Push the branch to GitHub:
git push --set-upstream origin backport-14368-to-release-3.1.x

# Create a pull request where the `base` branch is `release-3.1.x` and the `compare`/`head` branch is `backport-14368-to-release-3.1.x`.

# Remove the local backport branch
git switch main
git branch -D backport-14368-to-release-3.1.x

@loki-gh-app
Copy link
Contributor

loki-gh-app bot commented Oct 3, 2024

The backport to release-3.2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-14368-to-release-3.2.x origin/release-3.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 3beb8ff9cfe7f765b5d5db87892981a223d72f50

When the conflicts are resolved, stage and commit the changes:

git add . && git cherry-pick --continue

If you have the GitHub CLI installed:

# Push the branch to GitHub:
git push --set-upstream origin backport-14368-to-release-3.2.x
# Create the PR body template
PR_BODY=$(gh pr view 14368 --json body --template 'Backport 3beb8ff9cfe7f765b5d5db87892981a223d72f50 from #14368{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title 'fix(build): Use Debian Bullseye base image for build image (backport release-3.2.x)' --body-file - --label 'size/M' --label 'type/build' --label 'type/docs' --label 'type/bug' --label 'backport' --base release-3.2.x --milestone release-3.2.x --web

Or, if you don't have the GitHub CLI installed (we recommend you install it!):

# Push the branch to GitHub:
git push --set-upstream origin backport-14368-to-release-3.2.x

# Create a pull request where the `base` branch is `release-3.2.x` and the `compare`/`head` branch is `backport-14368-to-release-3.2.x`.

# Remove the local backport branch
git switch main
git branch -D backport-14368-to-release-3.2.x

chaudum added a commit that referenced this pull request Oct 3, 2024
This change is necessary to allow the binaries built using the Loki build image to run on operating systems with older libc version.

---

Backport of #14368

Signed-off-by: Christian Haudum <[email protected]>
chaudum added a commit that referenced this pull request Oct 3, 2024
This change is necessary to allow the binaries built using the Loki build image to run on operating systems with older libc version.

---

Backport of #14368

Signed-off-by: Christian Haudum <[email protected]>
chaudum added a commit that referenced this pull request Oct 4, 2024
…in Promtail (#14387)

Backport of #14368 to 3.1.x release branch

Signed-off-by: Christian Haudum <[email protected]>
chaudum added a commit that referenced this pull request Oct 4, 2024
…in Promtail (#14386)

Backport of #14368 to 3.2.x release branch

Signed-off-by: Christian Haudum <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-3.1.x backport release-3.2.x backport-failed size/M type/bug Somehing is not working as expected type/build type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GLIBC version mismatch in Promtail binary
3 participants