-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #363 from Chia-Network/develop
Bring compressed plotting/farming into master
- Loading branch information
Showing
283 changed files
with
85,291 additions
and
3,974 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
if [[ $RUNNER_DEBUG = 1 ]]; then | ||
set -x | ||
fi | ||
|
||
host_os=$(uname -a) | ||
case "${host_os}" in | ||
Linux*) host_os="linux";; | ||
Darwin*) host_os="macos";; | ||
CYGWIN*) host_os="windows";; | ||
MINGW*) host_os="windows";; | ||
*Msys) host_os="windows";; | ||
esac | ||
|
||
if [[ "$host_os" == "windows" ]]; then | ||
ext="zip" | ||
else | ||
ext="tar.gz" | ||
fi | ||
|
||
if [[ "$host_os" == "macos" ]]; then | ||
procs=$(sysctl -n hw.logicalcpu) | ||
sha_sum="shasum -a 256" | ||
else | ||
procs=$(nproc --all) | ||
sha_sum="sha256sum" | ||
fi | ||
|
||
artifact_name=green_reaper.$ext | ||
|
||
while true; do | ||
case $1 in | ||
--artifact) | ||
shift && artifact_name=$1 || exit 1 | ||
;; | ||
esac | ||
shift || break | ||
done | ||
|
||
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 | ||
|
||
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 | ||
mkdir -p lib | ||
cp -vn ../../*/*.dll lib/ | ||
cp -vn ../../*/*.lib lib/ | ||
fi | ||
|
||
artifact_files=($(find . -type f -name '*.*' | cut -c3-)) | ||
|
||
# shellcheck disable=SC2068 | ||
$sha_sum ${artifact_files[@]} > sha256checksum | ||
|
||
artifact_files+=("sha256checksum") | ||
|
||
if [[ "$host_os" == "windows" ]]; then | ||
7z.exe a -tzip "${artifact_name}" "${artifact_files[@]}" | ||
else | ||
# shellcheck disable=SC2068 | ||
tar -czvf "${artifact_name}" ${artifact_files[@]} | ||
fi | ||
|
||
popd | ||
mv "harvester_dist/green_reaper/${artifact_name}" ./ | ||
$sha_sum "${artifact_name}" > "${artifact_name}.sha256.txt" | ||
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 | ||
harvester_artifact_path="$(pwd)/${artifact_name}*" | ||
fi | ||
echo "harvester_artifact_path=$harvester_artifact_path" | ||
echo "harvester_artifact_path=$harvester_artifact_path" >> "$GITHUB_ENV" | ||
fi | ||
|
||
popd | ||
ls -la |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
ref_cmake_sha256='39e1c2eccda989b0d000dc5f4ee2cb031bdda799163780d855acc0bd9eda9d92' | ||
cmake_name='cmake-3.23.3-linux-x86_64' | ||
|
||
curl -L https://github.com/Kitware/CMake/releases/download/v3.23.3/cmake-3.23.3-linux-x86_64.tar.gz > cmake.tar.gz | ||
|
||
cmake_sh_sha256=$(sha256sum cmake.tar.gz | cut -f1 -d' ') | ||
if [[ "${ref_cmake_sha256}" != "${cmake_sh_sha256}" ]]; then | ||
2>&1 echo "sha256 mismatch!: " | ||
2>&1 echo "Got : '${cmake_sh_sha256}'" | ||
2>&1 echo "Expected: '${ref_cmake_sha256}'" | ||
exit 1 | ||
fi | ||
|
||
rm -f /usr/bin/cmake && rm -f /usr/local/bin/cmake | ||
mkdir -p /usr/local/bin | ||
mkdir -p /usr/local/share | ||
|
||
cmake_prefix=$(pwd)/${cmake_name} | ||
tar -xzvf cmake.tar.gz | ||
ls -la | ||
ls -la ${cmake_prefix} | ||
|
||
cp -r ${cmake_prefix}/bin/* /usr/local/bin/ | ||
cp -r ${cmake_prefix}/share/* /usr/local/share/ | ||
|
||
echo 'Cmake Info:' | ||
which cmake | ||
cmake --version | ||
|
||
echo 'Done.' | ||
exit 0 |
This file contains 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
Oops, something went wrong.