Explore a Rust interface for CCF applications #10125
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Continuous Integration | |
| on: | |
| schedule: | |
| - cron: "0 0 * * 0" | |
| pull_request: | |
| workflow_dispatch: | |
| merge_group: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ !contains(github.ref, 'main')}} | |
| permissions: read-all | |
| env: | |
| # Add bounded retries for transient runner-to-package-storage route failures. | |
| NPM_CONFIG_FETCH_RETRIES: "5" | |
| NPM_CONFIG_FETCH_RETRY_FACTOR: "2" | |
| NPM_CONFIG_FETCH_RETRY_MINTIMEOUT: "5000" | |
| NPM_CONFIG_FETCH_RETRY_MAXTIMEOUT: "30000" | |
| NPM_CONFIG_FETCH_TIMEOUT: "60000" | |
| jobs: | |
| vmss-virtual-a: | |
| name: "VMSS Virtual A" # CI Checks, Clang Tidy, Python package tests, Doc build, Unit tests, e2e (bucket_a) | |
| runs-on: [gha-vmss-d16av7-ci] | |
| container: | |
| image: mcr.microsoft.com/azurelinux/base/core:3.0 | |
| options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE --sysctl net.ipv6.conf.all.disable_ipv6=0 --sysctl net.ipv6.conf.default.disable_ipv6=0 --sysctl net.ipv6.conf.lo.disable_ipv6=0 | |
| steps: | |
| - name: "Checkout dependencies" | |
| shell: bash | |
| run: | | |
| set -ex | |
| gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY | |
| tdnf -y update | |
| tdnf -y install ca-certificates git tar zstd | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Install dependencies" | |
| uses: ./.github/actions/install-ci-dependencies | |
| with: | |
| python-requirements: doc/requirements.txt,doc/historical_ccf_requirements.txt,tests/requirements.txt | |
| - name: "Install development dependencies" | |
| shell: bash | |
| run: | | |
| set -ex | |
| ./scripts/setup-dev.sh | |
| - name: "Run Checks and Build Debug with clang-tidy" | |
| run: | | |
| set -ex | |
| git config --global --add safe.directory /__w/CCF/CCF | |
| ./scripts/ci-checks.sh | |
| mkdir build | |
| cd build | |
| cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCLANG_TIDY=ON \ | |
| -DDOCS_PYTHON="$GITHUB_WORKSPACE/env/bin/python" .. | |
| ninja | |
| shell: bash | |
| - name: "Run tests for Python package" | |
| run: | | |
| set -ex | |
| python3 -m venv --without-pip env | |
| source env/bin/activate | |
| uv pip install -q pytest | |
| uv pip install -q -e python | |
| cd python | |
| pytest | |
| - name: "Run Unit tests" | |
| run: | | |
| set -ex | |
| cd build | |
| ./tests.sh --output-on-failure -L unit -j$(nproc --all) | |
| - name: "Build docs and run e2e tests (bucket_a)" | |
| shell: bash | |
| run: | | |
| set -ex | |
| source env/bin/activate | |
| uv pip install -e ./python | |
| uv pip install -r doc/requirements.txt | |
| uv pip install -r doc/historical_ccf_requirements.txt | |
| cd build | |
| ./tests.sh --timeout 360 --output-on-failure -L bucket_a -j2 | |
| - name: "Upload logs for virtual A" | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: logs-azurelinux-virtual-a | |
| path: | | |
| build/workspace/*/*.config.json | |
| build/workspace/*/out | |
| build/workspace/*/err | |
| build/workspace/*/*.ledger/* | |
| build/workspace/*/stack_trace | |
| build/workspace/**/openapi_coverage.json | |
| if-no-files-found: ignore | |
| if: success() || failure() | |
| vmss-virtual-b: | |
| name: "VMSS Virtual B" # End-to-end tests (bucket_b) | |
| runs-on: [gha-vmss-d16av7-ci] | |
| container: | |
| image: mcr.microsoft.com/azurelinux/base/core:3.0 | |
| options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE --sysctl net.ipv6.conf.all.disable_ipv6=0 --sysctl net.ipv6.conf.default.disable_ipv6=0 --sysctl net.ipv6.conf.lo.disable_ipv6=0 | |
| steps: | |
| - name: "Checkout dependencies" | |
| shell: bash | |
| run: | | |
| gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY | |
| tdnf -y update | |
| tdnf -y install ca-certificates git | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: "cpuinfo" | |
| run: | | |
| cat /proc/cpuinfo | |
| shell: bash | |
| - name: "Install dependencies" | |
| uses: ./.github/actions/install-ci-dependencies | |
| - name: "Confirm running on Virtual" | |
| run: | | |
| set -ex | |
| python3 tests/infra/platform_detection.py virtual | |
| shell: bash | |
| - name: "Build Debug" | |
| run: | | |
| set -ex | |
| git config --global --add safe.directory /__w/CCF/CCF | |
| mkdir build | |
| cd build | |
| cmake -GNinja -DCMAKE_BUILD_TYPE=Debug .. | |
| ninja bucket_b | |
| shell: bash | |
| - name: "Test virtual" | |
| run: | | |
| set -ex | |
| cd build | |
| rm -rf /github/home/.cache | |
| mkdir -p /github/home/.cache | |
| ./tests.sh --timeout 360 --output-on-failure -L bucket_b | |
| shell: bash | |
| - name: "Upload logs for virtual B" | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: logs-azurelinux-virtual-b | |
| path: | | |
| build/workspace/*/*.config.json | |
| build/workspace/*/out | |
| build/workspace/*/err | |
| build/workspace/*/*.ledger/* | |
| build/workspace/*/stack_trace | |
| build/workspace/**/openapi_coverage.json | |
| if-no-files-found: ignore | |
| if: success() || failure() | |
| vmss-virtual-c: | |
| name: "VMSS Virtual C" # End-to-end tests (bucket_c) | |
| runs-on: [gha-vmss-d16av7-ci] | |
| container: | |
| image: mcr.microsoft.com/azurelinux/base/core:3.0 | |
| options: --user root --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE --sysctl net.ipv6.conf.all.disable_ipv6=0 --sysctl net.ipv6.conf.default.disable_ipv6=0 --sysctl net.ipv6.conf.lo.disable_ipv6=0 | |
| steps: | |
| - name: "Checkout dependencies" | |
| shell: bash | |
| run: | | |
| set -ex | |
| gpg --import /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY | |
| tdnf -y update | |
| tdnf -y install ca-certificates git | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Install dependencies" | |
| uses: ./.github/actions/install-ci-dependencies | |
| - name: "Build Debug" | |
| run: | | |
| set -ex | |
| git config --global --add safe.directory /__w/CCF/CCF | |
| mkdir build | |
| cd build | |
| cmake -GNinja -DCMAKE_BUILD_TYPE=Debug .. | |
| ninja bucket_c partitions | |
| shell: bash | |
| - name: "Test virtual" | |
| run: | | |
| set -ex | |
| cd build | |
| rm -rf /github/home/.cache | |
| mkdir -p /github/home/.cache | |
| ./tests.sh --timeout 360 --output-on-failure -L bucket_c | |
| shell: bash | |
| - name: "Run partitions tests" | |
| run: | | |
| set -ex | |
| cd build | |
| ./tests.sh --timeout 360 --output-on-failure -L partitions -C partitions | |
| - name: "Upload logs for virtual C" | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: logs-azurelinux-virtual-c | |
| path: | | |
| build/workspace/*/*.config.json | |
| build/workspace/*/out | |
| build/workspace/*/err | |
| build/workspace/*/*.ledger/* | |
| build/workspace/*/stack_trace | |
| build/workspace/**/openapi_coverage.json | |
| if-no-files-found: ignore | |
| if: success() || failure() | |
| aci_snp_genoa: | |
| name: "ACI SNP Genoa" | |
| runs-on: [gha-aci-genoa] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Dump environment" | |
| run: | | |
| set -ex | |
| # Dump environment variables, extract Fabric_NodeIPOrFQDN | |
| # and save it to a file for reconfiguration test using THIM. | |
| { cat /proc/*/environ 2>/dev/null || true; } | tr '\000' '\n' | sort -u | grep Fabric_NodeIPOrFQDN > /Fabric_NodeIPOrFQDN | |
| echo "::group::Disk usage" | |
| df -kh | |
| echo "::endgroup::" | |
| echo "::group::Mounts" | |
| mount | |
| echo "::endgroup::" | |
| echo "::group::CPU Info" | |
| cat /proc/cpuinfo | |
| echo "::endgroup::" | |
| shell: bash | |
| - name: "Confirm running on SEV-SNP Genoa" | |
| run: | | |
| set -ex | |
| python3 tests/infra/platform_detection.py snp genoa | |
| shell: bash | |
| - name: "Build Debug" | |
| run: | | |
| set -ex | |
| git config --global --add safe.directory /__w/CCF/CCF | |
| mkdir build | |
| cd build | |
| cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DWORKER_THREADS=1 .. | |
| ninja snp code_update_test ledger_bench | |
| shell: bash | |
| - name: "Tests" | |
| run: | | |
| set -ex | |
| cd build | |
| rm -rf /github/home/.cache | |
| mkdir -p /github/home/.cache | |
| ./tests.sh --timeout 360 --output-on-failure -C snp -L snp | |
| ./tests.sh --timeout 360 --output-on-failure -R code_update | |
| ./tests.sh --timeout 360 -V -R '^ledger_bench$' | |
| shell: bash | |
| env: | |
| CCF_TEST_SYNC_AFTER_SETUP: 1 | |
| ELECTION_TIMEOUT_MS: 10000 | |
| - name: "Capture dmesg" | |
| run: | | |
| set -ex | |
| echo "::group::Disk usage" | |
| df -kh | |
| echo "::endgroup::" | |
| dmesg > dmesg.log | |
| shell: bash | |
| if: success() || failure() | |
| - name: "Upload logs" | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: logs-caci-snp-genoa | |
| path: | | |
| dmesg.log | |
| build/workspace/*/*.config.json | |
| build/workspace/*/out | |
| build/workspace/*/err | |
| build/workspace/*/*.ledger/* | |
| build/workspace/*/stack_trace | |
| build/workspace/**/openapi_coverage.json | |
| if-no-files-found: ignore | |
| if: success() || failure() |