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

[native] Update dockerfiles to use Centos9 #22909

Merged
merged 1 commit into from
Jun 15, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

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

ENV PROMPT_ALWAYS_RESPOND=n
ENV CC=/opt/rh/gcc-toolset-9/root/bin/gcc
ENV CXX=/opt/rh/gcc-toolset-9/root/bin/g++
ENV CC=/opt/rh/gcc-toolset-12/root/bin/gcc
ENV CXX=/opt/rh/gcc-toolset-12/root/bin/g++

RUN mkdir -p /scripts /velox/scripts
COPY scripts /scripts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG DEPENDENCY_IMAGE=presto/prestissimo-dependency:centos8
ARG BASE_IMAGE=quay.io/centos/centos:stream8
ARG DEPENDENCY_IMAGE=presto/prestissimo-dependency:centos9
ARG BASE_IMAGE=quay.io/centos/centos:stream9
FROM ${DEPENDENCY_IMAGE} as prestissimo-image

ARG OSNAME=centos
Expand All @@ -27,7 +27,8 @@ RUN mkdir -p /prestissimo /runtime-libraries
COPY . /prestissimo/
RUN EXTRA_CMAKE_FLAGS=${EXTRA_CMAKE_FLAGS} \
make -j${NUM_THREADS} --directory="/prestissimo/" cmake-and-build BUILD_TYPE=${BUILD_TYPE} BUILD_DIR=${BUILD_DIR} BUILD_BASE_DIR=${BUILD_BASE_DIR}
RUN ldd /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server | awk 'NF == 4 { system("cp " $3 " /runtime-libraries") }'
RUN !(LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64 ldd /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server | grep "not found") && \
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64 ldd /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server | awk 'NF == 4 { system("cp " $3 " /runtime-libraries") }'

#/////////////////////////////////////////////
# prestissimo-runtime
Expand All @@ -38,5 +39,6 @@ FROM ${BASE_IMAGE}
ENV BUILD_BASE_DIR=_build
ENV BUILD_DIR=""

COPY --chmod=0775 --from=prestissimo-image /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server /usr/local/bin/
COPY --chmod=0775 --from=prestissimo-image /runtime-libraries/* /usr/local/lib/
COPY --chmod=0775 --from=prestissimo-image /prestissimo/${BUILD_BASE_DIR}/${BUILD_DIR}/presto_cpp/main/presto_server /usr/bin/
COPY --chmod=0775 --from=prestissimo-image /runtime-libraries/* /usr/lib64/prestissimo-libs/
RUN echo "/usr/lib64/prestissimo-libs" > /etc/ld.so.conf.d/prestissimo.conf && ldconfig
20 changes: 10 additions & 10 deletions presto-native-execution/scripts/setup-centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ set -x

export FB_OS_VERSION=v2024.04.01.00
export nproc=$(getconf _NPROCESSORS_ONLN)
export CC=/opt/rh/gcc-toolset-9/root/bin/gcc
export CXX=/opt/rh/gcc-toolset-9/root/bin/g++
export CC=/opt/rh/gcc-toolset-12/root/bin/gcc
export CXX=/opt/rh/gcc-toolset-12/root/bin/g++

CPU_TARGET="${CPU_TARGET:-avx}"
SCRIPT_DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")
if [ -f "${SCRIPT_DIR}/setup-centos8.sh" ]
if [ -f "${SCRIPT_DIR}/setup-centos9.sh" ]
then
source "${SCRIPT_DIR}/setup-centos8.sh"
source "${SCRIPT_DIR}/setup-centos9.sh"
else
source "${SCRIPT_DIR}/../velox/scripts/setup-centos8.sh"
source "${SCRIPT_DIR}/../velox/scripts/setup-centos9.sh"
fi

function install_presto_deps_from_package_managers {
dnf install -y maven java clang-tools-extra jq perl-XML-XPath
# This python version is installed by the Velox setup scripts
pip3.9 install regex pyyaml chevron black
pip install regex pyyaml chevron black
}

function install_gperf {
Expand Down Expand Up @@ -62,8 +62,8 @@ function install_presto_deps {
}

if [[ $# -ne 0 ]]; then
# Activate gcc9; enable errors on unset variables afterwards.
source /opt/rh/gcc-toolset-9/enable || exit 1
# Activate gcc12; enable errors on unset variables afterwards.
source /opt/rh/gcc-toolset-12/enable || exit 1
set -u
for cmd in "$@"; do
run_and_time "${cmd}"
Expand All @@ -76,8 +76,8 @@ else
else
echo "Skipping installation of build dependencies since INSTALL_PREREQUISITES is not set"
fi
# Activate gcc9; enable errors on unset variables afterwards.
source /opt/rh/gcc-toolset-9/enable || exit 1
# Activate gcc12; enable errors on unset variables afterwards.
source /opt/rh/gcc-toolset-12/enable || exit 1
set -u
install_velox_deps
install_presto_deps
Expand Down
Loading