From c527b2cf96ee56395fcc08db96f499b3d419b78f Mon Sep 17 00:00:00 2001 From: RdLrT <3169068+rdlrt@users.noreply.github.com> Date: Fri, 31 May 2024 17:14:17 +1000 Subject: [PATCH] Provisioning script updates (#1774) ## Description ### Guild Deploy changes: - Only run build dependencies as part of os dependencies when included as flag - Adapt libsodium flag to only use os_dependencies (and include minimal set of dependency there) to make it faster/lighter to deploy libsodium fork on block producing nodes - Include os_dependencies prior to running cardano-hw-cli download (to ensure libusb dependencies are available) - Allow CARDANO_NODE_VERSION to be set as environment variable for those who'd like to test guild-deploy against different node release - Bump CARDANO_NODE_VERSION to 8.9.3 ### files/docker: - Remove docker stage files - Remove cardano-wallet, as it is no longer relevant in the ecosystem now - for dockerfile_bin, remove tcpping (was unused due to comment), and remove cleanup references for build packages, as they're no longer deployed with `-s p` flag. Also, remove gnupg git from initial run, as they're already included as part of `guild-deploy.sh -s -p` call ### setup-grest.sh: - Dont use `command -v haproxy` (as the shell isnt always refreshed and /usr/sbin may not be part of $PATH), instead look for /usr/sbin/haproxy to verify if haproxy was already installed - Add haproxy installer dependencies (if guild-deploy is only run with os_dependencies flag, haproxy wouldnt compile in it's current state) --- .github/workflows/autoupdate.yml | 13 --- .github/workflows/premerge.yml | 10 +-- files/docker/node/addons/guild-topology.sh | 47 ----------- files/docker/node/dockerfile_bin | 7 +- files/docker/node/dockerfile_stage1 | 21 ----- files/docker/node/dockerfile_stage2 | 30 ------- files/docker/node/dockerfile_stage3 | 79 ------------------- files/docker/wallet/dockerfile_wallet_stage2 | 21 ----- files/node-deps.json | 2 +- ...ntainerfile => debian-cabal.containerfile} | 0 ...e => debian-guild-deploy.sh.containerfile} | 0 ...nerfile => rockylinux-cabal.containerfile} | 0 ... rockylinux-guild-deploy.sh.containerfile} | 0 ...ntainerfile => ubuntu-cabal.containerfile} | 0 ...e => ubuntu-guild-deploy.sh.containerfile} | 0 scripts/cnode-helper-scripts/guild-deploy.sh | 45 +++++++---- scripts/grest-helper-scripts/setup-grest.sh | 12 +-- 17 files changed, 45 insertions(+), 242 deletions(-) delete mode 100644 .github/workflows/autoupdate.yml delete mode 100755 files/docker/node/addons/guild-topology.sh delete mode 100644 files/docker/node/dockerfile_stage1 delete mode 100644 files/docker/node/dockerfile_stage2 delete mode 100644 files/docker/node/dockerfile_stage3 delete mode 100644 files/docker/wallet/dockerfile_wallet_stage2 rename files/tests/pre-merge/{debian-cabal-l.containerfile => debian-cabal.containerfile} (100%) rename files/tests/pre-merge/{debian-guild-deploy.sh-l.containerfile => debian-guild-deploy.sh.containerfile} (100%) rename files/tests/pre-merge/{rockylinux-cabal-l.containerfile => rockylinux-cabal.containerfile} (100%) rename files/tests/pre-merge/{rockylinux-guild-deploy.sh-l.containerfile => rockylinux-guild-deploy.sh.containerfile} (100%) rename files/tests/pre-merge/{ubuntu-cabal-l.containerfile => ubuntu-cabal.containerfile} (100%) rename files/tests/pre-merge/{ubuntu-guild-deploy.sh-l.containerfile => ubuntu-guild-deploy.sh.containerfile} (100%) diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml deleted file mode 100644 index 8aad64d21..000000000 --- a/.github/workflows/autoupdate.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: autoupdate-branch -on: - push: - branches: - - alpha -jobs: - Autoupdate: - name: Auto-Update - runs-on: ubuntu-latest - steps: - - uses: tibdex/auto-update@v2 - with: - github_token: ${{secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/premerge.yml b/.github/workflows/premerge.yml index 69c4c550e..b0a0ce8dd 100644 --- a/.github/workflows/premerge.yml +++ b/.github/workflows/premerge.yml @@ -10,7 +10,7 @@ on: paths: - scripts/cnode-helper-scripts/guild-deploy.sh - scripts/cnode-helper-scripts/cabal-build-all.sh - - files/tests/pre-merge/debian-guild-deploy.sh-l.containerfile + - files/tests/pre-merge/ubuntu-guild-deploy.sh.containerfile jobs: guild-deploy-and-build: @@ -61,10 +61,10 @@ jobs: echo "This means the PR is from the same repository" echo "BUILD_G_ACCOUNT=${{ github.repository_owner }}" >> $GITHUB_ENV fi - - name: Testing guild-deploy.sh (IO fork of libsodium) + - name: Testing guild-deploy.sh (with libsodium) run: | docker build . \ - --file files/tests/pre-merge/${{ matrix.distro }}-guild-deploy.sh-l.containerfile \ + --file files/tests/pre-merge/${{ matrix.distro }}-guild-deploy.sh.containerfile \ --compress \ --build-arg BRANCH=$BRANCH \ --build-arg COMMIT=$COMMIT_SHA \ @@ -77,11 +77,11 @@ jobs: - name: Push pre-merge-${{ matrix.distro }}:guild-deploy-l_${{ env.COMMIT_SHA }} run: | docker push ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:guild-deploy-l_${{ env.COMMIT_SHA }} - - name: Testing cabal-build-all.sh (IO fork of libsodium) + - name: Testing cabal-build-all.sh (with libsodium) run: | echo "Working from PR Branch ${{ env.G_ACCOUNT }}/guild-operators/${{ env.BRANCH }} on COMMIT_SHA ${{ env.COMMIT_SHA }}" docker build . \ - --file files/tests/pre-merge/${{ matrix.distro }}-cabal-l.containerfile \ + --file files/tests/pre-merge/${{ matrix.distro }}-cabal.containerfile \ --compress \ --build-arg BRANCH=${{ env.BRANCH }} \ --build-arg COMMIT=${{ env.COMMIT_SHA }} \ diff --git a/files/docker/node/addons/guild-topology.sh b/files/docker/node/addons/guild-topology.sh deleted file mode 100755 index c3a8e30f3..000000000 --- a/files/docker/node/addons/guild-topology.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -export CNODE_HOME=/opt/cardano/cnode - -curl -s -k -o /tmp/guild_topology2.json "https://api.clio.one/htopology/v1/fetch/?max=20" - -cat /tmp/guild_topology2.json | awk '{print $3,$5}' | tail -n +2 | sed s/"\","//g | sed s/"\""//g | sed s/","//g | grep -v [a-z] > /tmp/guild_list1 - -# TCPPING metrics disabled -#IFS=$'\n'; for i in $(cat /tmp/guild_list1 ); do tcpping -x 1 $i | grep ms | awk '{print $9,$7}' >> /tmp/guild_list2 ; done -#cat /tmp/guild_list2 | sort -n | grep -v "ms" | head -n 8 | cut -d "(" -f 2 | cut -d ")" -f 1 > /tmp/fastest_guild.list -#IFS=$'\n'; for i in $(cat /tmp/fastest_guild.list); do cat /tmp/guild_list1 | grep "$i" >> /tmp/guild_list3; done - - -GUILD1=$(sed -n 1p /tmp/guild_list1 | awk '{print $1}') -GUILD1PORT=$(sed -n 1p /tmp/guild_list1 | awk '{print $2}') -GUILD2=$(sed -n 2p /tmp/guild_list1 | awk '{print $1}') -GUILD2PORT=$(sed -n 2p /tmp/guild_list1 | awk '{print $2}') -GUILD3=$(sed -n 3p /tmp/guild_list1 | awk '{print $1}') -GUILD3PORT=$(sed -n 3p /tmp/guild_list1 | awk '{print $2}') -GUILD4=$(sed -n 4p /tmp/guild_list1 | awk '{print $1}') -GUILD4PORT=$(sed -n 4p /tmp/guild_list1 | awk '{print $2}') -GUILD5=$(sed -n 5p /tmp/guild_list1 | awk '{print $1}') -GUILD5PORT=$(sed -n 5p /tmp/guild_list1 | awk '{print $2}') -GUILD6=$(sed -n 6p /tmp/guild_list1 | awk '{print $1}') -GUILD6PORT=$(sed -n 6p /tmp/guild_list1 | awk '{print $2}') -GUILD7=$(sed -n 7p /tmp/guild_list1 | awk '{print $1}') -GUILD7PORT=$(sed -n 7p /tmp/guild_list1 | awk '{print $2}') -GUILD8=$(sed -n 8p /tmp/guild_list1 | awk '{print $1}') -GUILD8PORT=$(sed -n 8p /tmp/guild_list1 | awk '{print $2}') - -cat < $CNODE_HOME/files/guildnet-topology.json -{ "resultcode": "201", "networkMagic": "764824073", "ipType":4, "Producers": [ - { "addr": "relays-new.cardano-mainnet.iohk.io", "port": 3001, "valency": 2, "distance":10 }, - { "addr": "$GUILD1", "port": $GUILD1PORT, "valency": 1, "distance":10 }, - { "addr": "$GUILD2", "port": $GUILD2PORT, "valency": 1, "distance":10 }, - { "addr": "$GUILD3", "port": $GUILD3PORT, "valency": 1, "distance":10 }, - { "addr": "$GUILD4", "port": $GUILD4PORT, "valency": 1, "distance":10 }, - { "addr": "$GUILD5", "port": $GUILD5PORT, "valency": 1, "distance":10 }, - { "addr": "$GUILD6", "port": $GUILD6PORT, "valency": 1, "distance":10 }, - { "addr": "$GUILD7", "port": $GUILD7PORT, "valency": 1, "distance":10 }, - { "addr": "$GUILD8", "port": $GUILD8PORT, "valency": 1, "distance":10 } -] } -EOF - -# rm /tmp/fastest_guild.list && -rm /tmp/guild_list* diff --git a/files/docker/node/dockerfile_bin b/files/docker/node/dockerfile_bin index 9782d4c14..7e00c06b7 100644 --- a/files/docker/node/dockerfile_bin +++ b/files/docker/node/dockerfile_bin @@ -23,7 +23,7 @@ ENV \ UPDATE_CHECK=N RUN apt-get update && apt-get install --no-install-recommends -y locales apt-utils sudo \ - && apt install -y curl wget gnupg git udev jq \ + && apt install -y curl wget udev jq \ && apt-get -y purge \ && apt-get -y clean \ && apt-get -y autoremove \ @@ -49,7 +49,6 @@ RUN set -x && apt update \ && chmod +x ./guild-deploy.sh && ./guild-deploy.sh -b ${GUILD_DEPLOY_BRANCH} -s p \ && ls /opt/ \ && mkdir -p $CNODE_HOME/priv/files \ - && apt-get -y remove libpq-dev build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ \ && apt-get -y purge \ && apt-get -y clean \ && apt-get -y autoremove \ @@ -59,9 +58,6 @@ RUN set -x && export SUDO='N' \ && export SKIP_DBSYNC_DOWNLOAD='Y' \ && export G_ACCOUNT=${G_ACCOUNT} \ && ./guild-deploy.sh -b ${GUILD_DEPLOY_BRANCH} -s dcmowx \ - && cd /usr/bin \ - && wget http://www.vdberg.org/~richard/tcpping \ - && chmod 755 tcpping \ && chown -R guild:guild $CNODE_HOME \ && mv /root/.local/bin /home/guild/.local/ \ && chown -R guild:guild /home/guild/.* @@ -98,7 +94,6 @@ RUN curl -sL -H "Accept: application/vnd.github.everest-preview+json" -H "Conte # ENTRY SCRIPT ADD https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/${GUILD_DEPLOY_BRANCH}/files/docker/node/addons/banner.txt \ - https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/${GUILD_DEPLOY_BRANCH}/files/docker/node/addons/guild-topology.sh \ https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/${GUILD_DEPLOY_BRANCH}/files/docker/node/addons/block_watcher.sh \ https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/${GUILD_DEPLOY_BRANCH}/files/docker/node/addons/healthcheck.sh /home/guild/.scripts/ ADD https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/${GUILD_DEPLOY_BRANCH}/scripts/cnode-helper-scripts/guild-deploy.sh \ diff --git a/files/docker/node/dockerfile_stage1 b/files/docker/node/dockerfile_stage1 deleted file mode 100644 index 19c55ea1a..000000000 --- a/files/docker/node/dockerfile_stage1 +++ /dev/null @@ -1,21 +0,0 @@ -FROM debian - -ARG G_ACCOUNT - -ENV \ -DEBIAN_FRONTEND=noninteractive \ -LANG=C.UTF-8 \ -ENV=/etc/profile \ -USER=root - -WORKDIR / - -RUN set -x && apt update \ - && mkdir -p /root/.local/bin && mkdir -p /root/.ghcup/bin \ - && apt install -y curl wget gnupg apt-utils git udev \ - && wget https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/master/scripts/cnode-helper-scripts/guild-deploy.sh \ - && export SUDO='N' \ - && export UPDATE_CHECK='N' \ - && export BOOTSTRAP_HASKELL_NO_UPGRADE=1 \ - && chmod +x ./guild-deploy.sh && ./guild-deploy.sh -s pbcowx \ - && apt-get -y purge && apt-get -y clean && apt-get -y autoremove && rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/files/docker/node/dockerfile_stage2 b/files/docker/node/dockerfile_stage2 deleted file mode 100644 index bc156f345..000000000 --- a/files/docker/node/dockerfile_stage2 +++ /dev/null @@ -1,30 +0,0 @@ -FROM cardanocommunity/cardano-node:stage1 - -ARG G_ACCOUNT - -ENV \ - CNODE_HOME=/opt/cardano/cnode \ - DEBIAN_FRONTEND=noninteractive \ - LANG=C.UTF-8 \ - USER=root \ - PATH=$CNODE_HOME/scripts:/root/.local/bin:/root/.ghcup/bin:$PATH - -RUN git clone https://github.com/intersectmbo/cardano-node.git \ - && export BOOTSTRAP_HASKELL_NO_UPGRADE=1 \ - && mkdir -p /root/.local/bin/ \ - && wget https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/master/files/docker/node/release-versions/cardano-node-latest.txt \ - && CNVERSION=$(cat cardano-node-latest.txt) \ - && cd cardano-node \ - && git fetch --tags --all && git checkout tags/$CNVERSION \ - && bash $CNODE_HOME/scripts/cabal-build-all.sh -l \ - && apt-get update -y && sudo apt-get install -y cargo automake build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 libtool autoconf \ - && git clone --recurse-submodules https://github.com/cardano-community/cncli \ - && cd cncli \ - && tag=`curl https://github.com/cardano-community/cncli/tags | grep "cncli/releases" | grep -v ">Releases<" | head -n 1 | cut -d ">" -f 3 | cut -d "<" -f 1` \ - && git checkout $tag \ - && curl https://sh.rustup.rs -sSf | sh -s -- -y \ - && ~/.cargo/bin/cargo install --path . --force \ - && ~/cncli/target/release/cncli --version \ - && mv ~/cncli/target/release/cncli /root/.local/bin/ \ - && apt-get -y remove libpq-dev build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ && apt-get -y purge && apt-get -y clean && apt-get -y autoremove \ - && cardano-node --version; diff --git a/files/docker/node/dockerfile_stage3 b/files/docker/node/dockerfile_stage3 deleted file mode 100644 index 6355fa3c5..000000000 --- a/files/docker/node/dockerfile_stage3 +++ /dev/null @@ -1,79 +0,0 @@ -FROM debian:stable-slim - -LABEL desc="Cardano Node by Guild's Operators" -ARG DEBIAN_FRONTEND=noninteractive -ARG G_ACCOUNT - -USER root -WORKDIR / - -ENV \ - ENV=/etc/profile \ - LC_ALL=en_US.UTF-8 \ - LANG=en_US.UTF-8 \ - LANGUAGE=en_US.UTF-8 \ - CNODE_HOME=/opt/cardano/cnode \ - CARDANO_NODE_SOCKET_PATH=$CNODE_HOME/sockets/node.socket \ - PATH=/opt/cardano/cnode/scripts:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/home/guild/.local/bin \ - GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt - -# COPY NODE BINS AND DEPS -COPY --from=cardanocommunity/cardano-node:stage2 /root/.local/bin/* /usr/local/bin/ -COPY --from=cardanocommunity/cardano-node:stage2 /opt/ /opt/ - -RUN chmod a+x /usr/local/bin/* && ls /opt/ \ - && mkdir -p $CNODE_HOME/priv/files - -# Install locales package -RUN apt-get update && apt-get install --no-install-recommends -y locales apt-utils - -# en_US.UTF-8 for inclusion in generation -RUN sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \ - && locale-gen \ - && echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc \ - && echo "export LANG=en_US.UTF-8" >> ~/.bashrc \ - && echo "export LANGUAGE=en_US.UTF-8" >> ~/.bashrc - -# PREREQ -RUN apt-get update && apt-get install -y procps libsecp256k1-0 libcap2 libselinux1 libc6 libsodium-dev ncurses-bin iproute2 curl wget apt-utils xz-utils netbase sudo coreutils dnsutils net-tools procps tcptraceroute bc usbip sqlite3 python3 tmux jq ncurses-base libtool autoconf git gnupg tcptraceroute util-linux less openssl bsdmainutils dialog \ - && apt-get install -y --no-install-recommends cron \ - && sudo apt-get -y purge && sudo apt-get -y clean && sudo apt-get -y autoremove && sudo rm -rf /var/lib/apt/lists/* # && sudo rm -rf /usr/bin/apt* - -RUN cd /usr/bin \ - && sudo wget http://www.vdberg.org/~richard/tcpping \ - && sudo chmod 755 tcpping - -# SETUP Guild USER -RUN adduser --disabled-password --gecos '' guild \ - && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \ - && adduser guild sudo \ - && chown -R guild:guild /home/guild/.* - -USER guild -WORKDIR /home/guild - -# Commit Version -RUN curl -sL -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/${G_ACCOUNT}/guild-operators/commits | grep -v md | grep -A 2 guild-deploy.sh | grep sha | head -n 1 | cut -d "\"" -f 4 > ~/guild-latest.txt - -RUN echo "head -n 8 /home/guild/.scripts/banner.txt" >> ~/.bashrc \ - && echo "grep MENU -A 6 /home/guild/.scripts/banner.txt | grep -v MENU" >> ~/.bashrc \ - && echo "alias env=/usr/bin/env" >> ~/.bashrc \ - && echo "alias cntools=$CNODE_HOME/scripts/cntools.sh" >> ~/.bashrc \ - && echo "alias gLiveView=$CNODE_HOME/scripts/gLiveView.sh" >> ~/.bashrc \ - && echo "export PATH=/opt/cardano/cnode/scripts:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/home/guild/.local/bin" >> ~/.bashrc - -# ENTRY SCRIPT -ADD https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/master/files/docker/node/addons/banner.txt /home/guild/.scripts/ -ADD https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/master/files/docker/node/addons/guild-topology.sh /home/guild/.scripts/ -ADD https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/master/files/docker/node/addons/block_watcher.sh /home/guild/.scripts/ -ADD https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/master/files/docker/node/addons/healthcheck.sh /home/guild/.scripts/ -ADD https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/master/scripts/cnode-helper-scripts/guild-deploy.sh /opt/cardano/cnode/scripts/ -ADD https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/master/files/docker/node/addons/entrypoint.sh ./ - -RUN sudo chown -R guild:guild $CNODE_HOME/* \ - && sudo chown -R guild:guild /home/guild/.* \ - && sudo chmod a+x /home/guild/.scripts/*.sh /opt/cardano/cnode/scripts/*.sh /home/guild/entrypoint.sh - -HEALTHCHECK --start-period=5m --interval=5m --timeout=100s CMD /home/guild/.scripts/healthcheck.sh - -ENTRYPOINT ["./entrypoint.sh"] diff --git a/files/docker/wallet/dockerfile_wallet_stage2 b/files/docker/wallet/dockerfile_wallet_stage2 deleted file mode 100644 index 7c3c556b2..000000000 --- a/files/docker/wallet/dockerfile_wallet_stage2 +++ /dev/null @@ -1,21 +0,0 @@ -FROM cardanocommunity/cardano-node:stage1 - -ENV \ -CNODE_HOME=/opt/cardano/cnode \ -DEBIAN_FRONTEND=noninteractive \ -LANG=C.UTF-8 \ -USER=root \ -PATH=$CNODE_HOME/scripts:/root/.local/bin:/root/.ghcup/bin:/root/.local/bin:$PATH - -RUN git clone https://github.com/cardano-foundation/cardano-wallet.git \ - && cd cardano-wallet \ - && git fetch --tags --all \ - && git pull \ - && git checkout master \ - && $CNODE_HOME/scripts/stack-build.sh \ - && for i in $(ls /root/.local/bin); do ldd /root/.local/bin/$i | cut -d ">" -f 2 | cut -d "(" -f 1| sed 's/[[:blank:]]//g' > /tmp/liblisttmp ; done \ - && cat /tmp/liblisttmp | sort | uniq > /tmp/liblist \ - && apt-get -y remove libpq-dev build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ && apt-get -y purge && apt-get -y clean && apt-get -y autoremove \ - && WBIN=$(find / -name cardano-address | grep bin | sed 's/\/cardano-address//') && cp $WBIN/* /root/.local/bin/ \ - && cd .. && rm -rf cardano-wallet && rm -rf /tmp/* \ - && ls /root/.local/bin diff --git a/files/node-deps.json b/files/node-deps.json index 17d14e84b..450215c64 100644 --- a/files/node-deps.json +++ b/files/node-deps.json @@ -5,7 +5,7 @@ "secp256k1": "v0.3.2", "sodium": "dbb48cce5429cb6585c9034f002568964f1ce567" }, - "8.9.2": + "8.9.3": { "blst": "3dd0f804b1819e5d03fb22ca2e6fac105932043a", "secp256k1": "v0.3.2", diff --git a/files/tests/pre-merge/debian-cabal-l.containerfile b/files/tests/pre-merge/debian-cabal.containerfile similarity index 100% rename from files/tests/pre-merge/debian-cabal-l.containerfile rename to files/tests/pre-merge/debian-cabal.containerfile diff --git a/files/tests/pre-merge/debian-guild-deploy.sh-l.containerfile b/files/tests/pre-merge/debian-guild-deploy.sh.containerfile similarity index 100% rename from files/tests/pre-merge/debian-guild-deploy.sh-l.containerfile rename to files/tests/pre-merge/debian-guild-deploy.sh.containerfile diff --git a/files/tests/pre-merge/rockylinux-cabal-l.containerfile b/files/tests/pre-merge/rockylinux-cabal.containerfile similarity index 100% rename from files/tests/pre-merge/rockylinux-cabal-l.containerfile rename to files/tests/pre-merge/rockylinux-cabal.containerfile diff --git a/files/tests/pre-merge/rockylinux-guild-deploy.sh-l.containerfile b/files/tests/pre-merge/rockylinux-guild-deploy.sh.containerfile similarity index 100% rename from files/tests/pre-merge/rockylinux-guild-deploy.sh-l.containerfile rename to files/tests/pre-merge/rockylinux-guild-deploy.sh.containerfile diff --git a/files/tests/pre-merge/ubuntu-cabal-l.containerfile b/files/tests/pre-merge/ubuntu-cabal.containerfile similarity index 100% rename from files/tests/pre-merge/ubuntu-cabal-l.containerfile rename to files/tests/pre-merge/ubuntu-cabal.containerfile diff --git a/files/tests/pre-merge/ubuntu-guild-deploy.sh-l.containerfile b/files/tests/pre-merge/ubuntu-guild-deploy.sh.containerfile similarity index 100% rename from files/tests/pre-merge/ubuntu-guild-deploy.sh-l.containerfile rename to files/tests/pre-merge/ubuntu-guild-deploy.sh.containerfile diff --git a/scripts/cnode-helper-scripts/guild-deploy.sh b/scripts/cnode-helper-scripts/guild-deploy.sh index 301580944..361591bad 100755 --- a/scripts/cnode-helper-scripts/guild-deploy.sh +++ b/scripts/cnode-helper-scripts/guild-deploy.sh @@ -107,9 +107,9 @@ set_defaults() { [[ -z "${BRANCH}" ]] && BRANCH="master" [[ "${SUDO}" = 'Y' ]] && sudo="sudo" || sudo="" [[ "${SUDO}" = 'Y' && $(id -u) -eq 0 ]] && err_exit "Please run as non-root user." + [[ -z "${CARDANO_NODE_VERSION}" ]] && CARDANO_NODE_VERSION="8.9.3" CNODE_HOME="${CNODE_PATH}/${CNODE_NAME}" CNODE_VNAME=$(echo "$CNODE_NAME" | awk '{print toupper($0)}') - CARDANO_NODE_VERSION="8.9.2" REPO="https://github.com/${G_ACCOUNT}/guild-operators" REPO_RAW="https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators" URL_RAW="${REPO_RAW}/${BRANCH}" @@ -204,13 +204,22 @@ os_dependencies() { if [[ "${OS_ID}" =~ ebian ]] || [[ "${OS_ID}" =~ buntu ]] || [[ "${DISTRO}" =~ ebian ]] || [[ "${DISTRO}" =~ buntu ]]; then #Debian/Ubuntu pkgmgrcmd="env NEEDRESTART_MODE=a env DEBIAN_FRONTEND=noninteractive env DEBIAN_PRIORITY=critical apt-get" - libncurses_pkg="libncursesw5" - [[ -f /etc/debian_version ]] && grep -q trixie /etc/debian_version && libncurses_pkg="libncursesw6" - pkg_list="python3 pkg-config libssl-dev ${libncurses_pkg} libtinfo-dev systemd libsystemd-dev libsodium-dev tmux git jq libtool bc gnupg libtool secure-delete iproute2 tcptraceroute sqlite3 bsdmainutils libusb-1.0-0-dev libudev-dev unzip llvm clang libnuma-dev libpq-dev build-essential libffi-dev libgmp-dev zlib1g-dev make g++ autoconf automake liblmdb-dev procps xxd" + pkg_list="python3 pkg-config systemd tmux git jq libtool bc gnupg libtool secure-delete iproute2 tcptraceroute sqlite3 bsdmainutils unzip procps xxd" + if [[ "${LIBSODIUM_FORK}" == "Y" ]] || [[ "${WANT_BUILD_DEPS}" == "Y" ]]; then + pkg_list="${pkg_list} build-essential make g++ autoconf automake" + fi + if [[ "${WANT_BUILD_DEPS}" == "Y" ]]; then + libncurses_pkg="libncursesw5" + [[ -f /etc/debian_version ]] && grep -q trixie /etc/debian_version && libncurses_pkg="libncursesw6" + pkg_list="${pkg_list} ${libncurses_pkg} libtinfo-dev libnuma-dev libpq-dev liblmdb-dev libffi-dev libgmp-dev libssl-dev libsystemd-dev libsodium-dev zlib1g-dev llvm clang" + fi + if [[ "${INSTALL_CWHCLI}" == "Y" ]]; then + pkg_list="${pkg_list} libusb-1.0-0-dev libudev-dev" + fi elif [[ "${OS_ID}" =~ rhel ]] || [[ "${OS_ID}" =~ fedora ]] || [[ "${DISTRO}" =~ Fedora ]]; then #CentOS/RHEL/Fedora/RockyLinux pkgmgrcmd="dnf" - pkg_list="python3 coreutils ncurses-devel ncurses-libs openssl-devel systemd systemd-devel libsodium-devel tmux git jq gnupg2 libtool iproute bc traceroute sqlite util-linux xz wget unzip procps-ng llvm clang numactl-devel libffi-devel gmp-devel zlib-devel make gcc-c++ autoconf udev lmdb-devel vim-common" + pkg_list="python3 coreutils systemd tmux git jq gnupg2 libtool iproute bc traceroute sqlite util-linux xz unzip procps-ng udev vim-common" if [[ "${VERSION_ID}" == "2" ]] ; then #AmazonLinux2 pkg_list="${pkg_list} libusb ncurses-compat-libs pkgconfig srm" @@ -228,14 +237,13 @@ os_dependencies() { pkg_opts="${pkg_opts} --allowerasing" pkg_list="${pkg_list} libusbx ncurses-compat-libs pkgconf-pkg-config srm" fi - add_epel_repository "${DISTRO}" "${VERSION_ID}" "${pkg_opts}" - if [ -f /usr/lib64/libtinfo.so ] && [ -f /usr/lib64/libtinfo.so.5 ]; then - echo -e "\n Symlink updates not required for ncurse libs, skipping.." - else - echo -e "\n Updating symlinks for ncurse libs.." - $sudo ln -s "$(find /usr/lib64/libtinfo.so* | tail -1)" /usr/lib64/libtinfo.so - $sudo ln -s "$(find /usr/lib64/libtinfo.so* | tail -1)" /usr/lib64/libtinfo.so.5 + if [[ "${LIBSODIUM_FORK}" == "Y" ]] || [[ "${WANT_BUILD_DEPS}" == "Y" ]]; then + pkg_list="${pkg_list} make gcc-c++ autoconf automake" fi + if [[ "${WANT_BUILD_DEPS}" == "Y" ]]; then + pkg_list="${pkg_list} ncurses-libs ncurses-devel openssl-devel systemd-devel libsodium-devel llvm clang numactl-devel libffi-devel gmp-devel zlib-devel lmdb-devel" + fi + add_epel_repository "${DISTRO}" "${VERSION_ID}" "${pkg_opts}" else echo -e "\nWe have no automated procedures for this ${DISTRO} system" err_exit @@ -253,6 +261,15 @@ os_dependencies() { echo -e "\nIt would be best if you could submit an issue at ${REPO} with the details to tackle in future, as some errors may be due to external/already present dependencies" err_exit fi + if [[ "${OS_ID}" =~ rhel ]] || [[ "${OS_ID}" =~ fedora ]] || [[ "${DISTRO}" =~ Fedora ]]; then + if [ -f /usr/lib64/libtinfo.so ] && [ -f /usr/lib64/libtinfo.so.5 ]; then + echo -e "\n Symlink updates not required for ncurse libs, skipping.." + else + echo -e "\n Updating symlinks for ncurse libs.." + $sudo ln -s "$(find /usr/lib64/libtinfo.so* | tail -1)" /usr/lib64/libtinfo.so + $sudo ln -s "$(find /usr/lib64/libtinfo.so* | tail -1)" /usr/lib64/libtinfo.so.5 + fi + fi } # Build Dependencies for cabal builds @@ -654,13 +671,13 @@ parse_args() { if [[ -n "${S_ARGS}" ]]; then [[ "${S_ARGS}" =~ "p" ]] && INSTALL_OS_DEPS="Y" [[ "${S_ARGS}" =~ "b" ]] && INSTALL_OS_DEPS="Y" && WANT_BUILD_DEPS="Y" - [[ "${S_ARGS}" =~ "l" ]] && INSTALL_OS_DEPS="Y" && WANT_BUILD_DEPS="Y" && INSTALL_LIBSODIUM_FORK="Y" + [[ "${S_ARGS}" =~ "l" ]] && INSTALL_OS_DEPS="Y" && INSTALL_LIBSODIUM_FORK="Y" [[ "${S_ARGS}" =~ "m" ]] && INSTALL_MITHRIL="Y" [[ "${S_ARGS}" =~ "f" ]] && FORCE_OVERWRITE="Y" && POPULATE_CNODE="F" [[ "${S_ARGS}" =~ "d" ]] && INSTALL_CNODEBINS="Y" [[ "${S_ARGS}" =~ "c" ]] && INSTALL_CNCLI="Y" [[ "${S_ARGS}" =~ "o" ]] && INSTALL_OGMIOS="Y" - [[ "${S_ARGS}" =~ "w" ]] && INSTALL_CWHCLI="Y" + [[ "${S_ARGS}" =~ "w" ]] && INSTALL_OS_DEPS="Y" && INSTALL_CWHCLI="Y" [[ "${S_ARGS}" =~ "x" ]] && INSTALL_CARDANO_SIGNER="Y" else echo -e "\nNothing to do.." diff --git a/scripts/grest-helper-scripts/setup-grest.sh b/scripts/grest-helper-scripts/setup-grest.sh index 6fdfca888..b95fe4fb8 100755 --- a/scripts/grest-helper-scripts/setup-grest.sh +++ b/scripts/grest-helper-scripts/setup-grest.sh @@ -200,11 +200,10 @@ SGVERSION=v1.1.2 parse_args() { if [[ -z "${I_ARGS}" ]]; then - ! command -v haproxy >/dev/null && INSTALL_HAPROXY="Y" + [[ ! -f /usr/sbin/haproxy ]] && INSTALL_HAPROXY="Y" [[ ! -f "${CNODE_HOME}"/scripts/grest-exporter.sh ]] && INSTALL_MONITORING_AGENTS="Y" # absence of haproxy.cfg or grest.conf at mentioned path would mean setup is not updated, or has not been run - hence, overwrite all - [[ ! -f "${HAPROXY_CFG}" ]] && OVERWRITE_CONFIG="Y" - [[ ! -f "${CNODE_HOME}"/priv/grest.conf ]] && OVERWRITE_CONFIG="Y" + [[ ! -f "${HAPROXY_CFG}" ]] || [[ ! -f "${CNODE_HOME}"/priv/grest.conf ]] && OVERWRITE_CONFIG="Y" else [[ "${I_ARGS}" =~ "p" ]] && INSTALL_POSTGREST="Y" && DB_QRY_UPDATES="Y" [[ "${I_ARGS}" =~ "r" ]] && INSTALL_HAPROXY="Y" @@ -305,11 +304,14 @@ SGVERSION=v1.1.2 if curl -sL -f -m ${CURL_TIMEOUT} -o haproxy.tar.gz "${haproxy_url}"; then tar xf haproxy.tar.gz &>/dev/null && rm -f haproxy.tar.gz if command -v apt-get >/dev/null; then - sudo apt-get -y install libpcre3-dev >/dev/null || err_exit "'sudo apt-get -y install libpcre3-dev' failed!" + pkg_installer="apt-get" + pkg_list="build-essential make g++ autoconf automake libpcre-dev libssl-dev libsystemd-dev zlib1g-dev" fi if command -v dnf >/dev/null; then - sudo dnf -y install pcre-devel >/dev/null || err_exit "'sudo dnf -y install prce-devel' failed!" + pkg_installer="dnf" + pkg_list="make gcc gcc-c++ autoconf automake pcre-devel openssl-devel systemd-devel zlib-devel" fi + sudo ${pkg_installer} -y install ${pkg_list} >/dev/null || err_exit "'sudo ${pkg_installer} -y install ${pkg_list}' failed!" cd haproxy-${major_v}.${minor_v} || return make clean >/dev/null make -j $(nproc) TARGET=linux-glibc USE_ZLIB=1 USE_LIBCRYPT=1 USE_OPENSSL=1 USE_PCRE=1 USE_SYSTEMD=1 USE_PROMEX=1 >/dev/null