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

Stop crossbuilding using Debian 8 #34921

Merged
merged 3 commits into from
Mar 27, 2023
Merged

Conversation

rdner
Copy link
Member

@rdner rdner commented Mar 24, 2023

What does this PR do?

The GPG keys are expired and the main repository has been moved to the archive. We should start building for the more recent version of Debian.

According to our support matrix https://www.elastic.co/support/matrix we don't support Debian < 10 since 8.4.

Why is it important?

We cannot build snapshots right now:

06:29:52 Status: Downloaded newer image for docker.elastic.co/beats-dev/golang-crossbuild:1.18.10-main-debian8
06:29:58 >> Building using: cmd='build/mage-linux-amd64 golangCrossBuild', env=[CC=gcc, CXX=g++, GOARCH=386, GOARM=, GOOS=linux, PLATFORM_ID=linux-386]
06:29:58 >> Building using: cmd='build/mage-linux-amd64 golangCrossBuild', env=[CC=gcc, CXX=g++, GOARCH=amd64, GOARM=, GOOS=linux, PLATFORM_ID=linux-amd64]
06:30:05 W: GPG error: http://archive.debian.org/ jessie Release: The following signatures were invalid: KEYEXPIRED 1587841717
06:30:05 W: Failed to fetch http://security.debian.org/debian-security/dists/jessie/updates/main/binary-amd64/Packages  404  Not Found [IP: 151.101.194.132 80]
06:30:05 
06:30:05 W: Failed to fetch http://security.debian.org/debian-security/dists/jessie/updates/main/binary-i386/Packages  404  Not Found [IP: 151.101.194.132 80]
06:30:05 
06:30:05 E: Some index files failed to download. They have been ignored, or old ones used instead.
06:30:05 Error: running "apt-get update" failed with exit code 100
06:30:05 Error: failed building for linux/386: exit status 100
06:30:05 failed building for linux/386: exit status 100
06:30:05 W: GPG error: http://archive.debian.org/ jessie Release: The following signatures were invalid: KEYEXPIRED 1587841717
06:30:05 W: Failed to fetch http://security.debian.org/debian-security/dists/jessie/updates/main/binary-amd64/Packages  404  Not Found [IP: 151.101.66.132 80]
06:30:05 
06:30:05 W: Failed to fetch http://security.debian.org/debian-security/dists/jessie/updates/main/binary-i386/Packages  404  Not Found [IP: 151.101.66.132 80]
06:30:05 
06:30:05 E: Some index files failed to download. They have been ignored, or old ones used instead.
06:30:05 Error: running "apt-get update" failed with exit code 100
06:30:05 Error: failed building for linux/amd64: exit status 100
06:30:05 failed building for linux/amd64: exit status 100

https://internal-ci.elastic.co/job/elastic+unified-release+master+snapshot-multijob-7.17/361/display/redirect

How to test locally

In Filebeat run:

mage package

The GPG keys are expired and we should start building for the more
recent version of Debian.
@rdner rdner added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team backport-v7.17.0 Automated backport with mergify backport-v8.7.0 Automated backport with mergify labels Mar 24, 2023
@rdner rdner self-assigned this Mar 24, 2023
@rdner rdner requested a review from a team as a code owner March 24, 2023 10:57
@rdner rdner requested review from ycombinator and faec and removed request for a team March 24, 2023 10:57
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Mar 24, 2023
@rdner
Copy link
Member Author

rdner commented Mar 24, 2023

elasticsearch-ci/docs failure is a known issue related to https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/

@belimawr belimawr self-requested a review March 24, 2023 11:20
// Use an older version of libc to gain greater OS compatibility.
// Debian 8 uses glibc 2.19.
tagSuffix = "main-debian8"
tagSuffix = "main-debian10"
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the main reason for using the older Debian was to build with an older version of libc. Perhaps we could use a newer version of Debian but also downgrade glibc to 2.19 (not sure if this is possible)? If possible, I think the downgrade would happen somewhere in https://github.com/elastic/golang-crossbuild/blob/main/go/base/Dockerfile.tmpl.

Copy link
Member Author

Choose a reason for hiding this comment

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

If this works #34922 I'm going to close this PR. The risk is high, as you mentioned.

Copy link
Member Author

Choose a reason for hiding this comment

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

according to our support matrix https://www.elastic.co/support/matrix we don't support Debian < 10 since 8.4, however 7.17 still on Debian 8,9,10.

So, I think we can actually merge this to main and 8.7 but we cannot backport it to 7.17.

Copy link
Member

Choose a reason for hiding this comment

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

cc @andrewkroh , I recall you mentioned something in the past about backward compatibility, do you happen to know whether this PR could cause any issues? Or the underline problem was already solved?

Copy link
Member

Choose a reason for hiding this comment

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

This PR did cause similar problems. I detailed it in #34938 (comment) and I fixed the Packetbeat build. I added tests such that we now have tests in place that check that {File,Audit,Packet,Metric}beat are all compatible with glibc version shipped with RHEL 7.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 24, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-03-24T16:53:08.776+0000

  • Duration: 11 min 46 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@rdner
Copy link
Member Author

rdner commented Mar 24, 2023

I'll try a safer option first #34922

@rdner rdner removed the backport-v7.17.0 Automated backport with mergify label Mar 24, 2023
@rdner rdner changed the base branch from main to 7.17 March 24, 2023 16:51
@rdner rdner requested review from a team as code owners March 24, 2023 16:51
@rdner rdner requested review from blakerouse and removed request for a team March 24, 2023 16:51
@rdner
Copy link
Member Author

rdner commented Mar 24, 2023

Sorry for extra pings everyone, I changed base on a wrong PR.

@rdner
Copy link
Member Author

rdner commented Mar 27, 2023

I tried to use the archived repositories for Debian 8 in #34922 but didn't succeed – the dependencies cannot be resolved for the packages we need.

The only option left for us is to manually find these packages for all required architectures and make a custom image for our CI. I'm not sure it's worth the trouble.

I think we should just switch to Debian 10 for both 8.x and 7.17.

For 8.7 there is no impact, the Beats support matrix already says that we support Debian >= 10 starting with 8.4.

But our 7.17 version still claims support for Debian >= 8. – which we cannot guarantee after switching 7.17 to Debian 10 because of libc compatibility issues in the past.

Debian 8 was released in April 2015 and its end of life was scheduled to be in June 2022.

It's actually surprising that the repositories were available for so long after reaching the end of life.

Debian 10 was released in July 2019 and its end of life is scheduled on June 30th, 2024.

Screenshot 2023-03-27 at 09 51 32

Source https://wiki.debian.org/LTS

cc @pierrehilbert @nimarezainia @cmacknz

@rdner rdner requested review from cmacknz and joshdover and removed request for belimawr March 27, 2023 14:48
@rdner rdner added the backport-v8.6.0 Automated backport with mergify label Mar 27, 2023
@rdner rdner merged commit 5e71fe7 into elastic:main Mar 27, 2023
@rdner rdner deleted the update-crossbuild-debian branch March 27, 2023 16:09
mergify bot pushed a commit that referenced this pull request Mar 27, 2023
The GPG keys are expired and we should start building for the more
recent version of Debian.

(cherry picked from commit 5e71fe7)
mergify bot pushed a commit that referenced this pull request Mar 27, 2023
The GPG keys are expired and we should start building for the more
recent version of Debian.

(cherry picked from commit 5e71fe7)
@andrewkroh
Copy link
Member

According to our support matrix https://www.elastic.co/support/matrix we don't support Debian < 10 since 8.4.

@rdner I see some Debian 8 check marks on the matrix. I'm was looking at the impact of this in #34938 (comment) and we have a problem because some Beats won't run.

Screenshot 2023-03-27 at 18 06 46

@nimarezainia
Copy link
Contributor

@andrewkroh thanks for pointing this out. copying @jlind23 also. Unfortunately I think the Metricbeat you highlight above may be erroneous. At 8.0 we removed Debian 8 from the matrix. This should have applied to Metricbeat also. Even though I am struggling to find the email trail for this, I'm certain Metricbeat would have been a part of that decision.

@nimarezainia
Copy link
Contributor

@rdner & @pierrehilbert if we can't make this work for 7.17 we can drop support for it in the next 7.17 release and I will make that obvious in a foot note.

@rdner
Copy link
Member Author

rdner commented Mar 28, 2023

@nimarezainia @pierrehilbert backporting #34939 into 7.17 should solve it for now.

However, I saw some issues with Packetbeat running on a new version of libc here #34943 (8.x versions)

Not sure how we're going to resolve it and whether it's an issue for 7.17 as well.

Thanks @andrewkroh for bringing more context and for the fix!

@nimarezainia
Copy link
Contributor

@rdner so are you saying that 7.17 is good on Debian 8?

@rdner
Copy link
Member Author

rdner commented Mar 29, 2023

@nimarezainia I believe so. It's unclear with Packetbeat at the moment but it should be okay.

It's good for now but we should schedule a switch to Debian 10 in near future. Perhaps 7.18?

andrewkroh added a commit that referenced this pull request Mar 29, 2023
Check the minimum required glibc on cross-build artifacts. This is a precautionary
check to ensure binaries are aligned the current OS support matrix (https://www.elastic.co/support/matrix).

Relates #34938

* {packetbeat,x-pack/packetbeat}

Use debian9 crossbuild image for linux/386 because the change in elastic/beats##34921 broke support for older operating systems.

* Fix golangci-lint warnings

pkg.go:230:6: func `updateWithDarwinUniversal` is unused (unused)

various: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)

import of package `github.com/pkg/errors` is blocked (gomodguard)
@nimarezainia
Copy link
Contributor

@rdner 7.18?? :-)

@rdner
Copy link
Member Author

rdner commented Mar 30, 2023

@nimarezainia I mean I have no idea if we're going to release another minor 7.x, we just need to plan this drop at some point in the future, I suppose you'd know better when is the best time :)

chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
The GPG keys are expired and we should start building for the more
recent version of Debian.
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
Check the minimum required glibc on cross-build artifacts. This is a precautionary
check to ensure binaries are aligned the current OS support matrix (https://www.elastic.co/support/matrix).

Relates #34938

* {packetbeat,x-pack/packetbeat}

Use debian9 crossbuild image for linux/386 because the change in elastic/beats##34921 broke support for older operating systems.

* Fix golangci-lint warnings

pkg.go:230:6: func `updateWithDarwinUniversal` is unused (unused)

various: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)

import of package `github.com/pkg/errors` is blocked (gomodguard)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.6.0 Automated backport with mergify backport-v8.7.0 Automated backport with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants