Skip to content

Commit c67a534

Browse files
committed
build: Move from our own containerd to containerd.io
Let's migrate to the official containerd package from docker repository and no longer build and maintain our own containerd package. Due to this change, downgrade is not supported from 133 to 132, it could be possible to handle this case but it would require extra work to downgrade containerd and config before running the downgrade since "old" salt states cannot be used to perform this downgrade since `containerd.io` version we install "obsoletes" the `containerd` version we have in older version. That's why we decided to not support this downgrade path. Fixes: MK8S-151
1 parent 607a5c9 commit c67a534

File tree

22 files changed

+69
-914
lines changed

22 files changed

+69
-914
lines changed

.github/workflows/lifecycle-dev.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ jobs:
5858
needs:
5959
- get-dev-artifacts-url
6060
uses: ./.github/workflows/downgrade-test.yaml
61+
# NOTE: Downgrade is not supported from 133 to 132 (see CHANGELOG.md)
62+
# Should be removed in `development/134.0`
63+
if: ${{ ! startsWith(inputs.dev-branch, 'development/132') }}
6164
secrets: inherit
6265
with:
6366
from-artifacts-url: ${{ inputs.artifacts-url }}

.github/workflows/lifecycle-promoted.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ jobs:
208208

209209
promoted-downgrade:
210210
uses: ./.github/workflows/downgrade-test.yaml
211+
# NOTE: Downgrade is not supported from 133 to 132 (see CHANGELOG.md)
212+
# Should be removed in `development/134.0`
213+
if: ${{ ! startsWith(inputs.promoted-version, '132.') }}
211214
secrets: inherit
212215
with:
213216
from-artifacts-url: ${{ inputs.artifacts-url }}

.pylint-dict

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ scality
7878
sdk
7979
skopeo
8080
sls
81+
sosreport
8182
srv
8283
Thanos
8384
timestamp

BUMPING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ This guide is applied for both `metalk8s-operator` and `storage-operator`.
148148

149149
## Containerd
150150

151-
Instructions to bump Containerd version are in its [spec file](./packages/redhat/common/containerd.spec)
151+
The version just needs to be updated in `buildchain/buildchain/versions.py`.
152152

153153
## Update the sls state
154154

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,21 @@
22

33
## Release 133.0.0 (in development)
44

5+
### Breaking changes
6+
7+
- Due to the migration from our own RPM for containerd v1 to the official
8+
containerd.io RPM from docker.io, downgrading from 133 to 132 will not be
9+
possible.
10+
511
### Enhancements
612

713
- Bump Kubernetes version to [1.33.7](https://github.com/kubernetes/kubernetes/releases/tag/v1.33.7)
814
(PR[#4769](https://github.com/scality/metalk8s/pull/4769))
915

16+
- Move from our own RPM for containerd v1 to the official containerd.io RPM from docker.io
17+
to version [v2.2.2](https://github.com/containerd/containerd/releases/tag/v2.2.2)
18+
(PR[#4820](https://github.com/scality/metalk8s/pull/4820))
19+
1020
- Bump etcd version to [3.5.26](https://github.com/etcd-io/etcd/releases/tag/v3.5.26)
1121
(PR[#4769](https://github.com/scality/metalk8s/pull/4769))
1222

buildchain/buildchain/builder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def _builder_image(name: str, dockerfile: Path, **kwargs: Any) -> LocalImage:
5353
file_dep=[
5454
REDHAT_REPOS_ROOT / "kubernetes.repo",
5555
REDHAT_REPOS_ROOT / "saltstack.repo",
56+
REDHAT_REPOS_ROOT / "docker-ce.repo",
5657
],
5758
build_args={
5859
# Used to template the repository definition

buildchain/buildchain/packaging.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
┌─────────┐ │──────>│ build │──────>│ build │
2323
│ mkdir │──────>│ │ packages │ │ repositories │
2424
└─────────┘ └──────────┘ └──────────────┘
25-
(e.g: containerd) (e.g.: scality)
25+
(e.g.: sosreport) (e.g.: scality)
2626
"""
2727

2828

@@ -311,20 +311,6 @@ def _rpm_repository(
311311
)
312312

313313

314-
def _rpm_package_containerd(releasever: str) -> targets.RPMPackage:
315-
"""Containerd RPM package."""
316-
return _rpm_package(
317-
name="containerd",
318-
releasever=releasever,
319-
sources=[
320-
Path("0001-Revert-commit-for-Windows-metrics.patch"),
321-
Path("containerd.service"),
322-
Path("containerd.toml"),
323-
Path(f"v{versions.CONTAINERD_VERSION}.tar.gz"),
324-
],
325-
)
326-
327-
328314
def _rpm_package_metalk8s_sosreport(releasever: str) -> targets.RPMPackage:
329315
"""SOS report custom plugins RPM package."""
330316
return _rpm_package(
@@ -339,10 +325,7 @@ def _rpm_package_metalk8s_sosreport(releasever: str) -> targets.RPMPackage:
339325

340326
RPM_TO_BUILD: Dict[str, Dict[str, Tuple[targets.RPMPackage, ...]]] = {
341327
"scality": {
342-
"8": (
343-
_rpm_package_containerd("8"),
344-
_rpm_package_metalk8s_sosreport("8"),
345-
),
328+
"8": (_rpm_package_metalk8s_sosreport("8"),),
346329
},
347330
}
348331

@@ -381,6 +364,7 @@ def _rpm_package_metalk8s_sosreport(releasever: str) -> targets.RPMPackage:
381364
_rpm_repository(name="epel", releasever="8"),
382365
_rpm_repository(name="kubernetes", releasever="8"),
383366
_rpm_repository(name="saltstack", releasever="8"),
367+
_rpm_repository(name="docker-ce", releasever="8"),
384368
),
385369
}
386370

buildchain/buildchain/versions.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@
2727

2828
CALICO_VERSION: str = "3.29.3"
2929
SALT_VERSION: str = "3002.9"
30-
CONTAINERD_VERSION: str = "1.6.38"
30+
CONTAINERD_VERSION: str = "2.2.2"
3131

32-
CONTAINERD_RELEASE: str = "1"
3332
SOSREPORT_RELEASE: str = "2"
3433

3534

@@ -394,6 +393,7 @@ def rpm_full_name(self) -> str:
394393
# Pinned packages
395394
PackageVersion(name="kubectl", version=K8S_VERSION),
396395
PackageVersion(name="kubelet", version=K8S_VERSION),
396+
PackageVersion(name="containerd.io", version=CONTAINERD_VERSION),
397397
# Latest packages
398398
PackageVersion(name="coreutils"),
399399
PackageVersion(name="cri-tools"),
@@ -419,11 +419,6 @@ def rpm_full_name(self) -> str:
419419
),
420420
"redhat": {
421421
"8": (
422-
PackageVersion(
423-
name="containerd",
424-
version=CONTAINERD_VERSION,
425-
release=f"{CONTAINERD_RELEASE}.el8",
426-
),
427422
PackageVersion(name="container-selinux"),
428423
PackageVersion(name="iptables-ebtables", override="ebtables"),
429424
PackageVersion(

packages/redhat/8/Dockerfile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,3 @@ RUN dnf install -y --setopt=skip_missing_names_on_install=False \
3030
libseccomp-devel \
3131
&& \
3232
dnf clean all
33-
34-
# To build containerd
35-
RUN curl -ORL https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz \
36-
&& tar xzvf go${GO_VERSION}.linux-amd64.tar.gz \
37-
&& rm go${GO_VERSION}.linux-amd64.tar.gz \
38-
&& mv go /usr/local \
39-
&& ln -s $GOROOT/bin/go /usr/local/bin/go \
40-
&& ln -s $GOROOT/bin/gofmt /usr/local/bin/gofmt \
41-
&& go install github.com/cpuguy83/go-md2man/v2@v2.0.2 \
42-
&& ln -s $GOPATH/bin/go-md2man /usr/local/bin/go-md2man

packages/redhat/common/0001-Revert-commit-for-Windows-metrics.patch

Lines changed: 0 additions & 157 deletions
This file was deleted.

0 commit comments

Comments
 (0)