Skip to content

Commit 555b14f

Browse files
authored
Merge pull request ceph#64072 from phlogistonjohn/jjm-wip-el10
script/build-with-container.: fixes and improvments towards el10
2 parents ca58745 + 33b33ff commit 555b14f

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

Dockerfile.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ ARG CEPH_CTR_SRC=/usr/local/src/ceph
2323
ARG CLEAN_DNF=yes
2424
ARG CEPH_BASE_BRANCH=main
2525
ARG SCCACHE_VERSION=0.8.2
26+
ARG WITH_CRIMSON=true
2627
COPY --from=bootstrap ${CEPH_CTR_SRC} ${CEPH_CTR_SRC}
2728
# Note that we do not use ENV for the following. This is because we do not
2829
# want them permamently stored in the container's layer.
2930
RUN DISTRO=$DISTRO \
3031
CEPH_BASE_BRANCH=$CEPH_BASE_BRANCH \
3132
CLEAN_DNF=$CLEAN_DNF \
3233
CEPH_CTR_SRC=${CEPH_CTR_SRC} \
34+
WITH_CRIMSON=${WITH_CRIMSON} \
3335
bash -x ${CEPH_CTR_SRC}/buildcontainer-setup.sh
3436
RUN \
3537
SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-$(uname -m)-unknown-linux-musl.tar.gz"; \

install-deps.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,8 @@ else
493493
$SUDO dnf config-manager --set-enabled crb
494494
elif test $ID = centos -a $MAJOR_VERSION = 10 ; then
495495
$SUDO dnf config-manager --set-enabled crb
496+
elif test $ID = rocky -a $MAJOR_VERSION = 10 ; then
497+
$SUDO dnf config-manager --set-enabled crb
496498
elif test $ID = rhel -a $MAJOR_VERSION = 8 ; then
497499
dts_ver=11
498500
$SUDO dnf config-manager --set-enabled "codeready-builder-for-rhel-8-${ARCH}-rpms"

src/script/build-with-container.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,19 @@ class DistroKind(StrEnum):
105105
CENTOS8 = "centos8"
106106
CENTOS9 = "centos9"
107107
FEDORA41 = "fedora41"
108+
ROCKY10 = "rocky10"
108109
UBUNTU2204 = "ubuntu22.04"
109110
UBUNTU2404 = "ubuntu24.04"
110111

111112
@classmethod
112113
def uses_dnf(cls):
113-
return {cls.CENTOS8, cls.CENTOS9, cls.CENTOS10, cls.FEDORA41}
114+
return {
115+
cls.CENTOS10,
116+
cls.CENTOS8,
117+
cls.CENTOS9,
118+
cls.FEDORA41,
119+
cls.ROCKY10,
120+
}
114121

115122
@classmethod
116123
def uses_rpmbuild(cls):
@@ -128,6 +135,8 @@ def aliases(cls):
128135
"centos9stream": cls.CENTOS9,
129136
str(cls.FEDORA41): cls.FEDORA41,
130137
"fc41": cls.FEDORA41,
138+
str(cls.ROCKY10): cls.ROCKY10,
139+
'rockylinux10': cls.ROCKY10,
131140
str(cls.UBUNTU2204): cls.UBUNTU2204,
132141
"ubuntu-jammy": cls.UBUNTU2204,
133142
"jammy": cls.UBUNTU2204,
@@ -146,6 +155,7 @@ class DefaultImage(StrEnum):
146155
CENTOS8 = "quay.io/centos/centos:stream8"
147156
CENTOS9 = "quay.io/centos/centos:stream9"
148157
FEDORA41 = "registry.fedoraproject.org/fedora:41"
158+
ROCKY10 = "docker.io/rockylinux/rockylinux:10"
149159
UBUNTU2204 = "docker.io/ubuntu:22.04"
150160
UBUNTU2404 = "docker.io/ubuntu:24.04"
151161

@@ -539,6 +549,8 @@ def build_container(ctx):
539549
f"--volume={ctx.dnf_cache_dir}:/var/cache/dnf:Z",
540550
"--build-arg=CLEAN_DNF=no",
541551
]
552+
if ctx.cli.build_args:
553+
cmd.extend([f"--build-arg={v}" for v in ctx.cli.build_args])
542554
cmd += ["-f", ctx.cli.containerfile, ctx.cli.containerdir]
543555
with ctx.user_command():
544556
_run(cmd, check=True, ctx=ctx)
@@ -921,6 +933,15 @@ def parse_cli(build_step_names):
921933
" (the ceph source root)"
922934
),
923935
)
936+
parser.add_argument(
937+
"--build-arg",
938+
dest="build_args",
939+
action="append",
940+
help=(
941+
"Extra argument to pass to container image build."
942+
" Can be used to override default build image behavior."
943+
),
944+
)
924945
parser.add_argument(
925946
"--overlay-dir",
926947
"-l",

src/script/buildcontainer-setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ install_container_deps() {
55
# set JENKINS_HOME in order to have the build container look as much
66
# like an existing jenkins build environment as possible
77
export JENKINS_HOME=/ceph
8-
export WITH_CRIMSON=true
98
prepare
109
}
1110

@@ -36,7 +35,8 @@ case "${CEPH_BASE_BRANCH}~${DISTRO_KIND}" in
3635
install_container_deps
3736
dnf_clean
3837
;;
39-
*~*centos*9|*~*centos*10*|*~fedora*)
38+
# EL-ish, 9+
39+
*~*centos*|*~fedora*|*~rocky*|*~alma*)
4040
dnf install -y /usr/bin/{rpmbuild,wget,curl}
4141
install_container_deps
4242
dnf_clean

0 commit comments

Comments
 (0)