Skip to content

Commit

Permalink
moving pr 1743 to node 8.9.1 (#1747)
Browse files Browse the repository at this point in the history
## Description

- Branched from:
#1743
- Updated CARDANO_NODE_VERSION to 8.9.1
- updated node-deps.json to 8.9.1
- updated blst to latest per release specs
- Added Fork/Branch ARG to dockerfile_bin & entrypoint.sh to enable
docker test/dev on forked repos
- added missing jg dep in docker build based on build errors


## Where should the reviewer start?
This should be merged into the original branch (node-8.9.0) and tested
more extensively. I can help in that effort but this is my first
contribution and my automated test env and familiarity is lacking.

## Motivation and context
- Reduce node release implementation timetable for guild-operators
docker images.
- Enable docker development from Forks
- Give back and contribute to the
[guild-operators](https://github.com/cardano-community/guild-operators)

## Which issue it fixes?
updating this existing branch (node-8.9.0) to 8.9.1 release ref PR:
(#1743)

## How has this been tested?
Successfully deployed and completely synced nodes using the Docker image
and Host env on mainnet, preprod, preview networks. No further
functionality has been verified. This should be considered as untested
and is not ready for production.

---------

Co-authored-by: rdlrt <3169068+rdlrt@users.noreply.github.com>
Co-authored-by: Shane Powser <shane.powser@hotmail.com>
Co-authored-by: Ben Zawodni <benjamin.zawodni@stellantis.com>
Co-authored-by: illuminatus <trevor.benson@gmail.com>
Co-authored-by: fuma419 <you@example.com>
  • Loading branch information
6 people committed May 3, 2024
1 parent 9bee29c commit 521a2b0
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 36 deletions.
57 changes: 32 additions & 25 deletions .github/workflows/premerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
distro: [rockylinux, ubuntu]
env:
REGISTRY: ghcr.io
BRANCH: ${{ github.event.inputs.branch || '' }}
BRANCH: ${{ github.event.inputs.branch || github.head_ref }}
if: github.event.pull_request.draft == false
steps:
- name: Maximize build space
Expand All @@ -45,63 +45,70 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- name: Define BRANCH, COMMIT and G_ACCOUNT in environment
- name: Define BRANCH, COMMIT_SHA and G_ACCOUNT in environment
run: |
echo "G_ACCOUNT=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_ENV
if [[ -z "${{ env.BRANCH }}" ]]; then
echo "BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
echo "COMMIT=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV
echo "IS_FORK=${{ github.event.pull_request.head.repo.fork }}" >> $GITHUB_ENV
echo "FORK_OWNER=${{ github.event.pull_request.head.repo.owner.login }}" >> $GITHUB_ENV
echo "G_ACCOUNT=${{ github.repository_owner }}" >> $GITHUB_ENV
echo "COMMIT_SHA=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
- name: Setup G_ACCOUNT based on fork status
run: |
if [ "$IS_FORK" = "true" ]; then
echo "This means the PR is from a fork"
echo "BUILD_G_ACCOUNT=${{ github.event.pull_request.head.repo.owner.login }}" >> $GITHUB_ENV
else
echo "COMMIT=$(git rev-parse --short ${{ env.BRANCH }})" >> $GITHUB_ENV
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)
run: |
docker build . \
--file files/tests/pre-merge/${{ matrix.distro }}-guild-deploy.sh-l.containerfile \
--compress \
--build-arg BRANCH=${{ env.BRANCH }} \
--build-arg COMMIT=${{ env.COMMIT }} \
--build-arg G_ACCOUNT=${{ env.G_ACCOUNT }} \
--tag ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:guild-deploy-l_${{ env.COMMIT }}
--build-arg BRANCH=$BRANCH \
--build-arg COMMIT=$COMMIT_SHA \
--build-arg G_ACCOUNT=${{ env.BUILD_G_ACCOUNT }} \
--tag $REGISTRY/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:guild-deploy-l_$COMMIT_SHA
- name: Get Image ID
run: |
PREMERGE_IMAGE_ID1=$(docker inspect ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:guild-deploy-l_${{ env.COMMIT }} --format='{{.Id}}')
PREMERGE_IMAGE_ID1=$(docker inspect ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:guild-deploy-l_${{ env.COMMIT_SHA }} --format='{{.Id}}')
echo "PREMERGE_IMAGE_ID1=${PREMERGE_IMAGE_ID1}" >> $GITHUB_ENV
- name: Push pre-merge-${{ matrix.distro }}:guild-deploy-l_${{ env.COMMIT }}
- 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 }}
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)
run: |
echo "Working from PR Branch ${{ env.G_ACCOUNT }}/guild-operators/${{ env.BRANCH }} on Commit ${{ env.COMMIT }}"
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 \
--compress \
--build-arg BRANCH=${{ env.BRANCH }} \
--build-arg COMMIT=${{ env.COMMIT }} \
--build-arg G_ACCOUNT=${{ env.G_ACCOUNT }} \
--tag ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT }}
--build-arg COMMIT=${{ env.COMMIT_SHA }} \
--build-arg G_ACCOUNT=${{ env.BUILD_G_ACCOUNT }} \
--tag ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT_SHA }}
- name: Get Versions and Image ID
run: |
VERSION_DETAILS=($(docker run --rm ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT }} cardano-node --version | awk '/^cardano-node/'))
PREMERGE_IMAGE_ID2=$(docker inspect ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT }} --format='{{.Id}}')
VERSION_DETAILS=($(docker run --rm ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT_SHA }} cardano-node --version | awk '/^cardano-node/'))
PREMERGE_IMAGE_ID2=$(docker inspect ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT_SHA }} --format='{{.Id}}')
echo "CARDANO_NODE_VERSION=${VERSION_DETAILS[1]}" >> $GITHUB_ENV
echo "GHC_VERSION=${VERSION_DETAILS[5]}" >> $GITHUB_ENV
echo "PREMERGE_IMAGE_ID2=${PREMERGE_IMAGE_ID2}" >> $GITHUB_ENV
- name: Push pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT }}
- name: Push pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT_SHA }}
run: |
docker push ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT }}
docker push ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT_SHA }}
- name: Add summary details
if: always()
run: |
echo "## Pre-Merge Summary Details" >> $GITHUB_STEP_SUMMARY
echo "| Name | Value |" >> $GITHUB_STEP_SUMMARY
echo "| ---- | ----- |" >> $GITHUB_STEP_SUMMARY
echo "| Guild Deploy Image | ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:guild-deploy-l_${{ env.COMMIT }} |" >> $GITHUB_STEP_SUMMARY
echo "| Guild Deploy Image | ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:guild-deploy-l_${{ env.COMMIT_SHA }} |" >> $GITHUB_STEP_SUMMARY
echo "| Guild Deploy Image ID | ${{ env.PREMERGE_IMAGE_ID1 }} |" >> $GITHUB_STEP_SUMMARY
echo "| Cabal Build Image | ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT }} |" >> $GITHUB_STEP_SUMMARY
echo "| Cabal Build Image | ${{ env.REGISTRY }}/${{ env.G_ACCOUNT }}/pre-merge-${{ matrix.distro }}:cabal-l_${{ env.COMMIT_SHA }} |" >> $GITHUB_STEP_SUMMARY
echo "| Cabal Build Image ID | ${{ env.PREMERGE_IMAGE_ID2 }} |" >> $GITHUB_STEP_SUMMARY
echo "| G_ACCOUNT | ${{ env.G_ACCOUNT }} |" >> $GITHUB_STEP_SUMMARY
echo "| BRANCH | ${{ env.BRANCH }} |" >> $GITHUB_STEP_SUMMARY
echo "| COMMIT | ${{ env.COMMIT }} |" >> $GITHUB_STEP_SUMMARY
echo "| COMMIT_SHA | ${{ env.COMMIT_SHA }} |" >> $GITHUB_STEP_SUMMARY
echo "| CARDANO_NODE_VERSION | ${{ env.CARDANO_NODE_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| GHC_VERSION | ${{ env.GHC_VERSION }} |" >> $GITHUB_STEP_SUMMARY
10 changes: 5 additions & 5 deletions files/docker/node/dockerfile_bin
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ STOPSIGNAL SIGINT

LABEL desc="Cardano Node by Guild's Operators"
ARG DEBIAN_FRONTEND=noninteractive
ARG G_ACCOUNT
ARG GUILD_DEPLOY_BRANCH
ARG G_ACCOUNT=cardano-community
ARG GUILD_DEPLOY_BRANCH=master

USER root
WORKDIR /
Expand Down Expand Up @@ -39,15 +39,15 @@ RUN adduser --disabled-password --gecos '' guild \
&& adduser guild sudo \
&& mkdir -pv /home/guild/.local/ /home/guild/.scripts/


RUN set -x && apt update \
&& apt-get update \
&& mkdir -p /root/.local/bin \
&& wget https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/${GUILD_DEPLOY_BRANCH}/scripts/cnode-helper-scripts/guild-deploy.sh \
&& export SUDO='N' \
&& export UPDATE_CHECK='N' \
&& export SKIP_DBSYNC_DOWNLOAD='Y' \
&& chmod +x ./guild-deploy.sh && ./guild-deploy.sh -b ${GUILD_DEPLOY_BRANCH} -s p \
&& export G_ACCOUNT=${G_ACCOUNT} \
&& 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++ \
Expand All @@ -56,10 +56,10 @@ RUN set -x && apt update \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/*


RUN set -x && export SUDO='N' \
&& export UPDATE_CHECK='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 \
Expand Down
6 changes: 3 additions & 3 deletions files/node-deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"secp256k1": "v0.3.2",
"sodium": "dbb48cce5429cb6585c9034f002568964f1ce567"
},
"8.9.0":
"8.9.2":
{
"blst": "v0.3.11",
"blst": "3dd0f804b1819e5d03fb22ca2e6fac105932043a",
"secp256k1": "v0.3.2",
"sodium": "dbb48cce5429cb6585c9034f002568964f1ce567"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ENV \

WORKDIR /

RUN dnf -y --allowerasing install findutils &&\
RUN dnf -y --allowerasing install findutils jq &&\
dnf clean all &&\
mkdir -pv /root/.local/bin /root/.ghcup/bin &&\
curl -s -f -k -o guild-deploy.sh "https://raw.githubusercontent.com/${G_ACCOUNT}/guild-operators/${BRANCH}/scripts/cnode-helper-scripts/guild-deploy.sh" &&\
Expand Down
3 changes: 2 additions & 1 deletion scripts/cnode-helper-scripts/env
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,8 @@ fi
node_version="$(${CNODEBIN} version | head -1 | cut -d' ' -f2)"
cli_version="$(${CCLI} version | head -1 | cut -d' ' -f2)"
if ! versionCheck "8.9.0" "${node_version}" || ! versionCheck "8.20.3.0" "${cli_version}"; then
if ! versionCheck "8.9.2" "${node_version}" || ! versionCheck "8.20.3.0" "${cli_version}"; then
echo -e "\nKoios scripts have now been upgraded to support cardano-node 8.9.x ('${node_version}' found) / cardano-cli 8.20.x.x ('${cli_version}' found).\nPlease update cardano-node binaries (ensure to read release notes and update various configs using guild-deploy (use appropriate options to download/install/overwrite parts you need) or use tagged branches for older node version (eg: ./<script>.sh -b node-8.1.2 to switch scripts to an older branch).\n\n"
return 1
fi
Expand Down
3 changes: 2 additions & 1 deletion scripts/cnode-helper-scripts/guild-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,10 @@ download_cnodebins() {
curl -m 200 -sfL https://github.com/intersectmbo/cardano-addresses/releases/download/3.12.0/cardano-addresses-3.12.0-linux64.tar.gz -o caddress.tar.gz || err_exit " Could not download cardano-wallet's latest release archive from GitHub!"
tar zxf caddress.tar.gz --strip-components 1 bin/cardano-address &>/dev/null
rm -f caddress.tar.gz
[[ -f cardano-address ]] || err_exit " cardano-address archive downloaded but binary (bin/cardano-address) not found after extracting package!"
[[ -f cardano-address ]] || err_exit " cardano-address archive downloaded but binary (cardano-address) not found after extracting package!"
if [[ "${SKIP_DBSYNC_DOWNLOAD}" == "N" ]]; then
echo -e "\n Downloading Cardano DB Sync archive created from GitHub.."

# TODO: Replace CI Build artifact against 13.2.0.2 tag with release from github artefacts once available
#curl -m 200 -sfL https://github.com/IntersectMBO/cardano-db-sync/releases/download/13.2.0.2/cardano-db-sync-13.2.0.1-linux.tar.gz -o cnodedbsync.tar.gz || err_exit " Could not download cardano-db-sync release 13.2.0.2 from GitHub!"
curl -m 200 -sfL https://ci.iog.io/build/3736263/download/1/cardano-db-sync-13.2.0.2-linux.tar.gz -o cnodedbsync.tar.gz || err_exit " Could not download cardano-db-sync release 13.2.0.2 from GitHub!"
Expand Down

0 comments on commit 521a2b0

Please sign in to comment.