Skip to content

fix(build): Use Debian Bullseye base image for build image - #14368

Merged
chaudum merged 5 commits into
mainfrom
chaudum/use-bullseye-build-image
Oct 3, 2024
Merged

fix(build): Use Debian Bullseye base image for build image#14368
chaudum merged 5 commits into
mainfrom
chaudum/use-bullseye-build-image

Conversation

@chaudum

@chaudum chaudum commented Oct 3, 2024

Copy link
Copy Markdown
Contributor

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

loki-gh-app Bot commented Oct 3, 2024

Copy link
Copy Markdown
Contributor

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

loki-gh-app Bot commented Oct 3, 2024

Copy link
Copy Markdown
Contributor

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 <christian.haudum@gmail.com>
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
@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

loki-gh-app Bot commented Oct 3, 2024

Copy link
Copy Markdown
Contributor

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

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
@pull-request-size pull-request-size Bot added size/M and removed size/S labels Oct 3, 2024

@vlad-diachenko vlad-diachenko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
@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 <christian.haudum@gmail.com>
@chaudum
chaudum merged commit 3beb8ff into main Oct 3, 2024
@chaudum
chaudum deleted the chaudum/use-bullseye-build-image branch October 3, 2024 18:30
@loki-gh-app

loki-gh-app Bot commented Oct 3, 2024

Copy link
Copy Markdown
Contributor

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

loki-gh-app Bot commented Oct 3, 2024

Copy link
Copy Markdown
Contributor

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 <christian.haudum@gmail.com>
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 <christian.haudum@gmail.com>
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 <christian.haudum@gmail.com>
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 <christian.haudum@gmail.com>
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

3 participants