Skip to content

Commit

Permalink
buildchain,image: Rework metalk8s-utils to use Rocky 9 minimal
Browse files Browse the repository at this point in the history
  • Loading branch information
TeddyAndrieux committed Nov 8, 2024
1 parent 837577c commit 9ff6c7d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 44 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
- Bump prometheus-operator and prometheus-config-reloader containers version to
[0.77.2](https://github.com/prometheus-operator/prometheus-operator/releases/tag/v0.77.2)

- Move metalk8s-utils image to Rocky 9 minimal
(PR[#4471](https://github.com/scality/metalk8s/pull/4471))

## Release 128.0.1 (in development)

## Release 128.0.0
Expand Down
3 changes: 1 addition & 2 deletions buildchain/buildchain/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,12 @@ def _local_image(name: str, **kwargs: Any) -> targets.LocalImage:
name="metalk8s-utils",
build_args={
"BASE_IMAGE": versions.ROCKY_BASE_IMAGE,
"BASE_IMAGE_SHA256": versions.ROCKY_BASE_IMAGE_SHA256,
"BASE_IMAGE_SHA256": versions.ROCKY_BASE_IMAGE_9_SHA256,
"BUILD_DATE": datetime.datetime.now(datetime.timezone.utc)
.astimezone()
.isoformat(),
"VCS_REF": constants.GIT_REF or "<unknown>",
"METALK8S_VERSION": versions.VERSION,
"SALT_VERSION": versions.SALT_VERSION,
"K8S_SHORT_VERSION": versions.K8S_SHORT_VERSION,
"K8S_VERSION": versions.K8S_VERSION,
"ETCD_VERSION": f"v{versions.ETCD_VERSION}",
Expand Down
10 changes: 7 additions & 3 deletions buildchain/buildchain/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ def load_version_information() -> None:
# }}}
# Container images {{{

ROCKY_BASE_IMAGE: str = "docker.io/rockylinux"
ROCKY_BASE_IMAGE: str = "docker.io/rockylinux/rockylinux"
ROCKY_BASE_IMAGE_SHA256: str = (
# rockylinux:8.9.20231119
"c464612ef7e3d54d658c3eaa4778b5cdc990ec7a4d9ab63b0f00c9994c6ce980"
# rockylinux:8.10
"e8a49c5403b687db05d4d67333fa45808fbe74f36e683cec7abb1f7d0f2338c6"
)
ROCKY_BASE_IMAGE_9_SHA256: str = (
# rockylinux:9.4-minimal
"46a4a83a607bf0f86a5882a857ea4ed757a5f67eae938a29b9b4e86b21f241dd"
)

ETCD_VERSION: str = "3.5.15"
Expand Down
32 changes: 16 additions & 16 deletions images/metalk8s-utils/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@ FROM $BASE_IMAGE@sha256:$BASE_IMAGE_SHA256
# Kubernetes version
ARG K8S_SHORT_VERSION
ARG K8S_VERSION
# Salt version
ARG SALT_VERSION
# Etcd version
ARG ETCD_VERSION

COPY configure-repos.sh /
RUN /configure-repos.sh "$K8S_SHORT_VERSION" "$SALT_VERSION" && rm /configure-repos.sh

# Timestamp of the build, formatted as RFC3339
ARG BUILD_DATE
# Git revision o the tree at build time
Expand Down Expand Up @@ -54,10 +49,17 @@ LABEL maintainer="[email protected]" \
com.scality.metalk8s.version="$METALK8S_VERSION"

# Final layers, installing tooling
RUN dnf clean expire-cache && \
dnf update -y && \
dnf install -y epel-release && \
dnf install -y \
RUN printf "[kubernetes]\n\
name=Kubernetes\n\
baseurl=https://pkgs.k8s.io/core:/stable:/v%s/rpm/\n\
enabled=1\n\
gpgcheck=1\n\
gpgkey=https://pkgs.k8s.io/core:/stable:/v%s/rpm/repodata/repomd.xml.key\n" \
${K8S_SHORT_VERSION} ${K8S_SHORT_VERSION} >/etc/yum.repos.d/kubernetes.repo && \
microdnf clean all && \
microdnf update -y && \
microdnf install -y epel-release && \
microdnf install -y --enablerepo=crb \
bash-completion \
bind-utils \
bzip2 \
Expand Down Expand Up @@ -95,28 +97,26 @@ RUN dnf clean expire-cache && \
openssh-server \
openssl \
parted \
perf \
qperf \
rsync \
salt-master \
salt-minion \
screen \
socat \
strace \
sysstat \
tar \
tcpdump \
telnet \
tmux \
traceroute \
util-linux \
vim \
vim-minimal \
wget \
wireshark \
wireshark-cli \
xfsprogs \
&& \
dnf clean all
microdnf clean all

# etcd is not packaged in RHEL/Rocky/CentOS 8 Extras repository, so we download/install
# etcd is not packaged in RHEL/Rocky/CentOS 9 Extras repository, so we download/install
# it manually
RUN mkdir /tmp/etcd-download && \
curl -L https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz \
Expand Down
23 changes: 0 additions & 23 deletions images/metalk8s-utils/configure-repos.sh

This file was deleted.

0 comments on commit 9ff6c7d

Please sign in to comment.