Skip to content

Commit f78ca9f

Browse files
authored
Migrate Earthly environments to newer supported distro images (#1148)
* Upgrade Earthfile VERSION to 0.8 * Remove unused OpenSUSE Leap distro * Remove Debian 9 and 10 * Remove Ubuntu 18.04 and 20.04 * Upgrade Alpine to latest release * Migrate CentOS to CentOS Stream * Migrate Rocky Linux to AlmaLinux * Migrate Amazon Linux to latest version * Migrate all Earthly tasks to ubuntu2404(-arm64)-latest EVG distros * Fix and improve consistency of RHEL stand-ins
1 parent 9b72f0c commit f78ca9f

6 files changed

Lines changed: 54 additions & 197 deletions

File tree

.evergreen/config.yml

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ tasks:
11901190
else
11911191
srcdir="libmongocrypt_download"
11921192
fi
1193-
1193+
11941194
# Move headers
11951195
mkdir libmongocrypt_upload/include
11961196
mv $srcdir/include/mongocrypt libmongocrypt_upload/include
@@ -2020,23 +2020,23 @@ buildvariants:
20202020
- benchmark-python
20212021

20222022
- name: alpine-amd64-earthly
2023-
display_name: "Alpine Linux 3.18 amd64 (via Earthly)"
2023+
display_name: "Alpine Linux 3.23 amd64 (via Earthly)"
20242024
expansions:
20252025
earthly_env: alpine
20262026
release_os_arch: linux-x86_64-musl_1_2-nocrypto
20272027
tasks:
20282028
- name: build-with-earthly
2029-
run_on: ubuntu2204-small
2029+
run_on: ubuntu2404-latest-large
20302030
- name: upload-release
20312031
depends_on: build-with-earthly
20322032

20332033
- name: alpine-arm64-earthly
2034-
display_name: "Alpine Linux 3.18 arm64 (via Earthly)"
2034+
display_name: "Alpine Linux 3.23 arm64 (via Earthly)"
20352035
expansions:
20362036
earthly_env: alpine
20372037
tasks:
20382038
- name: build-with-earthly
2039-
run_on: ubuntu2204-arm64-small
2039+
run_on: ubuntu2404-arm64-latest-large
20402040

20412041
- name: debian11-arm64-earthly
20422042
display_name: "Debian 11 arm64 (via Earthly)"
@@ -2047,10 +2047,10 @@ buildvariants:
20472047
tasks:
20482048
- name: build-deb-packages-with-earthly
20492049
# Use an arm64 distro to match the intended target architecture of .deb packages.
2050-
run_on: ubuntu2204-arm64-small
2050+
run_on: ubuntu2404-arm64-latest-large
20512051
- name: publish-deb-packages-with-earthly
20522052
# Use a distro suitable for running curator to publish .deb packages.
2053-
run_on: ubuntu2004-small
2053+
run_on: ubuntu2404-latest-small
20542054

20552055
- name: debian13-arm64-earthly
20562056
display_name: "Debian 13 arm64 (via Earthly)"
@@ -2062,10 +2062,10 @@ buildvariants:
20622062
tasks:
20632063
- name: build-deb-packages-with-earthly
20642064
# Use an arm64 distro to match the intended target architecture of .deb packages.
2065-
run_on: ubuntu2204-arm64-small
2065+
run_on: ubuntu2404-arm64-latest-large
20662066
- name: publish-deb-packages-with-earthly
20672067
# Use a distro suitable for running curator to publish .deb packages.
2068-
run_on: ubuntu2004-small
2068+
run_on: ubuntu2404-latest-small
20692069

20702070
- name: debian12-arm64-earthly
20712071
display_name: "Debian 12 arm64 (via Earthly)"
@@ -2076,38 +2076,10 @@ buildvariants:
20762076
tasks:
20772077
- name: build-deb-packages-with-earthly
20782078
# Use an arm64 distro to match the intended target architecture of .deb packages.
2079-
run_on: ubuntu2204-arm64-small
2080-
- name: publish-deb-packages-with-earthly
2081-
# Use a distro suitable for running curator to publish .deb packages.
2082-
run_on: ubuntu2004-small
2083-
2084-
- name: debian10-arm64-earthly
2085-
display_name: "Debian 10 arm64 (via Earthly)"
2086-
expansions:
2087-
packager_distro: debian10
2088-
packager_arch: arm64
2089-
earthly_env: deb10
2090-
tasks:
2091-
- name: build-deb-packages-with-earthly
2092-
# Use an arm64 distro to match the intended target architecture of .deb packages.
2093-
run_on: ubuntu2204-arm64-small
2094-
- name: publish-deb-packages-with-earthly
2095-
# Use a distro suitable for running curator to publish .deb packages.
2096-
run_on: ubuntu2004-small
2097-
2098-
- name: debian9-arm64-earthly
2099-
display_name: "Debian 9 arm64 (via Earthly)"
2100-
expansions:
2101-
packager_distro: debian92
2102-
packager_arch: arm64
2103-
earthly_env: deb9
2104-
tasks:
2105-
- name: build-deb-packages-with-earthly
2106-
# Use an arm64 distro to match the intended target architecture of .deb packages.
2107-
run_on: ubuntu2204-arm64-small
2079+
run_on: ubuntu2404-arm64-latest-large
21082080
- name: publish-deb-packages-with-earthly
21092081
# Use a distro suitable for running curator to publish .deb packages.
2110-
run_on: ubuntu2004-small
2082+
run_on: ubuntu2404-latest-small
21112083

21122084
- name: sbom
21132085
display_name: SBOM

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
removed. Users that need the static MSVCRT library should instead set the
2222
[`CMAKE_MSVC_RUNTIME_LIBRARY`][msvcrt] built-in CMake parameter when
2323
configuring libmongocrypt.
24+
- Packages for Debian 9 and Debian 10.
2425

2526
[msvcrt]: https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
2627

Earthfile

Lines changed: 37 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
# the cache.
2222
#
2323
# This file has a few major sections:
24-
# - Setup COMMANDs
25-
# - Utility COMMANDs
24+
# - Setup FUNCTIONs
25+
# - Utility FUNCTIONs
2626
# - Environment targets
2727
# - Build/test/CI targets
2828
#
@@ -33,23 +33,16 @@
3333
# and can be used i.e. "earthly +build --env=u22"
3434
#
3535
# The following environment are defined in this file:
36+
# • u24 - Ubuntu 24.04
3637
# • u22 - Ubuntu 22.04
37-
# • u20 - Ubuntu 20.04
38-
# • u18 - Ubuntu 18.04
39-
# • u16 - Ubuntu 16.04
40-
# • u14 - Ubuntu 14.04
41-
# • rl8 - RockyLinux 8 - Stand-in for RHEL 8
42-
# • c7 - CentOS 7 - Stand-in for RHEL 7
43-
# • c6 - CentOS 6 - Stand-in for RHEL 6
44-
# • amzn1 - AmazonLinux (2018.03)
45-
# • amzn2 - AmazonLinux 2
46-
# • deb9 - Debian 9.2
47-
# • deb10 - Debian 10.0
38+
# • c10 - CentOS Stream 10 - Stand-in for RHEL 10
39+
# • c9 - CentOS Stream 9 - Stand-in for RHEL 9
40+
# • alma8 - AlmaLinux 8 - Stand-in for RHEL 8
41+
# • amzn2023 - AmazonLinux 2023
4842
# • deb11 - Debian 11.0
4943
# • deb12 - Debian 12.0
5044
# • deb13 - Debian 13
51-
# • sles15 - OpenSUSE Leap 15.0
52-
# • alpine - Alpine Linux 3.18
45+
# • alpine - Alpine Linux 3.23
5346
#
5447
# When adding new environments, prefer an unqualified image ID with a version:
5548
# • DO NOT: "ubuntu"
@@ -59,8 +52,8 @@
5952
# Use of an unqualified image ID may enable separate registry in CI and local development.
6053
# ###
6154

62-
VERSION --use-cache-command 0.6
63-
FROM alpine:3.16
55+
VERSION 0.8
56+
FROM alpine:3.23
6457
WORKDIR /s
6558

6659
init:
@@ -82,128 +75,75 @@ init:
8275

8376
DEBIAN_SETUP:
8477
# Setup for a debian-like build environment. Used for both Debian and Ubuntu
85-
COMMAND
78+
FUNCTION
8679
RUN __install build-essential g++ libssl-dev curl unzip python3 pkg-config \
8780
git ccache findutils ca-certificates
8881

8982
REDHAT_SETUP:
90-
# Setup for a redhat-like build environment. Used for CentOS and RockyLinux.
91-
COMMAND
83+
# Setup for a redhat-like build environment. Used for CentOS Stream and AlmaLinux.
84+
FUNCTION
9285
RUN __install epel-release && \
9386
__install gcc-c++ make openssl-devel curl unzip git ccache findutils \
9487
patch
9588

96-
CENTOS6_SETUP:
97-
# Special setup for CentOS6: The packages have been moved to the vault, so
98-
# we need to enable the vault repos before we perform any __installs
99-
COMMAND
100-
RUN rm /etc/yum.repos.d/*.repo
101-
COPY etc/c6-vault.repo /etc/yum.repos.d/CentOS-Base.repo
102-
DO +REDHAT_SETUP
103-
10489
AMZ_SETUP:
10590
# Setup for Amazon Linux.
106-
COMMAND
107-
# amzn1 has "python38", but amzn2 has "python3." Try both
108-
RUN __install python3 || __install python38
91+
FUNCTION
10992
RUN __install gcc-c++ make openssl-devel curl unzip tar gzip \
11093
openssh-clients patch git
11194

112-
SLES_SETUP:
113-
# Setup for a SLES/SUSE build environment
114-
COMMAND
115-
RUN __install gcc-c++ make libopenssl-devel curl unzip tar gzip python3 \
116-
patch git xz which
117-
11895
ALPINE_SETUP:
11996
# Setup for an Alpine Linux build environment
120-
COMMAND
97+
FUNCTION
12198
RUN __install make bash gcc g++ unzip curl tar gzip git musl-dev \
12299
linux-headers openssl-dev python3
123100

124101
# Environment targets are defined below. These do not have build outputs, but
125102
# are rather themselves the "outputs" to be used as the environment for subsequent
126103
# tasks
127104

128-
env.c6:
129-
# A CentOS 6 environment.
130-
FROM +init --base=centos:6
131-
DO +CENTOS6_SETUP
105+
env.c9:
106+
# Use CentOS Stream 9 as a stand-in for RHEL 9
107+
FROM +init --base=quay.io/centos/centos:stream9
108+
DO +REDHAT_SETUP
132109

133-
env.c7:
134-
# A CentOS 7 environment.
135-
FROM +init --base=centos:7
110+
env.c10:
111+
# Use CentOS Stream 10 as a stand-in for RHEL 10
112+
FROM +init --base=quay.io/centos/centos:stream10
136113
DO +REDHAT_SETUP
137114

138-
env.rl8:
139-
# CentOS 8 is cancelled. Use RockyLinux 8 for our RHEL 8 environment.
140-
FROM +init --base=rockylinux:8
115+
env.alma8:
116+
# Use AlmaLinux 8 as a stand-in for RHEL 8
117+
FROM +init --base=almalinux:8
141118
DO +REDHAT_SETUP
142119

143120
# Utility command for Ubuntu environments
144121
ENV_UBUNTU:
145-
COMMAND
122+
FUNCTION
146123
ARG --required version
147124
FROM +init --base=ubuntu:$version
148125
DO +DEBIAN_SETUP
149126

150-
env.u14:
151-
# An Ubuntu 14.04 environment
152-
DO +ENV_UBUNTU --version 14.04
153-
154-
env.u16:
155-
# An Ubuntu 16.04 environment
156-
DO +ENV_UBUNTU --version 16.04
157-
158-
env.u18:
159-
# An Ubuntu 18.04 environment
160-
DO +ENV_UBUNTU --version 18.04
161-
162-
env.u20:
163-
# An Ubuntu 20.04 environment
164-
DO +ENV_UBUNTU --version 20.04
165-
166127
env.u22:
167128
# An Ubuntu 22.04 environment
168129
DO +ENV_UBUNTU --version 22.04
169130

170-
env.amzn1:
171-
# An Amazon "1" environment. (AmazonLinux 2018)
172-
FROM +init --base=amazonlinux:2018.03
173-
DO +AMZ_SETUP
131+
env.u24:
132+
# An Ubuntu 24.04 environment
133+
DO +ENV_UBUNTU --version 24.04
174134

175-
env.amzn2:
176-
# An AmazonLinux 2 environment
177-
FROM +init --base=amazonlinux:2
135+
env.amzn2023:
136+
# An Amazon "2023" environment. (AmazonLinux 2023)
137+
FROM +init --base=amazonlinux:2023
178138
DO +AMZ_SETUP
179139

180140
# Utility command for Debian setup
181141
ENV_DEBIAN:
182-
COMMAND
142+
FUNCTION
183143
ARG --required version
184144
FROM +init --base=debian:$version
185-
IF [ $version = "9.2" ]
186-
# Update source list for archived Debian stretch packages.
187-
# Refer: https://unix.stackexchange.com/a/743865/260858
188-
RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list
189-
# Trust newer Debian signing keys to avoid "unauthenticated packages" error:
190-
COPY +get-deb-signing-keys/keys/deb10-archive-signing-key.gpg /etc/apt/trusted.gpg.d
191-
COPY +get-deb-signing-keys/keys/deb11-archive-signing-key.gpg /etc/apt/trusted.gpg.d
192-
END
193-
IF [ $version = "10.0" ]
194-
# Update source list for archived Debian buster packages.
195-
RUN echo "deb http://archive.debian.org/debian buster main" > /etc/apt/sources.list
196-
END
197145
DO +DEBIAN_SETUP
198146

199-
env.deb9:
200-
# A Debian 9.2 environment
201-
DO +ENV_DEBIAN --version 9.2
202-
203-
env.deb10:
204-
# A Debian 10.0 environment
205-
DO +ENV_DEBIAN --version 10.0
206-
207147
env.deb-unstable:
208148
DO +ENV_DEBIAN --version=unstable
209149

@@ -219,19 +159,14 @@ env.deb13:
219159
# A Debian 13 environment
220160
DO +ENV_DEBIAN --version 13.0
221161

222-
env.sles15:
223-
# An OpenSUSE Leap 15.0 environment.
224-
FROM +init --base=opensuse/leap:15.0
225-
DO +SLES_SETUP
226-
227162
env.alpine:
228-
FROM +init --base=alpine:3.18
163+
FROM +init --base=alpine:3.23
229164
DO +ALPINE_SETUP
230165

231166
# Utility: Warm-up obtaining CMake and Ninja for the build. This is usually
232167
# very quick, but on some platforms we need to compile them from source.
233168
CACHE_WARMUP:
234-
COMMAND
169+
FUNCTION
235170
# Copy only the scripts that are strictly necessary for the operation, to
236171
# avoid cache invalidation later on.
237172
COPY .evergreen/setup-env.sh \
@@ -246,7 +181,7 @@ CACHE_WARMUP:
246181
bash /T/ensure-ninja.sh
247182

248183
COPY_SOURCE:
249-
COMMAND
184+
FUNCTION
250185
COPY --dir \
251186
.git/ \
252187
cmake/ \
@@ -263,7 +198,7 @@ COPY_SOURCE:
263198
COPY --dir bindings/cs/ "/s/libmongocrypt/bindings/"
264199

265200
BUILD_EXAMPLE_STATE_MACHINE:
266-
COMMAND
201+
FUNCTION
267202
COPY test/example-state-machine.c /s/
268203
RUN pkg-config --exists libmongocrypt --print-errors && \
269204
gcc /s/example-state-machine.c \
@@ -379,19 +314,6 @@ check-format:
379314
COPY --dir .clang-format src test /X/
380315
RUN /X/etc/format-all.sh --dry-run -Werror --verbose
381316

382-
get-deb-signing-keys:
383-
FROM +env.deb12
384-
RUN __install gpg
385-
# Get "Debian 10/buster archive signing key"
386-
RUN gpg --keyserver keyserver.ubuntu.com --recv-keys 80D15823B7FD1561F9F7BCDDDC30D7C23CBBABEE
387-
RUN gpg --export 80D15823B7FD1561F9F7BCDDDC30D7C23CBBABEE > deb10-archive-signing-key.gpg
388-
SAVE ARTIFACT deb10-archive-signing-key.gpg /keys/
389-
390-
# Import "Debian 11/bullseye archive signing key"
391-
RUN gpg --keyserver keyserver.ubuntu.com --recv-keys 1F89983E0081FDE018F3CC9673A4F27B8DD47936
392-
RUN gpg --export 1F89983E0081FDE018F3CC9673A4F27B8DD47936 > deb11-archive-signing-key.gpg
393-
SAVE ARTIFACT deb11-archive-signing-key.gpg /keys/
394-
395317
# The main "build" target. Options:
396318
# • --env=[...] (default "u22")
397319
# · Set the environment for the build. Any name of and "env.<name>" targets

0 commit comments

Comments
 (0)