-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Replace RHEL 7 with CBL-Mariner #1373
Conversation
RHEL 7 is going out of support entirely in June. Additionally, we are being required by internal partners to turn on a bunch of build system validation incapable of running on extremely old RHEL 7. This change replaces use of RHEL 7 with CBL-Mariner 2.0 ( https://github.com/microsoft/AzureLinux ), with a few dependent libraries from extremely old Ubuntu 16.04. This enables use of modern build tools and a modern host OS, consuming as little as possible from the ancient universe we must maintain to keep Linux binaries working for most of our customers. This infrastructure is largely walking in the footsteps of the .NET team, see their write-ups https://github.com/dotnet/dotnet-buildtools-prereqs-docker and https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/linux-instructions.md . However, we are not using their from-source clang implementation, instead using the gcc that comes with cbl-mariner. The contents of the new Dockerfile are largely based on https://github.com/dotnet/arcade/blob/main/eng/common/cross/build-rootfs.sh , and the toolchain is largely based on https://github.com/dotnet/arcade/blob/main/eng/common/cross/toolchain.cmake . I validated that the dependencies of vcpkg are the same before and after. From within the container: ```console root [ /build ]# curl -L -o before https://github.com/microsoft/vcpkg-tool/releases/download/2024-03-14/vcpkg-glibc % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 7005k 100 7005k 0 0 8620k 0 --:--:-- --:--:-- --:--:-- 47.5M root [ /build ]# ldd before ldd: warning: you do not have execution permission for `./before' linux-vdso.so.1 (0x00007ffd9155b000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007faae0975000) libm.so.6 => /lib/libm.so.6 (0x00007faae088f000) libc.so.6 => /lib/libc.so.6 (0x00007faae068d000) /lib64/ld-linux-x86-64.so.2 (0x00007faae097f000) root [ /build ]# ldd vcpkg linux-vdso.so.1 (0x00007ffe62b71000) libm.so.6 => /lib/libm.so.6 (0x00007fe75e236000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007fe75e231000) libc.so.6 => /lib/libc.so.6 (0x00007fe75e02f000) /lib64/ld-linux-x86-64.so.2 (0x00007fe75e996000) root [ /build ]# ``` This also uses docker a bit better than before. Rather than minting a whole new container image containing the sources, now we just mount the sources in the right place.
# 3. Verify keyrings | ||
pushd ubuntu-keyring-2021.03.26 && \ | ||
gpg --keyring /dimitri_john_ledkov.gpg --output SHA512SUMS.txt --decrypt SHA512SUMS.txt.asc && \ | ||
rm /dimitri_john_ledkov.gpg && \ | ||
sha512sum -c SHA512SUMS.txt && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems way excessive since we're SHA256-pinning the download above. Can we remove this and avoid checking in the .asc file?
# https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/linux-instructions.md | ||
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 | ||
|
||
RUN tdnf install -y \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[suggestion, not required]
When using apt, best practices are usually to:
- Fetch new indexes
- Install packages
- Delete cached indexes
This is all done in a single RUN step to minimize the size of the produced image.
Is something similar we should be doing for tdnf?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yum (and dnf (and tdnf)), to my understanding, does not have separate fetch indexes / install commands
Demonstration Build: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=9306853&view=results
We are being obligated to change our build environment for official releases to move away from RHEL 7.
This change replaces use of RHEL 7 with CBL-Mariner 2.0 ( https://github.com/microsoft/AzureLinux ), with a few dependent libraries from extremely old Ubuntu 16.04. This enables use of modern build tools and a modern host OS, consuming as little as possible from the ancient universe we must maintain to keep Linux binaries working for most of our customers.
This infrastructure is largely walking in the footsteps of the .NET team, see their write-ups https://github.com/dotnet/dotnet-buildtools-prereqs-docker and https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/linux-instructions.md . However, we are not using their from-source clang implementation, instead using the gcc that comes with cbl-mariner.
The contents of the new Dockerfile are largely based on https://github.com/dotnet/arcade/blob/main/eng/common/cross/build-rootfs.sh , and the toolchain is largely based on https://github.com/dotnet/arcade/blob/main/eng/common/cross/toolchain.cmake .
I validated that the dependencies of vcpkg are the same before and after. From within the container:
This also uses docker a bit better than before. Rather than minting a whole new container image containing the sources, now we just mount the sources in the right place.
This makes all infrastructure changes necessary to onboard 1ES Pipeline Templates.