Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return cuobjdump info on artifacts, future-proofing CI #362

Merged
merged 22 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/actions/build-harvester.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,14 @@ pushd build-harvester
cmake .. -DCMAKE_BUILD_TYPE=Release -DBB_HARVESTER_ONLY=ON

cmake --build . --config Release --target bladebit_harvester
cmake --install . --prefix harvester_dist

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)
fi

cmake --install . --prefix harvester_dist
pushd harvester_dist/green_reaper

if [[ "$host_os" == "windows" ]]; then
Expand Down Expand Up @@ -78,6 +84,22 @@ ls -la
cat "${artifact_name}.sha256.txt"

if [[ "$CI" == "true" ]]; then
if [[ "$host_os" == "windows" ]] || [[ "$host_os" == "linux" ]]; then
while IFS= read -r line; do
echo -e "$(echo ${line#* } | tr -d '*')\n###### <sup>${line%% *}</sup>\n"
done <"${artifact_name}.sha256.txt" >> "$GITHUB_STEP_SUMMARY"
echo "| Arch | Code Version | Host | Compile Size |" >> "$GITHUB_STEP_SUMMARY"
echo "| --- | --- | --- | --- |" >> "$GITHUB_STEP_SUMMARY"
echo "$OBJDUMP" | awk -v RS= -v FS='\n' -v OFS=' | ' '{
for (i=1; i<=NF; i++) {
if (index($i, "=")) {
gsub(/.* = /, "", $i);
}
}
print $3, $4, $5, $6;
}' | sed 's/^/| /; s/$/ |/; s/ | | / | /g' >> "$GITHUB_STEP_SUMMARY"
fi

if [[ "$host_os" == "windows" ]]; then
harvester_artifact_path="$(cygpath -m "$(pwd)/${artifact_name}")*"
else
Expand Down
62 changes: 59 additions & 3 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

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

- name: Get Version Number
id: version_number
shell: bash
Expand Down Expand Up @@ -49,6 +54,11 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

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

- name: Get Version Number
id: version_number
shell: bash
Expand Down Expand Up @@ -82,6 +92,8 @@ jobs:
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@v3
Expand All @@ -98,6 +110,11 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

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

- name: Cache DNF packages
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -153,6 +170,11 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

- 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
Expand Down Expand Up @@ -181,6 +203,11 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

- 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
Expand All @@ -207,6 +234,11 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

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

- name: Get Version Number
id: version_number
run: .github/actions/get-version.sh ubuntu x86-64
Expand Down Expand Up @@ -252,6 +284,11 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

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

- name: Get Version Number
id: version_number
run: .github/actions/get-version.sh centos x86-64
Expand All @@ -261,7 +298,6 @@ jobs:
set -eo pipefail
dnf install -y gcc-toolset-9-gcc gcc-toolset-9-gcc-c++ \
gmp-devel numactl-devel make git wget subscription-manager

bash .github/actions/install-cmake-linux.sh

- name: Build Bladebit
Expand Down Expand Up @@ -299,7 +335,7 @@ jobs:
name: ${{ env.BB_ARTIFACT_NAME_CUDA }}
path: ${{ github.workspace }}/bin/${{ env.BB_ARTIFACT_NAME_CUDA }}
if-no-files-found: error

build-bladebit-centos-arm64:
runs-on: [ARM64, Linux]
container:
Expand All @@ -308,14 +344,19 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

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

- name: Get Version Number
id: version_number
run: .github/actions/get-version.sh centos arm64

- name: Install Prerequisites
run: |
dnf install -y gcc-toolset-9-gcc gcc-toolset-9-gcc-c++ \
cmake gmp-devel numactl-devel make git
cmake gmp-devel numactl-devel make git

- name: Build
run: |
Expand All @@ -340,6 +381,11 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

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

- name: Get Version Number
id: version_number
run: .github/actions/get-version.sh ubuntu arm64
Expand Down Expand Up @@ -385,6 +431,11 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

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

- name: Get Version Number
shell: bash
id: version_number
Expand Down Expand Up @@ -429,6 +480,11 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

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

- name: Get Version Number
shell: bash
id: version_number
Expand Down