Merge pull request #4239 from thsfs/bump-rhel-compatible-linux

Bump RHEL compatible base to Rocky Linux 8
This commit is contained in:
Thiago Silva 2023-05-31 09:31:17 -03:00 committed by GitHub
commit b1c1d88394
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 113 additions and 282 deletions

View file

@ -105,6 +105,40 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2
linux_rpm_job:
if: ${{ github.event.inputs.ref == '' && needs.build_auto_setup_job.result == 'success' && always() || github.event.inputs.ref != '' && always() }}
needs: build_auto_setup_job
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:
- name: Sets the tag and repo variables (to build)
run: |
echo "TAG=${{ github.event.inputs.ref == '' && needs.build_auto_setup_job.outputs.build_tag || github.event.inputs.ref }}" >> $GITHUB_ENV
echo "VERSION_PRE_RELEASE=${{ github.event.inputs.ref == '' && needs.build_auto_setup_job.outputs.build_number || 'OFF' }}" >> $GITHUB_ENV
echo "REPO_TO_BUILD=${{ github.event.inputs.repo }}" >> $GITHUB_ENV
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0
with:
submodules: "recursive"
ref: ${{ github.ref }}
repository: ${{ github.repository }}
- name: RockyLinux 8 Base
run: ci/build-docker-image.sh docker/ci/Dockerfile-rhel nanocurrency/nano-env:rhel
- name: Build Artifact
run: |
mkdir -p ${GITHUB_WORKSPACE}/artifacts
docker run -e BETA=1 -e TAG=$TAG -e REPO_TO_BUILD=$REPO_TO_BUILD -e RPM_RELEASE=1 \
-v ${GITHUB_WORKSPACE}:/workspace \
-v ${GITHUB_WORKSPACE}/artifacts:/root/rpmbuild \
nanocurrency/nano-env:rhel /bin/bash -c "ci/build-rhel.sh"
- name: Deploy Artifacts
run: ci/actions/deploy.sh
env:
LINUX_RPM: 1
S3_BUILD_DIRECTORY: ${{ secrets.S3_BUILD_DIRECTORY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2
linux_docker_job:
if: ${{ github.event.inputs.ref == '' && needs.build_auto_setup_job.result == 'success' && always() || github.event.inputs.ref != '' && always() }}
needs: build_auto_setup_job

View file

@ -95,6 +95,39 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2
linux_rpm_job:
needs: build_auto_setup_job
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:
- name: Sets the tag and repo variables (to build)
run: |
echo "TAG=${{ github.event.inputs.ref == '' && needs.build_auto_setup_job.outputs.build_tag || github.event.inputs.ref }}" >> $GITHUB_ENV
echo "VERSION_PRE_RELEASE=${{ github.event.inputs.ref == '' && needs.build_auto_setup_job.outputs.build_number || 'OFF' }}" >> $GITHUB_ENV
echo "REPO_TO_BUILD=${{ github.event.inputs.repo }}" >> $GITHUB_ENV
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0
with:
submodules: "recursive"
ref: ${{ github.ref }}
repository: ${{ github.repository }}
- name: RockyLinux 8 Base
run: ci/build-docker-image.sh docker/ci/Dockerfile-rhel nanocurrency/nano-env:rhel
- name: Build Artifact
run: |
mkdir -p ${GITHUB_WORKSPACE}/artifacts
docker run -e BETA=1 -e TAG=$TAG -e REPO_TO_BUILD=$REPO_TO_BUILD -e RPM_RELEASE=1 \
-v ${GITHUB_WORKSPACE}:/workspace \
-v ${GITHUB_WORKSPACE}/artifacts:/root/rpmbuild \
nanocurrency/nano-env:rhel /bin/bash -c "ci/build-rhel.sh"
- name: Deploy Artifacts
run: ci/actions/deploy.sh
env:
LINUX_RPM: 1
S3_BUILD_DIRECTORY: ${{ secrets.S3_BUILD_DIRECTORY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2
linux_docker_job:
needs: build_auto_setup_job
runs-on: ubuntu-20.04

View file

@ -65,7 +65,7 @@ jobs:
AWS_DEFAULT_REGION: us-east-2
linux_rpm_job:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:
- name: Sets the tag and repo variables (to build)
@ -77,15 +77,15 @@ jobs:
submodules: "recursive"
ref: ${{ github.ref }}
repository: ${{ github.repository }}
- name: CentOS Base
run: ci/build-docker-image.sh docker/ci/Dockerfile-centos nanocurrency/nano-env:centos
- name: RockyLinux 8 Base
run: ci/build-docker-image.sh docker/ci/Dockerfile-rhel nanocurrency/nano-env:rhel
- name: Build Artifact
run: |
mkdir -p ${GITHUB_WORKSPACE}/artifacts
docker run -e LIVE=1 -e TAG=$TAG -e REPO_TO_BUILD=$REPO_TO_BUILD -e RPM_RELEASE=1 \
-v ${GITHUB_WORKSPACE}:/workspace \
-v ${GITHUB_WORKSPACE}/artifacts:/root/rpmbuild \
nanocurrency/nano-env:centos /bin/bash -c "ci/build-centos.sh"
nanocurrency/nano-env:rhel /bin/bash -c "ci/build-rhel.sh"
- name: Deploy Artifacts
run: ci/actions/deploy.sh
env:

View file

@ -6,7 +6,7 @@ if [[ "$GITHUB_WORKFLOW" = "Develop Branch Dockers Deploy" ]]; then
"$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:base"
"$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:gcc"
"$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:clang"
"$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:centos"
"$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:rhel"
else
tags=$(docker images --format '{{.Repository}}:{{.Tag }}' | grep "ghcr.io" | grep -vE "env|none")
for a in $tags; do

View file

@ -13,7 +13,7 @@ if [[ "${COMPILER:-}" != "" ]]; then
else
ci/build-docker-image.sh docker/ci/Dockerfile-gcc nanocurrency/nano-env:gcc
ci/build-docker-image.sh docker/ci/Dockerfile-clang nanocurrency/nano-env:clang
ci/build-docker-image.sh docker/ci/Dockerfile-centos nanocurrency/nano-env:centos
ci/build-docker-image.sh docker/ci/Dockerfile-rhel nanocurrency/nano-env:rhel
fi
echo "Script ci/actions/linux/install_deps.sh finished"

View file

@ -12,9 +12,12 @@ run_build() {
mkdir -p ~/rpmbuild/SOURCES/
mv -f ~/nano-${VERSION}.tar.gz ~/rpmbuild/SOURCES/.
if [ "${LIVE:-}" == "1" ]; then
scl enable devtoolset-7 'rpmbuild -ba nanocurrency.spec'
else
scl enable devtoolset-7 'rpmbuild -ba nanocurrency-beta.spec'
scl enable gcc-toolset-12 'rpmbuild --nodebuginfo -ba nanocurrency.spec'
elif [ "${BETA:-}" == "1" ]; then
scl enable gcc-toolset-12 'rpmbuild -ba nanocurrency-beta.spec'
else
echo "Error: the node network was not defined."
exit 1
fi
}

View file

@ -1,8 +0,0 @@
FROM centos:7
WORKDIR /workspace
ADD util /build
RUN bash /build/build_prep/update-common
RUN bash /build/build_prep/centos/prep.sh
RUN rm -rf /build

10
docker/ci/Dockerfile-rhel Normal file
View file

@ -0,0 +1,10 @@
FROM rockylinux:8
WORKDIR /workspace
RUN yum update -y
RUN yum install -y git wget openssl bzip2
RUN yum install -y rpm-build
RUN yum install -y glibc-devel glibc-headers make which
RUN yum install -y cmake gcc-toolset-12
RUN yum install -y python38

View file

@ -6,7 +6,7 @@ License: BSD-2-Clause
URL: https://nano.org/
Requires(pre): /usr/sbin/useradd, /usr/bin/getent
Requires(postun): /usr/sbin/userdel
BuildRequires: make, libstdc++-static, glibc-devel, glibc-headers
BuildRequires: make, glibc-devel, glibc-headers
Source: nano-%{version}.tar.gz
%description
@ -17,22 +17,18 @@ the nano daemon, and a service.
%prep
if [ ! -x "$(which cmake)" ]; then
echo "cmake must exist, try:" >&2
echo " scl enable devtoolset-7 'rpmbuild ...'" >&2
echo " scl enable gcc-toolset-12 'rpmbuild ...'" >&2
exit 1
fi
if cc --std=c++14 --version 2>&1 >/dev/null | grep '^' >/dev/null; then
if cc --std=c++20 --version 2>&1 >/dev/null | grep '^' >/dev/null; then
echo "Unsupported C++ compiler, try:" >&2
echo " scl enable devtoolset-7 'rpmbuild ...'" >&2
exit 1
fi
if test ! -d /usr/local/boost; then
echo "Boost should be in /usr/local/boost" >&2
echo " scl enable gcc-toolset-12 'rpmbuild ...'" >&2
exit 1
fi
%autosetup -n nano-%{version}
%build
cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBOOST_ROOT=/usr/local/boost -DACTIVE_NETWORK=nano_beta_network .
cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DACTIVE_NETWORK=nano_beta_network -DCMAKE_BUILD_TYPE=RelWithDebInfo .
make nano_node %{?_smp_mflags}
make nano_rpc %{?_smp_mflags}
@ -43,6 +39,7 @@ mkdir -p %{buildroot}/etc/systemd/system/
cp nano_node %{buildroot}/usr/bin/nano_node-beta
cp nano_rpc %{buildroot}/usr/bin/nano_rpc-beta
cp etc/systemd/nanocurrency-beta.service %{buildroot}/etc/systemd/system/nanocurrency-beta.service
sed -i "s/nano_node/nano_node-beta/g" %{buildroot}/etc/systemd/system/nanocurrency-beta.service
%clean
if [ ! %{buildroot} = "/" ]; then %{__rm} -rf %{buildroot}; fi

View file

@ -6,7 +6,7 @@ License: BSD-2-Clause
URL: https://nano.org/
Requires(pre): /usr/sbin/useradd, /usr/bin/getent
Requires(postun): /usr/sbin/userdel
BuildRequires: make, libstdc++-static, glibc-devel, glibc-headers
BuildRequires: make, glibc-devel, glibc-headers
Source: nano-%{version}.tar.gz
%description
@ -17,22 +17,18 @@ the nano daemon, and a service.
%prep
if [ ! -x "$(which cmake)" ]; then
echo "cmake must exist, try:" >&2
echo " scl enable devtoolset-7 'rpmbuild ...'" >&2
echo " scl enable gcc-toolset-12 'rpmbuild ...'" >&2
exit 1
fi
if cc --std=c++14 --version 2>&1 >/dev/null | grep '^' >/dev/null; then
if cc --std=c++20 --version 2>&1 >/dev/null | grep '^' >/dev/null; then
echo "Unsupported C++ compiler, try:" >&2
echo " scl enable devtoolset-7 'rpmbuild ...'" >&2
exit 1
fi
if test ! -d /usr/local/boost; then
echo "Boost should be in /usr/local/boost" >&2
echo " scl enable gcc-toolset-12 'rpmbuild ...'" >&2
exit 1
fi
%autosetup -n nano-%{version}
%build
cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBOOST_ROOT=/usr/local/boost .
cmake -DCMAKE_VERBOSE_MAKEFILE=ON .
make nano_node %{?_smp_mflags}
make nano_rpc %{?_smp_mflags}

View file

@ -1,47 +0,0 @@
#! /usr/bin/env bash
# -----BEGIN COMMON.SH-----
# -----END COMMON.SH-----
yes | yum update -y
yes | yum install -y git wget openssl bzip2 # <boost>
yes | yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm # epel 7
yes | yum install -y jq || exit 1
yes | yum install -y rpm-build || exit 1
yes | yum install -y glibc-devel glibc-headers make which libstdc++-static || exit 1
yes | yum install -y centos-release-scl || exit 1
yes | yum install -y devtoolset-7-gcc-c++ || exit 1
yes | yum install -y rh-python38 || exit 1
wget -O cmake_install.sh https://github.com/Kitware/CMake/releases/download/v3.15.4/cmake-3.15.4-Linux-x86_64.sh
chmod +x cmake_install.sh
./cmake_install.sh --prefix=/usr --exclude-subdir --skip-license
rm -f ./cmake_install.sh
# Ensure we have a new enough Boost
(
eval "$(scl enable devtoolset-7 "bash -c 'set | grep ^PATH='")"
if ! have boost; then
bootstrap_boost -m -s -j`nproc`
fi
if ! have boost; then
echo "Unable to install boost" >&2
exit 1
fi
if ! version_min 'boost --version' 1.69.999; then
echo "boost version too low (1.70.0+ required)" >&2
exit 1
fi
exit 0
) || exit 1
exit 0

View file

@ -1,130 +0,0 @@
#! /usr/bin/env bash
macosx_version='10.11'
# -----BEGIN COMMON.SH-----
# -----END COMMON.SH-----
# Ensure we have a new enough CMake
if ! have cmake; then
brew install cmake || exit 1
brew link cmake || exit 1
fi
if ! have cmake; then
echo "Unable to install cmake" >&2
exit 1
fi
if ! version_min 'cmake --version' 3.3.999; then
echo "cmake version too low (3.4+ required)" >&2
exit 1
fi
# Install a native "xz" command, in case it is later needed
if ! have xz; then
brew install xz
fi
# Setup compiler wrappers to specify the minimum
# Mac OS X version and SDK
## XXX:TODO: Find this SDK directory
macosx_sdk_directory="/Library/Developer/CommandLineTools/SDKs/MacOSX${macosx_version}.sdk"
wrap_compilers_add_options=(-mmacosx-version-min="${macosx_version}" -isysroot "${macosx_sdk_directory}")
wrap_compilers
# Ensure we have a new enough Boost
if ! have boost; then
BOOST_ROOT="${KEEP_AROUND_DIRECTORY}/boost"
if ! have boost; then
bootstrap_boost -m -c -s
fi
fi
if ! have boost; then
echo "Unable to install boost" >&2
exit 1
fi
if ! version_min 'boost --version' 1.69.999; then
echo "boost version too low (1.70.0+ required)" >&2
exit 1
fi
boost_dir="$(boost --install-prefix)"
# Ensure we have a new enough Qt5
PATH="${PATH}:/usr/local/opt/qt/bin:${KEEP_AROUND_DIRECTORY}/qt/bin"
export PATH
if ! have qtpaths; then
(
qt5_version='5.11.2'
qt5_url="https://download.qt.io/archive/qt/$(echo "${qt5_version}" | cut -f 1-2 -d .)/${qt5_version}/single/qt-everywhere-src-${qt5_version}.tar.xz"
qt5_sha256='c6104b840b6caee596fa9a35bc5f57f67ed5a99d6a36497b6fe66f990a53ca81'
qt5_archive="qt5-${qt5_version}.tar.xz"
qt5_dir="qt-everywhere-src-${qt5_version}"
cd "${KEEP_AROUND_DIRECTORY}" || exit 1
rm -rf "${qt5_dir}"
if [ ! -f "${qt5_archive}" ]; then
rm -f "${qt5_archive}.new"
wget -O "${qt5_archive}.new" "${qt5_url}" || rm -f "${qt5_archive}.new"
qt5_download_sha256="$(openssl dgst -sha256 "${qt5_archive}.new" | sed 's@^.*= *@@')"
if [ "${qt5_download_sha256}" != "${qt5_sha256}" ]; then
echo "Failed to download Qt5. Got SHA256 ${qt5_download_sha256}, expected ${qt5_sha256}" >&2
exit 1
fi
mv "${qt5_archive}.new" "${qt5_archive}" || exit 1
fi
xz -dc "${qt5_archive}" | tar -xf - || exit 1
(
cd "${qt5_dir}" || exit 1
CC="$(type -p clang)"
CXX="$(type -p clang++)"
QMAKE_CC="${CC}"
QMAKE_CXX="${CXX}"
export CC CXX QMAKE_CC QMAKE_CXX
yes | ./configure -verbose -opensource -rpath -framework -prefix "${KEEP_AROUND_DIRECTORY}/qt" || exit 1
make || exit 1
make install || exit 1
) || exit 1
rm -rf "${qt5_dir}"
)
fi
if ! have qtpaths; then
echo "Unable to install qt5" >&2
exit 1
fi
if ! version_min 'qtpaths --qt-version' 5.8.999 5.11.999; then
echo "qt5 version not in range (version range: [5.9+, 5.12-))" >&2
exit 1
fi
qt5_dir="$(qtpaths --install-prefix)/lib/cmake/Qt5"
echo "All verified."
echo ""
echo "Next steps:"
echo " CC='${CC:-cc} ${wrap_compilers_add_options[*]}'"
echo " CXX='${CXX:-c++} ${wrap_compilers_add_options[*]}'"
echo " export CC CXX"
echo " cmake -DBOOST_ROOT=${boost_dir} -DNANO_GUI=ON -DQt5_DIR=${qt5_dir} <dir>"
echo " cpack -G \"DragNDrop\""
exit 0

View file

@ -0,0 +1,13 @@
#! /usr/bin/env bash
# -----BEGIN COMMON.SH-----
# -----END COMMON.SH-----
yes | yum update -y
yes | yum install -y git wget openssl bzip2
yes | yum install -y rpm-build || exit 1
yes | yum install -y glibc-devel glibc-headers make which || exit 1
yes | yum install -y cmake gcc-toolset-12 || exit 1
yes | yum install -y python38 || exit 1
exit 0

View file

@ -1,70 +0,0 @@
#! /usr/bin/env bash
# -----BEGIN COMMON.SH-----
# -----END COMMON.SH-----
export DEBIAN_FRONTEND=noninteractive
set -euo pipefail
apt-get update --yes
apt-get --yes install git cmake ninja-build autotools-dev \
build-essential g++ clang python-dev \
libicu-dev libbz2-dev \
locales wget curl apt-utils \
lsb-release
apt-get --yes install xorg xvfb xauth xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
apt-get --yes install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
apt remove --yes libboost-all-dev
apt autoremove --yes
# Ensure we have a new enough Boost
if ! have boost; then
bootstrap_boost -m -s
fi
if ! have boost; then
echo "Unable to install boost" >&2
exit 1
fi
if ! version_min 'boost --version' 1.69.999; then
echo "boost version too low (1.70.0+ required)" >&2
exit 1
fi
boost_dir="$(boost --install-prefix)"
# Ensure we have a new enough Qt5
if ! have qtpaths; then
echo "Unable to install qt5" >&2
exit 1
fi
if ! version_min 'qtpaths --qt-version 2>/dev/null' 5.2.999 5.8.999; then
if ! version_min 'qtpaths -- --qt-version' 5.2.999 5.8.999; then
echo "qt5 version not in range (version range: [5.3+, 5.9-))" >&2
exit 1
fi
fi
qt5_dir="$(qtpaths --install-prefix)/lib/cmake/Qt5"
if [ ! -d "${qt5_dir}" ]; then
qt5_dir=''
fi
# Determine how to call cmake
cmake_add=''
if [ -n "${qt5_dir}" ]; then
cmake_add="${cmake_add} -DQt5_DIR=${qt5_dir}"
fi
echo "All verified."
echo ""
echo "Next steps:"
echo " cmake -DBOOST_ROOT=${boost_dir} -DNANO_GUI=ON ${cmake_add} <dir>"
echo " cpack -G \"TBZ2\""
exit 0