Skip to content

Node sync tests

Node sync tests #399

Workflow file for this run

name: node_sync_tests
on:
workflow_dispatch:
branches:
- artur/add_rss_ram
inputs:
environment:
description: Environment on which Buildkite agent will run tests
type: choice
options:
- mainnet
- preprod
- preview
- shelley-qa
default: mainnet
build_mode:
description: Currently only nix is supported, there are no prebuilt CI binaries available anymore. Windows agents can only build with cabal - nix is not supported.
type: choice
options:
- nix
default: nix
tag_no1:
description: rev_label in db/visuals (1.33.0-rc2 (tag number) or 1.33.0 (release number) or 1.33.0_PR2124 (for not released and not tagged runs with a specific node PR/version))
required: true
default: "9.2.1-bootstrap-peers"
node_rev1:
description: Desired cardano-node revision (used for initial sync) - cardano-node (tags/1.33.0-rc2) tag or branch
required: true
default: "tags/9.2.1"
node_topology1:
description: Desired cardano-node topology type (used for initial sync) - legacy, p2p
type: choice
options:
- legacy
- non-bootstrap-peers
- bootstrap-peers
default: bootstrap-peers
node_start_arguments1:
description: Extra arguments to be used when starting the node using tag_no1 (--a1 --a2 21)
required: false
default: "None"
tag_no2:
description: rev_label in db/visuals (1.33.0-rc2 (tag number) or 1.33.0 (release number) or 1.33.0_PR2124 (for not released and not tagged runs with a specific node PR/version))
required: true
default: "None"
node_rev2:
description: Desired cardano-node revision (used for final sync) - cardano-node (tags/1.33.0-rc2) tag or branch
required: true
default: "None"
node_topology2:
description: Desired cardano-node topology type (used for final sync) - legacy, p2p
type: choice
options:
- legacy
- non-bootstrap-peers
- bootstrap-peers
default: bootstrap-peers
node_start_arguments2:
description: Extra arguments to be used when starting the node using tag_no2 (--a1 --a2 21)
required: false
default: "None"
jobs:
node_sync_test:
strategy:
matrix:
env: [preprod]
ghc: ["9.6"]
cabal: ["3.12.1.0"]
sys:
- { os: windows-latest, shell: 'C:/msys64/usr/bin/bash.exe -e {0}' }
- { os: ubuntu-latest, shell: bash }
- { os: macos-latest, shell: bash }
branch:
- artur/add_rss_ram
fail-fast: false
runs-on: ${{ matrix.sys.os }}
timeout-minutes: 600
# defaults:
# run:
# shell: ${{ matrix.sys.shell }}
env:
# Modify this value to "invalidate" the cabal cache.
CABAL_CACHE_VERSION: "2024-07-26"
MSYS2_PATH_TYPE: inherit
MSYSTEM: MINGW64
steps:
- name: Install Haskell
if: matrix.sys.os == 'windows-latest'
uses: input-output-hk/actions/haskell@latest
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
#- name: Update Windows path with executables locations
# if: runner.os == 'Windows'
# shell: pwsh
# run: |
# $env:PATH+="D:\a\cardano-node-tests\cardano-node-tests\cardano_node_tests"
# git config --system core.longpaths true
- name: Install system dependencies
uses: input-output-hk/actions/base@latest
with:
use-sodium-vrf: true
- uses: actions/checkout@v4
#- name: Cabal update
# run: cabal update
- name: Configure build
run: |
cp .github/workflows/cabal.project.local.ci cabal.project.local
echo "# cabal.project.local"
cat cabal.project.local
#- uses: actions/checkout@v4
#- name: "[PowerShell] Add build script path"
# if: runner.os == 'Windows'
# shell: pwsh
# run: Add-Content $env:GITHUB_PATH "$(pwd)/.github/bin"
- name: Checkout cardano-node-tests repo
uses: actions/checkout@v4
with:
path: cardano_node_tests
ref: artur/add_rss_ram
- uses: cachix/install-nix-action@v27
if: matrix.sys.os != 'windows-latest'
with:
extra_nix_config: |
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://cache.nixos.org https://cache.iog.io
allow-import-from-derivation = true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python dependencies
run: |
pip install pymysql
pip install requests
pip install psutil
pip install pandas
pip install blockfrost-python
pip install GitPython
pip install colorama
- name: "[windows] update environment variables"
if: runner.os == 'Windows'
shell: pwsh
run: |
"PATH=C:\\msys64\\mingw64\\opt\\cardano\\bin;C:\\msys64\\mingw64\\bin;{0}" -f $env:PATH >> $env:GITHUB_ENV
"PKG_CONFIG_PATH=C:\\msys64\\mingw64\\opt\\cardano\\lib\\pkgconfig;C:\\msys64\\mingw64\\lib\\pkgconfig;C:\\msys64\\mingw64\\share\\pkgconfig;C:\\msys64\\usr\\lib\\pkgconfig;C:\\msys64\\usr\\share\\pkgconfig;{0}" -f $env:PKG_CONFIG_PATH >> $env:GITHUB_ENV
- name: Run sync test
env:
BLOCKFROST_API_KEY: ${{ secrets.BLOCKFROST_API_KEY }}
run: |
cd cardano_node_tests
echo "current branch: $(git branch --show-current)"
python sync_tests/node_sync_test.py -e ${{ matrix.env }} -b ${{ github.event.inputs.build_mode }} -t1 "${{ github.event.inputs.tag_no1 }}" -t2 "${{ github.event.inputs.tag_no2 }}" -r1 "${{ github.event.inputs.node_rev1 }}" -r2 "${{ github.event.inputs.node_rev2 }}" -n1 "${{ github.event.inputs.node_topology1 }}" -n2 "${{ github.event.inputs.node_topology2 }}" -a1="${{ github.event.inputs.node_start_arguments1 }}" -a2="${{ github.event.inputs.node_start_arguments2 }}"
- name: Write the test results into the database
env:
AWS_DB_USERNAME: ${{ secrets.AWS_DB_USERNAME }}
AWS_DB_PASS: ${{ secrets.AWS_DB_PASS }}
AWS_DB_NAME: ${{ secrets.AWS_DB_NAME }}
AWS_DB_HOSTNAME: ${{ secrets.AWS_DB_HOSTNAME }}
BLOCKFROST_API_KEY: ${{ secrets.BLOCKFROST_API_KEY }}
run: |
cd cardano_node_tests
echo "current branch: $(git branch --show-current)"
python sync_tests/node_write_sync_values_to_db.py -e ${{ matrix.env }}
- name: Generate artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: node_logs_${{ matrix.env }}_${{ matrix.os }}
path: |
cardano_node_tests/logfile_copy.log
cardano_node_tests/sync_results.json
cardano_node_tests/config.json
cardano_node_tests/topology.json