-
Notifications
You must be signed in to change notification settings - Fork 0
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
upgrade to manticore and RHEL9 #11
Changes from all commits
dac7a35
5c3d888
a5402f7
2cd7d39
377448c
ee24a4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
ignored: | ||
- DL3006 | ||
- DL3022 | ||
- DL3033 | ||
- DL3003 # cd used as part of command, using workdir increases complexity | ||
- DL3041 # hardcoding version of rpms is not how this should work | ||
- DL3022 # COPY --from can work from another image, not needed to be a layer | ||
- DL3033 # hardcoding version of rpms is not how this should work |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,25 @@ | ||
FROM registry.access.redhat.com/ubi7/ubi AS builder | ||
ENV SEARCHD_RPM=sphinx-2.2.11-1.rhel7.x86_64.rpm \ | ||
SEARCHD_RPM_SHA=959b04eb3f7fb2314d7a2702b61e9b3e627b66b1a8574dece21c0592be1b90e2 \ | ||
SEARCHD_SRC=sphinx-2.2.11-release.tar.gz \ | ||
SEARCHD_SRC_DIR=sphinx-2.2.11-release \ | ||
SEARCHD_SRC_SHA=6662039f093314f896950519fa781bc87610f926f64b3d349229002f06ac41a9 | ||
FROM quay.io/centos/centos:stream9 AS builder | ||
ENV SEARCHD_REF=6.2.12 \ | ||
SEARCHD_REPO=https://github.com/manticoresoftware/manticoresearch.git \ | ||
CC=clang \ | ||
CXX=clang++ \ | ||
BUILD_PATH=/tmp/manticore_uselessly_long_path_to_prevent_rpm_build_issues \ | ||
mayorova marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a comment here to understand the issue? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just fails with short path, if you have a better wording, happy to update :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But why does it fail? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just some requirement of the RPM build tools. I have no idea and don't really care. Upstream they use directory with a long string of |
||
BUILD_FLAGS="-DUSE_SYSLOG=0 -DWITH_GALERA=0 -DWITH_RE2=0 -DWITH_STEMMER=0 -DWITH_ICU_FORCE_STATIC=0 -DWITH_SSL=1 -DWITH_ZLIB=1 -DWITH_ODBC=0 -DWITH_EXPAT=0 -DWITH_ICONV=1 -DWITH_POSTGRESQL=0 -DWITH_MYSQL=0 -DBUILD_TESTING=0" | ||
WORKDIR $BUILD_PATH | ||
|
||
SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"] | ||
# clang is broken on s390x (RHEL-15874), to use gcc remove CC and CXX variables, | ||
# also replace llvm-toolset with make automake gcc gcc-c++ kernel-devel | ||
jlledom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# hadolint ignore=DL3003,DL3032,SC2046 | ||
RUN if [ "$(uname -m)" == "x86_64" ]; then \ | ||
yumdownloader --downloadonly --destdir=/home/rpms mariadb-libs.$(uname -m) postgresql-libs.$(uname -m) unixODBC.$(uname -m) --resolve && \ | ||
curl -sSL https://sphinxsearch.com/files/$SEARCHD_RPM -o /home/rpms/$SEARCHD_RPM && \ | ||
sha256sum -c - <<< "$SEARCHD_RPM_SHA /home/rpms/$SEARCHD_RPM" && \ | ||
mkdir /home/searchd ; \ | ||
else \ | ||
yumdownloader --downloadonly --destdir=/home/rpms mariadb-libs.$(uname -m) --resolve && \ | ||
yum install -y gcc-c++ mysql-devel make && \ | ||
curl -sSL http://sphinxsearch.com/files/$SEARCHD_SRC -o /tmp/$SEARCHD_SRC && \ | ||
sha256sum -c - <<< "$SEARCHD_SRC_SHA /tmp/$SEARCHD_SRC" && \ | ||
tar xzf /tmp/$SEARCHD_SRC -C /tmp && \ | ||
cd /tmp/$SEARCHD_SRC_DIR && ./configure && DESTDIR=/home/searchd make install && \ | ||
rm -rf /tmp/sphinx* ; \ | ||
fi | ||
|
||
RUN yum install -y --setopt=skip_missing_names_on_install=False,tsflags=nodocs llvm-toolset mysql cmake boost-devel openssl-devel zlib-devel libicu-devel bison flex systemd-units rpm-build git && \ | ||
git clone --depth=1 --branch=$SEARCHD_REF $SEARCHD_REPO . && \ | ||
# boost lib in RHEL9 comes dynamic only so enable its use \ | ||
sed -i -e 's/Boost_USE_STATIC_LIBS ON/Boost_USE_STATIC_LIBS OFF/' src/CMakeLists.txt && \ | ||
mayorova marked this conversation as resolved.
Show resolved
Hide resolved
|
||
mkdir build && cd build && \ | ||
cmake $BUILD_FLAGS .. && \ | ||
cmake --build . --target package --config RelWithDebInfo | ||
jlledom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
FROM registry.access.redhat.com/ubi7-minimal | ||
FROM quay.io/centos/centos:stream9-minimal | ||
|
||
LABEL org.opencontainers.image.authors="https://issues.redhat.com/browse/THREESCALE" \ | ||
org.opencontainers.image.title="3scale searchd" \ | ||
|
@@ -37,14 +34,20 @@ LABEL org.opencontainers.image.authors="https://issues.redhat.com/browse/THREESC | |
# org.opencontainers.image.created="" | ||
|
||
ARG PORTA_IMAGE=quay.io/3scale/porta:nightly | ||
COPY --from=builder /home/rpms /tmp/rpms | ||
COPY --from=builder /home/searchd / | ||
COPY --from=$PORTA_IMAGE /opt/system/config/standalone.sphinx.conf "/etc/sphinx/system.sphinx.conf" | ||
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release && \ | ||
rpm -iv --excludedocs /tmp/rpms/* && \ | ||
rm -rf /tmp/rpms && \ | ||
mkdir -p /var/lib/searchd /var/run/sphinx && \ | ||
chmod 770 /var/lib/searchd /var/run/sphinx | ||
COPY --from=builder /tmp/manticore_uselessly_long_path_to_prevent_rpm_build_issues/build/*.rpm /tmp/rpms/ | ||
COPY --from=$PORTA_IMAGE /opt/system/config/standalone.sphinx.conf "/etc/manticoresearch/manticore.conf" | ||
ENV MANTICORE_RPMS="manticore-converter* manticore-common* manticore-server-core* manticore-server*" | ||
RUN microdnf install -y --nodocs mysql openssl boost-context boost-filesystem zlib libicu && \ | ||
cd /tmp/rpms && ls -l && \ | ||
rpm -iv --excludedocs $MANTICORE_RPMS && \ | ||
cd - && rm -rf /tmp/rpms && \ | ||
microdnf clean all && \ | ||
# TODO: once in production, update porta to generate config with the correct path \ | ||
sed -i -e 's#/var/run/sphinx/#/var/run/manticore/#' /etc/manticoresearch/manticore.conf && \ | ||
mkdir /var/lib/searchd && \ | ||
chmod g+w /var/lib/searchd /var/run/manticore /var/log/manticore && \ | ||
chgrp 0 /var/lib/searchd /var/run/manticore /var/log/manticore | ||
|
||
ENTRYPOINT ["/bin/env", "searchd", "--pidfile", "--config", "/etc/sphinx/system.sphinx.conf", "--nodetach"] | ||
WORKDIR /var/lib/manticore | ||
ENTRYPOINT ["/bin/env", "searchd", "--pidfile", "--config", "/etc/manticoresearch/manticore.conf", "--nodetach"] | ||
EXPOSE 9306/tcp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need all of this just because clang is broken in s390x. Couldn't we just use gcc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part just selects platforms to build for. It's not because of s390 and will be equally needed if gcc was used. Presently build is too slow to complete for non-native platforms regardless of compiler. So we can only build for x86 in github. If we find no solution, we may need to use circleci in case we want community image to support all archs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw the s390x and ppc64le clang builda were fixed upstream