Skip to content

fix(gc): skip deleted miner actors in StorageGCMark #2367

fix(gc): skip deleted miner actors in StorageGCMark

fix(gc): skip deleted miner actors in StorageGCMark #2367

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- '**'
env:
GO_VERSION: "1.24.7"
jobs:
ci-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Install actionlint
run: go install github.com/rhysd/actionlint/cmd/actionlint@latest
- name: Run actionlint
run: actionlint -shellcheck= -pyflakes=
setup-params:
runs-on: [self-hosted, docker]
needs: [ci-lint]
steps:
- name: Fetch parameters
run: lotus fetch-params 8388608
shell: bash
build-mainnet:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
FFI_USE_OPENCL: 1
run: |
make deps
shell: bash
- name: Build Go
env:
FFI_USE_OPENCL: 1
run: make build
shell: bash
build-calibnet:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
FFI_USE_OPENCL: 1
run: |
make deps
shell: bash
- name: Build Go
env:
FFI_USE_OPENCL: 1
run: make calibnet
shell: bash
build-debug:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
FFI_USE_OPENCL: 1
run: |
make deps
shell: bash
- name: Build Go
env:
FFI_USE_OPENCL: 1
run: make debug
shell: bash
build-2k:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
FFI_USE_OPENCL: 1
run: |
make deps
shell: bash
- name: Build Go
env:
FFI_USE_OPENCL: 1
run: make 2k
shell: bash
build-forest:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
FFI_USE_OPENCL: 1
run: |
make deps
shell: bash
- name: Build Forest
env:
FFI_USE_OPENCL: 1
run: make forest-test
shell: bash
test:
runs-on: [self-hosted, docker]
needs: [setup-params]
env:
CONTAINER_NAME: yugabyte-${{ github.run_id }}-${{ matrix.test-suite.name }}
strategy:
fail-fast: false # Continue running even if one test fails
matrix:
test-suite:
- name: test-itest-curio
target: "./itests/curio_test.go"
- name: test-all
target: "`go list ./... | grep -v curio/itests`"
- name: test-itest-harmonyDB
target: "./itests/harmonydb_test.go"
- name: test-itest-alertnow
target: "./itests/alertnow_test.go"
- name: test-itest-pdp-prove
target: "./itests/pdp_prove_test.go"
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
FFI_USE_OPENCL: 1
run: |
make deps
shell: bash
- name: Start YugabyteDB container with dynamic ports
id: start-yugabyte
run: |
# Start YugabyteDB container with dynamic port mapping for PostgreSQL and YCQL
docker run --rm --name ${{ env.CONTAINER_NAME }} -d yugabytedb/yugabyte:2024.1.2.0-b77 bin/yugabyted start --daemon=false
- name: Wait for YugabyteDB to start
run: |
while true; do
status=$(docker exec ${{ env.CONTAINER_NAME }} bin/yugabyted status);
echo $status;
echo $status | grep Running && break;
sleep 1;
done
shell: bash
- name: Get YugabyteDB container IP
id: get-yb-ip
run: |
# Retrieve internal bridge IP of YugabyteDB container
YB_IP=$(docker inspect $CONTAINER_NAME --format '{{ .NetworkSettings.Networks.bridge.IPAddress }}')
echo "yb_ip=$YB_IP" >> $GITHUB_OUTPUT
- name: Run tests with coverage
env:
CURIO_HARMONYDB_HOSTS: ${{ steps.get-yb-ip.outputs.yb_ip }} # Use internal IP for DB host
LOTUS_HARMONYDB_HOSTS: ${{ steps.get-yb-ip.outputs.yb_ip }}
FFI_USE_OPENCL: 1
run: |
echo "Using YugabyteDB Container IP: ${{env.CURIO_HARMONYDB_HOSTS}}"
export CURIO_HARMONYDB_HOSTS=${{ env.CURIO_HARMONYDB_HOSTS }}
export LOTUS_HARMONYDB_HOSTS=${{ env.CURIO_HARMONYDB_HOSTS }}
mkdir -p coverage
go test -v --tags="debug,fvm,nosupraseal" -timeout 30m -coverprofile=coverage/${{ matrix.test-suite.name }}.out -covermode=atomic ${{ matrix.test-suite.target }}
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-${{ matrix.test-suite.name }}
path: coverage/${{ matrix.test-suite.name }}.out
retention-days: 1
- name: Stop YugabyteDB container
if: always() # Ensure this run even if the tests fail
run: docker stop ${{ env.CONTAINER_NAME }}
lint:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
FFI_USE_OPENCL: 1
run: |
make deps
shell: bash
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.6.2
shell: bash
- name: Lint
env:
FFI_USE_OPENCL: 1
run: |
golangci-lint run -v --timeout 15m --concurrency 4
shell: bash
gofmt:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Check gofmt
run: |
go fmt ./...
shell: bash
- name: Git diff check
run: git --no-pager diff
shell: bash
- name: Git diff quiet
run: git --no-pager diff --quiet
shell: bash
build-supraseal-ubuntu24:
runs-on: ubuntu-latest
needs: [ci-lint]
env:
GCC_VERSION: "13"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Free up disk space
run: |
# Remove unnecessary packages to free up space for CUDA installation
sudo apt-get clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
gcc-13 g++-13 \
nasm \
pkg-config \
autoconf automake libtool \
libssl-dev \
libnuma-dev \
uuid-dev \
libaio-dev \
libfuse3-dev \
libarchive-dev \
libkeyutils-dev \
libncurses-dev \
python3 python3-pip python3-dev \
curl wget git \
xxd
- name: Set up Python virtual environment
run: |
# Python tools will be installed in venv by build.sh
# Just ensure python3-venv is available
python3 -m venv --help > /dev/null || sudo apt-get install -y python3-venv
- name: Set up GCC 13 as default
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
sudo update-alternatives --set gcc /usr/bin/gcc-13
sudo update-alternatives --set g++ /usr/bin/g++-13
gcc --version
g++ --version
- name: Install CUDA Toolkit from NVIDIA Repository
run: |
# Install CUDA using official NVIDIA repository for Ubuntu 24.04
# Source: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=24.04&target_type=deb_local
# Skip if CUDA is already installed (shouldn't happen without cache, but just in case)
if [ -f "/usr/local/cuda/bin/nvcc" ]; then
echo "CUDA already installed"
/usr/local/cuda/bin/nvcc --version
exit 0
fi
# Download and install the CUDA keyring package
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
rm cuda-keyring_1.1-1_all.deb
# Update package list and install CUDA toolkit
sudo apt-get update
sudo apt-get -y install cuda-toolkit
# Verify installation and find CUDA location
if [ -d "/usr/local/cuda" ]; then
echo "CUDA installed at /usr/local/cuda"
ls -la /usr/local/cuda*/bin/nvcc || true
# Show CUDA version for debugging
/usr/local/cuda/bin/nvcc --version || true
else
echo "ERROR: CUDA installation not found"
exit 1
fi
- name: Set up CUDA environment
run: |
# Verify CUDA installation exists
if [ ! -d "/usr/local/cuda" ]; then
echo "ERROR: /usr/local/cuda not found"
echo "Searching for CUDA installations:"
ls -la /usr/local/cuda* 2>/dev/null || echo "No CUDA directories found"
exit 1
fi
# Export PATH locally to verify nvcc works
export PATH="/usr/local/cuda/bin:$PATH"
export CUDA_HOME=/usr/local/cuda
# Add CUDA stubs to library paths for build-time linking
# The stubs allow linking against libcuda.so.1 without requiring the actual NVIDIA driver
CUDA_STUBS_DIR="/usr/local/cuda/lib64/stubs"
if [ -d "$CUDA_STUBS_DIR" ]; then
echo "Found CUDA stubs at $CUDA_STUBS_DIR"
export LD_LIBRARY_PATH="$CUDA_STUBS_DIR:/usr/local/cuda/lib64:${LD_LIBRARY_PATH}"
export LIBRARY_PATH="$CUDA_STUBS_DIR:/usr/local/cuda/lib64:${LIBRARY_PATH}"
else
echo "WARNING: CUDA stubs directory not found at $CUDA_STUBS_DIR"
export LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}"
fi
# Verify nvcc is available and show version
echo "Verifying CUDA installation:"
nvcc --version
# Check CUDA version meets minimum requirements (12+)
CUDA_VERSION=$(nvcc --version | grep "release" | sed -n 's/.*release \([0-9]*\)\.\([0-9]*\).*/\1/p')
echo "Detected CUDA version: $CUDA_VERSION"
if [ "$CUDA_VERSION" -lt 12 ]; then
echo "ERROR: CUDA $CUDA_VERSION is too old. Need CUDA 12 or newer."
exit 1
fi
# Set environment for subsequent steps
echo "/usr/local/cuda/bin" >> $GITHUB_PATH
echo "CUDA_HOME=/usr/local/cuda" >> $GITHUB_ENV
if [ -d "$CUDA_STUBS_DIR" ]; then
echo "LD_LIBRARY_PATH=$CUDA_STUBS_DIR:/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "LIBRARY_PATH=$CUDA_STUBS_DIR:/usr/local/cuda/lib64:$LIBRARY_PATH" >> $GITHUB_ENV
else
echo "LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
fi
- name: Install libconfig++
run: |
sudo apt-get install -y libconfig++-dev || {
# If not available in repos, build from source
wget https://hyperrealm.github.io/libconfig/dist/libconfig-1.7.3.tar.gz
tar -xzf libconfig-1.7.3.tar.gz
cd libconfig-1.7.3
./configure
make -j$(nproc)
sudo make install
sudo ldconfig
cd ..
rm -rf libconfig-1.7.3*
}
- name: Install GMP library
run: |
sudo apt-get install -y libgmp-dev
- name: Cache Python venv
id: cache-venv
uses: actions/cache@v4
with:
path: extern/supraseal/.venv
key: supraseal-venv-ubuntu24-v2-${{ hashFiles('extern/supraseal/build.sh') }}
restore-keys: |
supraseal-venv-ubuntu24-v2-
- name: Cache SPDK build
id: cache-spdk
uses: actions/cache@v4
with:
path: extern/supraseal/deps/spdk-v24.05
key: spdk-v24.05-gcc13-ubuntu24-v1-${{ hashFiles('extern/supraseal/build.sh') }}
restore-keys: |
spdk-v24.05-gcc13-ubuntu24-v1-
- name: Build Supraseal
working-directory: extern/supraseal
run: |
# Ensure we're using GCC 13 and CUDA
export CC=gcc-13
export CXX=g++-13
export CUDA=/usr/local/cuda
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
# Verify CUDA is accessible
which nvcc
nvcc --version
# Run the build script (creates and uses Python venv internally)
./build.sh
- name: Verify library
working-directory: extern/supraseal
run: |
echo "=== Verifying library exists ==="
test -f obj/libsupraseal.a && echo "✓ libsupraseal.a created" || exit 1
echo ""
echo "=== Library size ==="
du -h obj/libsupraseal.a
echo ""
echo "✅ Library built successfully!"
- name: Upload library artifact
uses: actions/upload-artifact@v4
with:
name: supraseal-library-ubuntu24-gcc13-cuda
path: extern/supraseal/obj/libsupraseal.a
retention-days: 30
- name: Build summary
run: |
echo "### 🎉 Supraseal Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Configuration:**" >> $GITHUB_STEP_SUMMARY
echo "- OS: Ubuntu 24.04" >> $GITHUB_STEP_SUMMARY
echo "- GCC: $(gcc --version | head -1)" >> $GITHUB_STEP_SUMMARY
echo "- CUDA: $(nvcc --version | grep release)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Built Library:**" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
ls -lh extern/supraseal/obj/libsupraseal.a >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ Library compiled successfully with GCC 12 and CUDA!" >> $GITHUB_STEP_SUMMARY
gen-check:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports
shell: bash
- name: Install cbor-gen-for
run: go install github.com/hannahhoward/cbor-gen-for
shell: bash
- name: Install swag cli
run: go install github.com/swaggo/swag/cmd/swag@v1.16.4
shell: bash
- name: Install gotext
run: go install golang.org/x/text/cmd/gotext
shell: bash
- name: Install FFI
env:
GITHUB_TOKEN: ${{ github.token }}
FFI_USE_OPENCL: 1
run: |
make deps
shell: bash
- name: Generate Code
env:
LANG: en-US
FFI_USE_OPENCL: 1
run: make gen
shell: bash
- name: Git diff check
run: git --no-pager diff
shell: bash
- name: Git diff quiet
run: git --no-pager diff --quiet
shell: bash
mod-tidy-check:
runs-on: ubuntu-latest
needs: [ci-lint]
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Install Dependencies
uses: ./.github/actions/install-deps
- name: Run mod tidy check
run: go mod tidy -v
shell: bash
coverage-report:
runs-on: ubuntu-latest
needs: [test]
if: always() && needs.test.result != 'cancelled'
permissions:
contents: read
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Download all coverage artifacts
uses: actions/download-artifact@v4
with:
pattern: coverage-*
path: coverage-artifacts
merge-multiple: false
- name: Merge coverage reports
run: |
chmod +x .github/utils/coverage-report.sh
.github/utils/coverage-report.sh
- name: Generate coverage report
uses: ./.github/actions/coverage-report
id: coverage
with:
artifacts-dir: coverage-artifacts
output-dir: coverage
github-token: ${{ secrets.GITHUB_TOKEN }}
create-check: 'true'
create-comment: 'false'
minimum-coverage: '0'
- name: Upload merged coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-merged
path: |
coverage/merged.out
coverage/coverage.txt
coverage/packages.txt
coverage/coverage.html
coverage/coverage.json
retention-days: 30
- name: Add coverage to job summary
run: |
echo "## 📊 Code Coverage Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Total Coverage:** ${{ steps.coverage.outputs.total-coverage }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "![Coverage Badge](https://img.shields.io/badge/coverage-${{ steps.coverage.outputs.total-coverage }}-${{ steps.coverage.outputs.badge-color }})" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📊 [View Coverage Report](https://artifact.ci/${{ github.repository }}/actions/runs/${{ github.run_id }}/coverage-merged/coverage.html)" >> $GITHUB_STEP_SUMMARY
required-checks-passed:
needs: [ci-lint, build-mainnet, build-calibnet, build-debug, build-2k, build-forest, test, lint, gofmt, build-supraseal-ubuntu24, gen-check, mod-tidy-check, coverage-report]
runs-on: ubuntu-latest
steps:
- run: echo "All required checks passed"