Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

THREESCALE-11575: Upgrade to CentOS stream9 #3866

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ store-log-artifacts: &store-log-artifacts
path: log
destination: log

npm-cache-key: &npm-cache-key stream8-{{ .Environment.CACHE_VERSION }}-node-modules-{{ checksum "yarn.lock" }}
bundle-cache-key: &bundle-cache-key stream8-{{ .Environment.CACHE_VERSION }}-bundler-gems-{{ arch }}-{{ checksum "Gemfile.lock" }}-{{ checksum "/tmp/db" }}
assets-cache-key: &assets-cache-key stream8-{{ .Environment.CACHE_VERSION }}-asset-cache-{{ checksum "tmp/assets_related_checksums" }}
npm-cache-key: &npm-cache-key stream9-{{ .Environment.CACHE_VERSION }}-node-modules-{{ checksum "yarn.lock" }}
bundle-cache-key: &bundle-cache-key stream9-{{ .Environment.CACHE_VERSION }}-bundler-gems-{{ arch }}-{{ checksum "Gemfile.lock" }}-{{ checksum "/tmp/db" }}
assets-cache-key: &assets-cache-key stream9-{{ .Environment.CACHE_VERSION }}-asset-cache-{{ checksum "tmp/assets_related_checksums" }}
oracle-libs-cache-key: &oracle-libs-cache-key ora1-{{ .Environment.CACHE_VERSION }}-oracle-libs-cache-{{ checksum "script/oracle/install-instantclient-packages.sh" }}

restore-npm-cache: &restore-npm-cache
Expand Down Expand Up @@ -88,7 +88,7 @@ attach-to-workspace: &attach-to-workspace
at: .

system-builder-ruby31: &system-builder-ruby31
image: quay.io/3scale/system-builder:stream8-ruby3.1
image: quay.io/3scale/system-builder:stream9
environment:
BUNDLE_FROZEN: true
BUNDLE_PATH: 'vendor/bundle'
Expand Down
20 changes: 7 additions & 13 deletions openshift/system/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/centos/centos:stream8 as builder
FROM quay.io/centos/centos:stream9 as builder
WORKDIR /opt/system
ENV RUBY_MAJOR_VERSION=3 \
RUBY_MINOR_VERSION=1 \
Expand All @@ -10,10 +10,8 @@ ADD . ./
RUN cp config/examples/*.yml config/ \
&& cp openshift/system/config/* config/

RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
&& dnf -y --setopt=module_stream_switch=True module enable ruby:${RUBY_VERSION} nodejs:18 mysql:8.0 \
&& dnf install -y --setopt=skip_missing_names_on_install=False,tsflags=nodocs shared-mime-info make automake gcc gcc-c++ redhat-rpm-config postgresql rubygem-irb rubygem-rdoc ruby-devel nodejs libpq-devel mysql-devel gd-devel libxml2-devel libxslt-devel git 'dnf-command(download)' podman-catatonit \
RUN dnf -y --enablerepo=crb --setopt=module_stream_switch=True module enable ruby:${RUBY_VERSION} nodejs:18 \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added --enablerepo=crb and removed mysql:8.0 module

&& dnf install -y --enablerepo=crb --setopt=skip_missing_names_on_install=False,tsflags=nodocs shared-mime-info make automake gcc gcc-c++ postgresql rubygem-irb rubygem-rdoc ruby-devel nodejs libpq-devel mysql-devel gd-devel libxml2-devel libxslt-devel git 'dnf-command(download)' cpio \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the dnf install command - added --enablerepo=crb and cpio package, removed podman-catatonit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jusr curious why do we need cpio

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use cpio to copy some memkind sources. I guess the executable was present in stream8 but got removed from stream9 🤷

&& BUNDLER_VERSION=$(awk '/BUNDLED WITH/ { getline; print $1 }' Gemfile.lock) \
&& gem install --no-document bundler:$BUNDLER_VERSION \
&& bundle config build.nokogiri --use-system-libraries \
Expand All @@ -36,7 +34,7 @@ RUN cd /tmp \
&& ./autogen.sh && ./configure --libdir=/usr/local/lib64/ && make


FROM quay.io/centos/centos:stream8 AS base
FROM quay.io/centos/centos:stream9 AS base

USER root

Expand All @@ -52,18 +50,14 @@ ENV RUBY_VERSION="${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}"

WORKDIR $HOME

RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
&& dnf -y module enable ruby:${RUBY_VERSION} nodejs:18 mysql:8.0 \
&& dnf install -y --setopt=skip_missing_names_on_install=False,tsflags=nodocs shared-mime-info postgresql rubygem-irb rubygem-rdoc ruby libpq mysql mysql-libs gd git liberation-sans-fonts file libxml2 libxslt \
RUN dnf -y --enablerepo=crb module enable ruby:${RUBY_VERSION} nodejs:18 \
&& dnf install -y --enablerepo=crb --setopt=skip_missing_names_on_install=False,tsflags=nodocs shared-mime-info postgresql rubygem-irb rubygem-rdoc ruby libpq mysql mysql-libs gd git liberation-sans-fonts file libxml2 libxslt catatonit \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added --enablerepo=crb and catatonit package

&& dnf -y clean all

COPY --from=builder /opt/system/ .
COPY --from=builder /tmp/memkind-*/jemalloc/lib/libjemalloc.so* /usr/local/lib64
COPY --from=builder /usr/local/share/gems /usr/local/share/
COPY --from=builder /usr/local/bin/bundle* /usr/local/bin
# in RHEL 8 podman-catatonit pulls in too many useless deps so we don't install the RPM directly, on RHEL 9 simply use package `catatonit`
COPY --from=builder /usr/libexec/catatonit/catatonit /usr/libexec/catatonit/catatonit

RUN echo /usr/local/lib64 > /etc/ld.so.conf.d/jemalloc.conf \
&& ldconfig && ldconfig -p | grep jemalloc
Expand Down Expand Up @@ -109,7 +103,7 @@ ENV THINKING_SPHINX_ADDRESS=0.0.0.0 \
SECRET_KEY_BASE=dummy \
DATABASE_URL='mysql2://root:@localhost/porta'
USER 0
RUN dnf install -y mysql-server mysql-test \
RUN dnf install --enablerepo=crb -y mysql-server mysql-test \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mysql package is in this repo that is available but not enabled by default

&& setcap -r /usr/libexec/mysqld \
&& setpriv --reuid 27 --regid 27 --clear-groups mysqld --initialize-insecure \
&& (mysqld_safe &) \
Expand Down