Skip to content

Commit 631d320

Browse files
committed
core: Replace Centos 7.4 container image with Centos Stream 9 container image (fixes y-scope#521).
1 parent e4eadc9 commit 631d320

File tree

12 files changed

+96
-125
lines changed

12 files changed

+96
-125
lines changed

.github/workflows/clp-core-build.yaml

+12-12
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
filter-relevant-changes:
3737
runs-on: "ubuntu-latest"
3838
outputs:
39-
centos74_image_changed: "${{steps.filter.outputs.centos74_image}}"
39+
centos_stream_9_image_changed: "${{steps.filter.outputs.centos_stream_9_image}}"
4040
ubuntu_focal_image_changed: "${{steps.filter.outputs.ubuntu_focal_image}}"
4141
ubuntu_jammy_image_changed: "${{steps.filter.outputs.ubuntu_jammy_image}}"
4242
clp_changed: "${{steps.filter.outputs.clp}}"
@@ -63,12 +63,12 @@ jobs:
6363
# image (since it would be different from the published image).
6464
base: "main"
6565
filters: |
66-
centos74_image:
66+
centos_stream_9_image:
6767
- ".github/actions/**"
6868
- ".github/workflows/clp-core-build.yaml"
6969
- "components/core/tools/scripts/lib_install/*.sh"
70-
- "components/core/tools/docker-images/clp-env-base-centos7.4/**"
71-
- "components/core/tools/scripts/lib_install/centos7.4/**"
70+
- "components/core/tools/docker-images/clp-env-base-centos-stream-9/**"
71+
- "components/core/tools/scripts/lib_install/centos-stream-9/**"
7272
ubuntu_focal_image:
7373
- ".github/actions/**"
7474
- ".github/workflows/clp-core-build.yaml"
@@ -94,8 +94,8 @@ jobs:
9494
- "Taskfile.yml"
9595
- "tools/scripts/deps-download/**"
9696
97-
centos74-deps-image:
98-
if: "needs.filter-relevant-changes.outputs.centos74_image_changed == 'true'"
97+
centos-stream-9-deps-image:
98+
if: "needs.filter-relevant-changes.outputs.centos_stream_9_image_changed == 'true'"
9999
needs: "filter-relevant-changes"
100100
runs-on: "ubuntu-latest"
101101
steps:
@@ -109,7 +109,7 @@ jobs:
109109

110110
- uses: "./.github/actions/clp-core-build-containers"
111111
env:
112-
OS_NAME: "centos7.4"
112+
OS_NAME: "centos-stream-9"
113113
with:
114114
image_name: "${{env.DEPS_IMAGE_NAME_PREFIX}}${{env.OS_NAME}}"
115115
docker_context: "components/core"
@@ -169,18 +169,18 @@ jobs:
169169
${{github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}
170170
token: "${{secrets.GITHUB_TOKEN}}"
171171

172-
centos74-binaries:
172+
centos-stream-9-binaries:
173173
# Run if the ancestor jobs succeeded OR they were skipped and clp was changed.
174174
if: >-
175175
success()
176176
|| (!cancelled() && !failure() && needs.filter-relevant-changes.outputs.clp_changed == 'true')
177177
needs:
178-
- "centos74-deps-image"
178+
- "centos-stream-9-deps-image"
179179
- "filter-relevant-changes"
180180
strategy:
181181
matrix:
182182
use_shared_libs: [true, false]
183-
name: "centos74-${{matrix.use_shared_libs && 'dynamic' || 'static'}}-linked-bins"
183+
name: "centos-stream-9-${{matrix.use_shared_libs && 'dynamic' || 'static'}}-linked-bins"
184184
runs-on: "ubuntu-latest"
185185
steps:
186186
- uses: "actions/checkout@v4"
@@ -193,12 +193,12 @@ jobs:
193193

194194
- uses: "./.github/actions/clp-core-build"
195195
env:
196-
OS_NAME: "centos7.4"
196+
OS_NAME: "centos-stream-9"
197197
with:
198198
image_name: "${{env.DEPS_IMAGE_NAME_PREFIX}}${{env.OS_NAME}}"
199199
use_shared_libs: "${{matrix.use_shared_libs}}"
200200
use_published_image: >-
201-
${{needs.filter-relevant-changes.outputs.centos74_image_changed == 'false'
201+
${{needs.filter-relevant-changes.outputs.centos_stream_9_image_changed == 'false'
202202
|| (github.event_name != 'pull_request' && github.ref == 'refs/heads/main')}}
203203
upload_binaries: "false"
204204

components/core/CMakeLists.txt

+14-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,20 @@ endif()
5151

5252
# Detect linking mode (static or shared); Default to static.
5353
set(CLP_USE_STATIC_LIBS ON CACHE BOOL "Whether to link against static libraries")
54-
if (CLP_USE_STATIC_LIBS AND APPLE)
55-
message(AUTHOR_WARNING "Building with static libraries is unsupported on macOS."
56-
" Switching to shared libraries.")
57-
set(CLP_USE_STATIC_LIBS OFF)
54+
if (CLP_USE_STATIC_LIBS)
55+
if (APPLE)
56+
set(CLP_STATIC_LIBS_UNSUPPORTED_PLATFORM "macOS")
57+
elseif (EXISTS "/etc/centos-release")
58+
set(CLP_STATIC_LIBS_UNSUPPORTED_PLATFORM "CentOS")
59+
endif()
60+
61+
if (DEFINED CLP_STATIC_LIBS_UNSUPPORTED_PLATFORM)
62+
message(
63+
AUTHOR_WARNING
64+
"Building with static libraries is unsupported on \
65+
${CLP_STATIC_LIBS_UNSUPPORTED_PLATFORM}. Switching to shared libraries.")
66+
set(CLP_USE_STATIC_LIBS OFF)
67+
endif()
5868
endif ()
5969
if(CLP_USE_STATIC_LIBS)
6070
set(CLP_LIBS_STRING "static")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM dokken/centos-stream-9 AS BASE
2+
3+
WORKDIR /root
4+
5+
RUN mkdir -p ./tools/scripts/lib_install
6+
ADD ./tools/scripts/lib_install ./tools/scripts/lib_install
7+
8+
RUN ./tools/scripts/lib_install/centos-stream-9/install-all.sh
9+
10+
# Remove cached files
11+
RUN dnf clean all \
12+
&& rm -rf /tmp/* /var/tmp/*
13+
14+
# Flatten the image
15+
FROM scratch
16+
COPY --from=BASE / /
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
# Exit on any error
4+
set -e
5+
6+
# Error on undefined variable
7+
set -u
8+
9+
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
10+
component_root="${script_dir}/../../../"
11+
12+
docker build \
13+
--tag clp-core-dependencies-x86-centos-stream-9:dev \
14+
"$component_root" \
15+
--file "${script_dir}/Dockerfile"

components/core/tools/docker-images/clp-env-base-centos7.4/Dockerfile

-39
This file was deleted.

components/core/tools/docker-images/clp-env-base-centos7.4/build.sh

-6
This file was deleted.

components/core/tools/docker-images/clp-env-base-centos7.4/setup-scripts/git

-4
This file was deleted.

components/core/tools/scripts/lib_install/centos7.4/install-all.sh renamed to components/core/tools/scripts/lib_install/centos-stream-9/install-all.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ set -u
88

99
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
1010

11-
"$script_dir"/install-prebuilt-packages.sh
12-
"$script_dir"/install-packages-from-source.sh
11+
"{$script_dir}/install-prebuilt-packages.sh"
12+
"${script_dir}/install-packages-from-source.sh"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
# Exit on any error
4+
set -e
5+
6+
# Error on undefined variable
7+
set -u
8+
9+
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
10+
lib_install_scripts_dir="${script_dir}/.."
11+
12+
# NOTE: The remaining installation scripts depend on and boost, so we install it beforehand.
13+
"${lib_install_scripts_dir}/install-boost.sh" 1.76.0
14+
15+
"${lib_install_scripts_dir}/fmtlib.sh" 8.0.1
16+
"${lib_install_scripts_dir}/spdlog.sh" 1.9.2
17+
"${lib_install_scripts_dir}/mongocxx.sh" 3.10.2
18+
"${lib_install_scripts_dir}/msgpack.sh" 6.0.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
# Exit on any error
4+
set -e
5+
6+
# Error on undefined variable
7+
set -u
8+
9+
dnf install -y \
10+
cmake \
11+
gcc-c++ \
12+
git \
13+
java-11-openjdk \
14+
libarchive-devel \
15+
libcurl-devel \
16+
libzstd-devel \
17+
make \
18+
mariadb-connector-c-devel \
19+
openssl-devel

components/core/tools/scripts/lib_install/centos7.4/install-packages-from-source.sh

-34
This file was deleted.

components/core/tools/scripts/lib_install/centos7.4/install-prebuilt-packages.sh

-24
This file was deleted.

0 commit comments

Comments
 (0)