Skip to content

Commit

Permalink
Version 3.1.1 - Merge pull request #482 from Chia-Network/develop
Browse files Browse the repository at this point in the history
Version 3.1.1
  • Loading branch information
haorldbchi authored Feb 6, 2025
2 parents f944c3b + aabb257 commit 84f5133
Show file tree
Hide file tree
Showing 14 changed files with 676 additions and 570 deletions.
16 changes: 8 additions & 8 deletions .github/actions/build-harvester.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,20 @@ echo "Harvester artifact: ${artifact_name}"
echo 'cmake --version'
cmake --version

mkdir -p build-harvester
pushd build-harvester
cmake .. -DCMAKE_BUILD_TYPE=Release -DBB_HARVESTER_ONLY=ON

cmake --build . --config Release --target bladebit_harvester
./build-harvester.sh

if [[ "$host_os" == "windows" ]]; then
OBJDUMP=$("${CUDA_PATH}"\\bin\\cuobjdump Release\\bladebit_harvester.dll)
elif [[ "$host_os" == "linux" ]]; then
OBJDUMP=$(/usr/local/cuda/bin/cuobjdump libbladebit_harvester.so)
OBJDUMP=$(/usr/local/cuda/bin/cuobjdump "build-harvester/libbladebit_harvester.so")

# Check for the right GNU_STACK flags
script_path=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
# echo $script_path
${script_path}/check-elf-gnu-stack-flags.sh "build-harvester/libbladebit_harvester.so"
fi

cmake --install . --prefix harvester_dist
cmake --install "build-harvester" --prefix harvester_dist
pushd harvester_dist/green_reaper

if [[ "$host_os" == "windows" ]]; then
Expand Down Expand Up @@ -109,5 +110,4 @@ if [[ "$CI" == "true" ]]; then
echo "harvester_artifact_path=$harvester_artifact_path" >> "$GITHUB_ENV"
fi

popd
ls -la
12 changes: 12 additions & 0 deletions .github/actions/check-elf-gnu-stack-flags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eo pipefail

file_path=$1
flag=$(readelf -e $file_path | grep GNU_STACK -A 1 | tail -n 1 | tr -s ' ' | cut -f4 -d' ')

echo "Flag: GNU_STACK flag: $flag"

if [[ $flag != "RW" ]]; then
>&2 echo "GNU_STACK flag is expected to be set to 'RW', but got '$flag'"
exit 1
fi
30 changes: 15 additions & 15 deletions .github/workflows/attach-release-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
upload-release-assets:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -16,7 +16,7 @@ jobs:

# Setup Node
- uses: actions/setup-node@v4
with: { node-version: '16' }
with: { node-version: '20' }
- run: cd .github/actions && npm install @octokit/action

# Upload Artifacts as Release Assets
Expand All @@ -30,20 +30,20 @@ jobs:
echo "Release Version: $BB_VERSION"
artifacts=(
bladebit-v${BB_VERSION}-ubuntu-x86-64.tar.gz
bladebit-v${BB_VERSION}-centos-x86-64.tar.gz
bladebit-v${BB_VERSION}-ubuntu-arm64.tar.gz
bladebit-v${BB_VERSION}-centos-arm64.tar.gz
bladebit-v${BB_VERSION}-windows-x86-64.zip
bladebit-cuda-v${BB_VERSION}-ubuntu-x86-64.tar.gz
bladebit-cuda-v${BB_VERSION}-centos-x86-64.tar.gz
bladebit-cuda-v${BB_VERSION}-ubuntu-arm64.tar.gz
bladebit-cuda-v${BB_VERSION}-windows-x86-64.zip
# bladebit-v${BB_VERSION}-ubuntu-x86-64.tar.gz
# bladebit-v${BB_VERSION}-rhl-x86-64.tar.gz
# bladebit-v${BB_VERSION}-ubuntu-arm64.tar.gz
# bladebit-v${BB_VERSION}-rhl-arm64.tar.gz
# bladebit-v${BB_VERSION}-windows-x86-64.zip
# bladebit-cuda-v${BB_VERSION}-ubuntu-x86-64.tar.gz
# bladebit-cuda-v${BB_VERSION}-rhl-x86-64.tar.gz
# bladebit-cuda-v${BB_VERSION}-ubuntu-arm64.tar.gz
# bladebit-cuda-v${BB_VERSION}-windows-x86-64.zip
green_reaper-v${BB_VERSION}-linux-x86-64.tar.gz
green_reaper-v${BB_VERSION}-linux-ARM64.tar.gz
green_reaper-v${BB_VERSION}-macos-x86-64.tar.gz
green_reaper-v${BB_VERSION}-macos-arm64.tar.gz
green_reaper-v${BB_VERSION}-windows-x86-64.zip
# green_reaper-v${BB_VERSION}-linux-ARM64.tar.gz
# green_reaper-v${BB_VERSION}-macos-x86-64.tar.gz
# green_reaper-v${BB_VERSION}-macos-arm64.tar.gz
# green_reaper-v${BB_VERSION}-windows-x86-64.zip
)
mkdir -p bin
Expand Down
228 changes: 228 additions & 0 deletions .github/workflows/build-harvester.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
name: Build Harvester Release Assets
on:
push:
branches: ['*']
workflow_dispatch:

env:
CI_BLADEBIT: 1 # Our own CI, that is, not being built as a dependency

jobs:
build-harvester-linux-x86-64:
runs-on: ubuntu-latest
container:
image: ghcr.io/chia-network/build-images/manylinux_cuda_x86_64:latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get Version Number
id: version_number
shell: bash
run: ./.github/actions/get-version.sh ubuntu x86-64

- name: Install Prerequisites
shell: bash
run: |
set -eo pipefail
yum group install -y "Development Tools"
yum install -y sudo make git wget subscription-manager
- name: Build Harvester
shell: bash
run: |
export artifact_name="green_reaper-v${{ env.BB_VERSION }}-linux-x86-64.tar.gz"
echo "harvester_artifact_name=${artifact_name}" >> "$GITHUB_ENV"
# emits env.harvester_artifact_path
bash .github/actions/build-harvester.sh --artifact "${artifact_name}"
- name: Upload Harvester Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.harvester_artifact_name }}
path: ${{ env.harvester_artifact_path }}
if-no-files-found: error

# build-harvester-linux-arm64:
# runs-on: ubuntu-24.04-arm
# container:
# image: ghcr.io/chia-network/build-images/manylinux_cuda_aarch64:latest
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v4

# - name: Set Env
# uses: Chia-Network/actions/setjobenv@main
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Cache DNF packages
# uses: actions/cache@v4
# with:
# path: /var/cache/dnf
# key: ${{ runner.os }}-dnf-${{ hashFiles('**/your-build-file') }}
# restore-keys: |
# ${{ runner.os }}-dnf-

# - name: Get Version Number
# id: version_number
# shell: bash
# run: ./.github/actions/get-version.sh rhl arm64

# - name: Install Prerequisites
# shell: bash
# run: |
# set -eo pipefail
# export module_platform_id=platform:el10
# export MODULE_PLATFORM_ID=platform:el10
# export PLATFORM_ID=platform:el10
# uname -a
# cat /etc/os-release
# yum install -y dnf
# dnf install -y epel-release
# dnf install -y dnf-plugins-core
# dnf makecache
# dnf install -y kernel-headers.aarch64 kernel-devel.aarch64 tar bzip2 make automake gcc gcc-c++ pciutils elfutils-libelf-devel libglvnd-opengl libglvnd-glx libglvnd-devel acpid pkgconfig dkms
# dnf install -y cmake
# dnf group install -y "Development Tools"
# dnf install -y gmp-devel numactl-devel make git wget sed

# - name: Build Harvester
# shell: bash
# run: |
# export artifact_name="green_reaper-v${{ env.BB_VERSION }}-linux-ARM64.tar.gz"
# echo "harvester_artifact_name=${artifact_name}" >> "$GITHUB_ENV"
# # emits env.harvester_artifact_path
# bash .github/actions/build-harvester.sh --artifact "${artifact_name}"

# - name: Upload Harvester Artifact
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.harvester_artifact_name }}
# path: ${{ env.harvester_artifact_path }}
# if-no-files-found: error

# build-harvester-macos-arm64:
# runs-on: macos-latest
# steps:
# - name: Cleanup Environment
# uses: Chia-Network/actions/clean-workspace@main

# - name: Checkout Repo
# uses: actions/checkout@v4

# - name: Set Env
# uses: Chia-Network/actions/setjobenv@main
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Get Version Number
# id: version_number
# run: bash -e .github/actions/get-version.sh macos arm64

# - name: Build Harvester
# shell: bash
# run: |
# export artifact_name="green_reaper-v${{ env.BB_VERSION }}-macos-arm64.tar.gz"
# echo "harvester_artifact_name=${artifact_name}" >> "$GITHUB_ENV"
# # emits env.harvester_artifact_path
# bash .github/actions/build-harvester.sh --artifact "${artifact_name}"

# - name: Upload Harvester Artifact
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.harvester_artifact_name }}
# path: ${{ env.harvester_artifact_path }}
# if-no-files-found: error

# build-harvester-macos-x86-64:
# runs-on: macOS-13
# steps:
# - name: Cleanup Environment
# uses: Chia-Network/actions/clean-workspace@main

# - name: Checkout Repo
# uses: actions/checkout@v4

# - name: Set Env
# uses: Chia-Network/actions/setjobenv@main
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Get Version Number
# id: version_number
# run: bash -e .github/actions/get-version.sh macos x86-64

# - name: Build Harvester
# shell: bash
# run: |
# export artifact_name="green_reaper-v${{ env.BB_VERSION }}-macos-x86-64.tar.gz"
# echo "harvester_artifact_name=${artifact_name}" >> "$GITHUB_ENV"
# # emits env.harvester_artifact_path
# bash .github/actions/build-harvester.sh --artifact "${artifact_name}"

# - name: Upload Harvester Artifact
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.harvester_artifact_name }}
# path: ${{ env.harvester_artifact_path }}
# if-no-files-found: error

# build-harvester-windows-x86-64:
# runs-on: windows-2022
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v4

# - name: Set Env
# uses: Chia-Network/actions/setjobenv@main
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Get Version Number
# id: version_number
# shell: bash
# run: ./.github/actions/get-version.sh windows x86-64

# - name: Install Prerequisites
# shell: powershell
# run: |
# choco install -y make
# choco install -y wget
# choco install -y sed

# - name: Setup CUDA
# uses: Jimver/[email protected]
# id: cuda-toolkit
# with:
# cuda: '12.6.2'
# method: network

# - name: Verify CUDA
# shell: bash
# run: |
# echo "Installed cuda version is: ${{ steps.cuda-toolkit.outputs.cuda }}"
# echo "Cuda install location: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}"
# nvcc -V

# - name: Build Harvester
# shell: bash
# run: |
# export artifact_name="green_reaper-v${{ env.BB_VERSION }}-windows-x86-64.zip"
# echo "harvester_artifact_name=${artifact_name}" >> "$GITHUB_ENV"
# # emits env.harvester_artifact_path
# bash .github/actions/build-harvester.sh --artifact "${artifact_name}"
# env:
# CUDA_PATH: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}

# - name: Upload Harvester Artifact
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.harvester_artifact_name }}
# path: ${{ env.harvester_artifact_path }}
# if-no-files-found: error
Loading

0 comments on commit 84f5133

Please sign in to comment.