diff --git a/docker/ci/config/build-opensearch-dashboards-entrypoint.sh b/docker/ci/config/build-opensearch-dashboards-entrypoint.sh deleted file mode 100755 index 8907b69a1d..0000000000 --- a/docker/ci/config/build-opensearch-dashboards-entrypoint.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# Copyright OpenSearch Contributors -# SPDX-License-Identifier: Apache-2.0 -# -# The OpenSearch Contributors require contributions made to -# this file be licensed under the Apache-2.0 license or a -# compatible open source license. - -# This script is used as an entrypoint to switch nvm version - -source $NVM_DIR/nvm.sh -nvm install $NODE_VERSION -nvm use $NODE_VERSION -bash diff --git a/docker/ci/config/scl_setup b/docker/ci/config/scl_setup new file mode 100755 index 0000000000..a96cebe4f3 --- /dev/null +++ b/docker/ci/config/scl_setup @@ -0,0 +1 @@ +. scl_source enable devtoolset-8 diff --git a/docker/ci/dockerfiles/current/build.centos7.opensearch-dashboards.x64.arm64.dockerfile b/docker/ci/dockerfiles/current/build.centos7.opensearch-dashboards.x64.arm64.dockerfile index 617735735e..0488fa16fc 100644 --- a/docker/ci/dockerfiles/current/build.centos7.opensearch-dashboards.x64.arm64.dockerfile +++ b/docker/ci/dockerfiles/current/build.centos7.opensearch-dashboards.x64.arm64.dockerfile @@ -59,7 +59,6 @@ RUN curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - && \ # Switch shell for rvm related commands SHELL ["/bin/bash", "-lc"] -CMD ["/bin/bash", "-l"] # Install ruby / rpm / fpm related dependencies RUN . /etc/profile.d/rvm.sh && rvm install 2.6.0 && rvm --default use 2.6.0 && yum install -y rpm-build createrepo && yum clean all @@ -74,7 +73,7 @@ ENV PATH=$RUBY_HOME:$RVM_HOME:$PATH RUN curl https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz | tar xzvf - && \ cd Python-3.7.7 && \ ./configure --enable-optimizations && \ - make altinstall + make altinstall -j $(( `nproc` / 2 )) # Setup Python37 links RUN ln -sfn /usr/local/bin/python3.7 /usr/bin/python3 && \ @@ -83,6 +82,16 @@ RUN ln -sfn /usr/local/bin/python3.7 /usr/bin/python3 && \ ln -sfn /usr/local/bin/pip3.7 /usr/bin/pip3 && \ pip3 install pipenv && pipenv --version +# Upgrade gcc8 +# The setup part is partially based on Austin Dewey's article: +# https://austindewey.com/2019/03/26/enabling-software-collections-binaries-on-a-docker-image/ +RUN yum install -y centos-release-scl && yum install -y devtoolset-8 && yum clean all && \ + echo "source scl_source enable devtoolset-8" > /etc/profile.d/scl_devtoolset8.sh +COPY --chown=0:0 config/scl_setup /usr/local/bin/scl_setup +ENV BASH_ENV="/usr/local/bin/scl_setup" +ENV ENV="/usr/local/bin/scl_setup" +ENV PROMPT_COMMAND=". /usr/local/bin/scl_setup" + # Change User USER 1000 WORKDIR /usr/share/opensearch @@ -96,7 +105,6 @@ ENV PATH=/usr/share/opensearch/.gem/gems/fpm-1.14.2/bin:$PATH ENV NVM_DIR /usr/share/opensearch/.nvm ENV NODE_VERSION 10.24.1 ARG NODE_VERSION_LIST="10.24.1 14.19.1 14.20.0 14.20.1 14.21.3 16.20.0" -COPY --chown=1000:1000 config/build-opensearch-dashboards-entrypoint.sh /usr/share/opensearch # install nvm # https://github.com/creationix/nvm#install-script RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash @@ -114,5 +122,3 @@ RUN node -v RUN npm -v RUN yarn -v RUN fpm -v -ENTRYPOINT ["bash", "/usr/share/opensearch/build-opensearch-dashboards-entrypoint.sh"] -CMD ["$NODE_VERSION"] diff --git a/docker/ci/dockerfiles/current/build.centos7.opensearch.x64.arm64.dockerfile b/docker/ci/dockerfiles/current/build.centos7.opensearch.x64.arm64.dockerfile index 61c22d86c4..d06836fc08 100644 --- a/docker/ci/dockerfiles/current/build.centos7.opensearch.x64.arm64.dockerfile +++ b/docker/ci/dockerfiles/current/build.centos7.opensearch.x64.arm64.dockerfile @@ -82,7 +82,7 @@ ENV PATH=$RUBY_HOME:$RVM_HOME:$PATH RUN curl https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz | tar xzvf - && \ cd Python-3.7.7 && \ ./configure --enable-optimizations && \ - make altinstall + make altinstall -j $(( `nproc` / 2 )) # Setup Python37 links RUN ln -sfn /usr/local/bin/python3.7 /usr/bin/python3 && \ diff --git a/docker/ci/dockerfiles/current/build.rockylinux8.opensearch.x64.arm64.dockerfile b/docker/ci/dockerfiles/current/build.rockylinux8.opensearch.x64.arm64.dockerfile index 78baade2b1..0f8ada1948 100644 --- a/docker/ci/dockerfiles/current/build.rockylinux8.opensearch.x64.arm64.dockerfile +++ b/docker/ci/dockerfiles/current/build.rockylinux8.opensearch.x64.arm64.dockerfile @@ -81,7 +81,7 @@ ENV PATH=$RUBY_HOME:$RVM_HOME:$PATH RUN curl https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz | tar xzvf - && \ cd Python-3.7.7 && \ ./configure --enable-optimizations && \ - make altinstall + make altinstall -j $(( `nproc` / 2 )) # Setup Python37 links RUN ln -sfn /usr/local/bin/python3.7 /usr/bin/python3 && \ diff --git a/docker/ci/dockerfiles/current/release.centos.clients.x64.arm64.dockerfile b/docker/ci/dockerfiles/current/release.centos7.clients.x64.arm64.dockerfile similarity index 99% rename from docker/ci/dockerfiles/current/release.centos.clients.x64.arm64.dockerfile rename to docker/ci/dockerfiles/current/release.centos7.clients.x64.arm64.dockerfile index 18a4e57b6d..0bcef0543d 100644 --- a/docker/ci/dockerfiles/current/release.centos.clients.x64.arm64.dockerfile +++ b/docker/ci/dockerfiles/current/release.centos7.clients.x64.arm64.dockerfile @@ -80,7 +80,7 @@ RUN chmod -R 777 /dev/shm RUN curl https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz | tar xzvf - && \ cd Python-3.7.7 && \ ./configure --enable-optimizations && \ - make altinstall + make altinstall -j $(( `nproc` / 2 )) # Setup Python37 links RUN ln -sfn /usr/local/bin/python3.7 /usr/bin/python3 && \ diff --git a/docker/ci/dockerfiles/current/test.centos7.performance-test.x64.arm64.dockerfile b/docker/ci/dockerfiles/current/test.centos7.performance-test.x64.arm64.dockerfile index 2332218157..ebf59b1661 100644 --- a/docker/ci/dockerfiles/current/test.centos7.performance-test.x64.arm64.dockerfile +++ b/docker/ci/dockerfiles/current/test.centos7.performance-test.x64.arm64.dockerfile @@ -38,7 +38,7 @@ RUN yum install -y @development zlib-devel bzip2 bzip2-devel readline-devel sqli RUN curl https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz | tar xzvf - && \ cd Python-3.7.7 && \ ./configure --enable-optimizations && \ - make altinstall + make altinstall -j $(( `nproc` / 2 )) # Setup Python37 links RUN ln -sfn /usr/local/bin/python3.7 /usr/bin/python3 && \ diff --git a/docker/ci/dockerfiles/current/test.rockylinux8.opensearch-dashboards.x64.arm64.dockerfile b/docker/ci/dockerfiles/current/test.rockylinux8.opensearch-dashboards.x64.arm64.dockerfile index 48acd07e9b..1a08fc451e 100644 --- a/docker/ci/dockerfiles/current/test.rockylinux8.opensearch-dashboards.x64.arm64.dockerfile +++ b/docker/ci/dockerfiles/current/test.rockylinux8.opensearch-dashboards.x64.arm64.dockerfile @@ -120,7 +120,7 @@ RUN chmod -R 777 /dev/shm RUN curl https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz | tar xzvf - && \ cd Python-3.7.7 && \ ./configure --enable-optimizations && \ - make altinstall + make altinstall -j $(( `nproc` / 2 )) # Setup Python37 links RUN ln -sfn /usr/local/bin/python3.7 /usr/bin/python3 && \ diff --git a/docker/ci/dockerfiles/current/test.rockylinux8.systemd-base.x64.arm64.dockerfile b/docker/ci/dockerfiles/current/test.rockylinux8.systemd-base.x64.arm64.dockerfile index 4bb3ffd269..15ec0482b0 100644 --- a/docker/ci/dockerfiles/current/test.rockylinux8.systemd-base.x64.arm64.dockerfile +++ b/docker/ci/dockerfiles/current/test.rockylinux8.systemd-base.x64.arm64.dockerfile @@ -131,7 +131,7 @@ RUN chmod -R 777 /dev/shm RUN curl https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz | tar xzvf - && \ cd Python-3.7.7 && \ ./configure --enable-optimizations && \ - make altinstall + make altinstall -j $(( `nproc` / 2 )) # Setup Python37 links RUN ln -sfn /usr/local/bin/python3.7 /usr/bin/python3 && \