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

feat(portability): add support for aarch66 and riscv64 #1596

Open
wants to merge 64 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
3252180
feat(portability): add support for RISC-V architecture
bitcoin-tools Oct 4, 2024
2b5d830
Update validation.yaml
bitcoin-tools Oct 4, 2024
0da357f
update sudo
bitcoin-tools Oct 4, 2024
cd0f7b7
libatomic1 dependency on riscv ubuntu
bitcoin-tools Oct 4, 2024
0d8a47f
Update validation.yaml
bitcoin-tools Oct 4, 2024
5f15e6c
Debug the alpine compile
bitcoin-tools Oct 5, 2024
bf04487
bump the timeout minutes for riscv64 runs
bitcoin-tools Oct 5, 2024
5f2b028
add aarch64 architectures
bitcoin-tools Oct 5, 2024
494bb7e
add powerpc 64
bitcoin-tools Oct 5, 2024
25c0ab6
refactor the if statement
bitcoin-tools Oct 5, 2024
fd82106
Add artifact
bitcoin-tools Oct 5, 2024
7c7db45
handle ppc64le naming issue
bitcoin-tools Oct 5, 2024
74c2e54
Update nodebuilder
bitcoin-tools Oct 5, 2024
7521d11
Merge branch 'master' into 1595-feat-add-support-for-risc-v-architecture
bitcoin-tools Oct 5, 2024
e87c8a7
fix broken quotes
bitcoin-tools Oct 5, 2024
6bc6e4a
Update validation.yaml
bitcoin-tools Oct 5, 2024
5aac22c
Update nodebuilder
bitcoin-tools Oct 5, 2024
fb62bed
fix syntax
bitcoin-tools Oct 5, 2024
2e445e7
add noninteractive for apt
bitcoin-tools Oct 5, 2024
1c0039d
Update nodebuilder
bitcoin-tools Oct 5, 2024
345aaf4
improve readability
bitcoin-tools Oct 5, 2024
438aacd
Update nodebuilder
bitcoin-tools Oct 5, 2024
7896588
suppress stdout during make
bitcoin-tools Oct 5, 2024
f5f7eaf
remove fedora
bitcoin-tools Oct 5, 2024
aa0b8cc
Update validation.yaml
bitcoin-tools Oct 6, 2024
b9b2427
fix the df command with a general solution
bitcoin-tools Oct 6, 2024
5d2e965
refactor the synced data check into a function
bitcoin-tools Oct 6, 2024
68e0daf
add debug steps
bitcoin-tools Oct 6, 2024
e61b286
fix artifacts
bitcoin-tools Oct 6, 2024
77ad59a
Merge branch 'master' into 1595-feat-add-support-for-risc-v-architecture
bitcoin-tools Oct 6, 2024
bed681e
try fixing artifact permissions
bitcoin-tools Oct 7, 2024
1bdc389
try to fix permissions
bitcoin-tools Oct 7, 2024
56e1411
fix shellcheck
bitcoin-tools Oct 7, 2024
4be98c4
Update validation.yaml
bitcoin-tools Oct 7, 2024
ddd02ce
Update validation.yaml
bitcoin-tools Oct 7, 2024
f67f894
clean up
bitcoin-tools Oct 7, 2024
5730dd3
test console output
bitcoin-tools Oct 8, 2024
46a9ea0
check for git before validating reference name
bitcoin-tools Oct 8, 2024
623fcb9
Merge branch 'master' into 1595-feat-add-support-for-risc-v-architecture
bitcoin-tools Oct 8, 2024
382a2b0
remove stdout
bitcoin-tools Oct 9, 2024
1870beb
Update nodebuilder
bitcoin-tools Oct 9, 2024
50eca81
handle case were file stderr doesnt exist
bitcoin-tools Oct 10, 2024
8e793d0
try to suppress apt-utils
bitcoin-tools Oct 10, 2024
779f0d1
Merge branch 'master' into 1595-feat-add-support-for-risc-v-architecture
bitcoin-tools Oct 10, 2024
d00ccb9
Merge branch 'master' into 1595-feat-add-support-for-risc-v-architecture
bitcoin-tools Oct 10, 2024
8c37679
reorder the login with first IBD status check
bitcoin-tools Oct 11, 2024
b045143
Merge branch 'master' into 1595-feat-add-support-for-risc-v-architecture
bitcoin-tools Oct 11, 2024
79d6e74
use two-dimensional matrix
bitcoin-tools Oct 11, 2024
7922aaf
use braces for variable expansion
bitcoin-tools Oct 11, 2024
ce2cf73
Merge branch 'master' into 1595-feat-add-support-for-risc-v-architecture
bitcoin-tools Oct 11, 2024
9b58640
lowercase job name
bitcoin-tools Oct 11, 2024
7e730d0
add job-purpose to CI job name
bitcoin-tools Oct 12, 2024
f1a88ab
Update validation.yaml
bitcoin-tools Oct 12, 2024
555ca30
update name and reorder matrix
bitcoin-tools Oct 12, 2024
5347b49
improve the name
bitcoin-tools Oct 12, 2024
5153fbf
slight reorder
bitcoin-tools Oct 12, 2024
f993b01
Update validation.yaml
bitcoin-tools Oct 12, 2024
f652736
Merge branch 'master' into 1595-feat-add-support-for-risc-v-architecture
bitcoin-tools Oct 12, 2024
81f290a
remove distro name from job name
bitcoin-tools Oct 12, 2024
13edf2a
rename the dockerfile jobs
bitcoin-tools Oct 12, 2024
d726275
try another name
bitcoin-tools Oct 12, 2024
d69fb53
another name variant
bitcoin-tools Oct 12, 2024
bb05429
Update validation.yaml
bitcoin-tools Oct 12, 2024
e428d8e
Merge branch 'master' into 1595-feat-add-support-for-risc-v-architecture
bitcoin-tools Oct 20, 2024
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
55 changes: 52 additions & 3 deletions .github/workflows/validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -398,16 +398,65 @@ jobs:
run: |
sh -x ./test/test_nodebuilder --ref "${GITHUB_SHA}"
[ "$?" -gt 0 ] && echo "test_nodebuilder exited with status $?" >&2 && exit 1
[ -f "/home/bitcoin/.bitcoin/debug.log" ] && cp "/home/bitcoin/.bitcoin/debug.log" .
find / -name debug.log 2> /dev/null | grep bitcoin || true
[ -f '/home/bitcoin/.bitcoin/debug.log' ] && cp '/home/bitcoin/.bitcoin/debug.log' .
- name: Save Bitcoin Core log as artifact
uses: actions/upload-artifact@v4
with:
name: openbsd-source-bitcoin-debug.log
path: /home/runner/work/nodebuilder/nodebuilder/debug.log

run-nodebuilder-qemu:
name: Test ${{ matrix.job-purpose }} on ${{ matrix.arch }}
needs: [changes, shell-lint, yaml-lint]
if: >-
${{
github.event.action == 'prerelease' ||
github.event.action == 'published' ||
needs.changes.outputs.ci == 'true' ||
needs.changes.outputs.dependencies == 'true' ||
needs.changes.outputs.shell == 'true'
}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
distro: [ubuntu_latest, alpine_latest]
arch: [aarch64, riscv64]
include:
- distro: ubuntu_latest
job-purpose: package
- distro: alpine_latest
job-purpose: source
steps:
- uses: actions/checkout@v4
- name: Test the console output
uses: uraimo/run-on-arch-action@v2
timeout-minutes: 330
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
dockerRunArgs: --volume "${PWD}/artifacts:/artifacts"
githubToken: ${{ github.token }}
setup: |
echo "${TERM:-TERM is not found}"
uname -a
id -u
df -h
tput colors
date -u
mkdir -p "${PWD}/artifacts"
run: |
sh -x ./test/test_nodebuilder --ref "${GITHUB_SHA}"
[ -f /root/.bitcoin/debug.log ] && cp /root/.bitcoin/debug.log /artifacts/
chmod o+r /artifacts/debug.log
- name: Save Bitcoin Core log as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.distro }}-${{ matrix.arch }}-bitcoin-debug.log
path: /home/runner/work/nodebuilder/nodebuilder/artifacts/debug.log

run-nodebuilder-docker:
name: Docker image for ${{ matrix.container }}
name: Build docker image for ${{ matrix.container }}
needs: [changes, dockerfile-lint, shell-lint, yaml-lint]
if: >-
github.event.action != 'prerelease' &&
Expand Down
35 changes: 28 additions & 7 deletions nodebuilder
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ ensure_curl_dependency()
sudo apk --quiet add curl
;;
debian | ubuntu)
sudo apt-get install -y curl > /dev/null
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y curl > /dev/null
;;
fedora* | rhel | centos* | rocky | ol)
sudo dnf install --allowerasing --assumeyes curl > /dev/null
Expand Down Expand Up @@ -496,7 +496,7 @@ ensure_curl_dependency()
if command -v apk > /dev/null; then
sudo apk --quiet add curl
elif command -v apt-get > /dev/null; then
sudo apt-get -qq install -y curl > /dev/null
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq install -y curl > /dev/null
elif command -v dnf > /dev/null; then
sudo dnf install --allowerasing --assumeyes curl > /dev/null
elif command -v pacman > /dev/null; then
Expand Down Expand Up @@ -527,7 +527,11 @@ ensure_sudo_dependency()
apk --quiet add sudo
;;
debian | ubuntu)
apt-get install -y sudo > /dev/null
readonly STDERR_INSTALL_LOG_FILE="${TEMP_DIRECTORY}/stderr_install.log"
apt-get update > /dev/null
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --quiet sudo > /dev/null 2> "${STDERR_INSTALL_LOG_FILE}"
grep -v 'apt-utils' "${STDERR_INSTALL_LOG_FILE}" >&2 || true
rm "${STDERR_INSTALL_LOG_FILE}"
;;
fedora* | rhel | centos* | rocky | ol)
dnf install --allowerasing --assumeyes sudo > /dev/null
Expand Down Expand Up @@ -1017,6 +1021,16 @@ install_runtime_dependencies_aptget()
[ -z "${dependencies:-}" ] && throw_error 'The list of dependencies is empty.'
sudo apt-get -qq update
printf '%s\n' "${dependencies}" | xargs sudo DEBIAN_FRONTEND=noninteractive apt-get -qq install --assume-yes --no-install-recommends > /dev/null 2>&1
case "${TARGET_ARCHITECTURE}" in
powerpc64)
# TODO: make this a CI step not in the script
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq install --assume-yes --no-install-recommends libc6:ppc64el > /dev/null 2>&1
;;
riscv64)
sudo DEBIAN_FRONTEND=noninteractive apt-get -qq install --assume-yes --no-install-recommends libatomic1 > /dev/null 2>&1
;;
*) ;;
esac
}

install_runtime_dependencies_darwin()
Expand Down Expand Up @@ -1225,7 +1239,8 @@ install_system_updates_aptget()
{
check_dpkg_lock
readonly STDERR_INSTALL_LOG_FILE="${TEMP_DIRECTORY}/stderr_install.log"
sudo apt-get -qq update && sudo NEEDRESTART_MODE=a apt-get -qq dist-upgrade --assume-yes > /dev/null 2> "${STDERR_INSTALL_LOG_FILE}"
sudo apt-get -qq update &&
sudo NEEDRESTART_MODE=a apt-get -qq dist-upgrade --assume-yes > /dev/null 2> "${STDERR_INSTALL_LOG_FILE}"
grep -v 'apt-utils' "${STDERR_INSTALL_LOG_FILE}" >&2 || true
rm "${STDERR_INSTALL_LOG_FILE}"
}
Expand Down Expand Up @@ -1554,7 +1569,13 @@ readonly BYTES_TO_KIB=1024
readonly KIB_TO_MIB="${BYTES_TO_KIB}"
readonly MIB_TO_GIB="${BYTES_TO_KIB}"

TARGET_ARCHITECTURE="$(uname -m)"
TARGET_ARCHITECTURE=$(uname -m)
case "${TARGET_ARCHITECTURE}" in
ppc64le)
TARGET_ARCHITECTURE='powerpc64'
;;
*) ;;
esac
readonly TARGET_ARCHITECTURE
TARGET_KERNEL="$(uname -s)"
readonly TARGET_KERNEL
Expand Down Expand Up @@ -1869,9 +1890,9 @@ if [ "${ibd_status}" = 'true' ]; then
log_info 'Disabling system sleep, suspend, and hibernate.'
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target > /dev/null 2>&1
fi
log_info "Close this Terminal window by clicking on the 'X'."
log_info "This screen will refresh in ${SLEEP_TIME_SECONDS} seconds."
fi
log_info "Close this Terminal window by clicking on the 'X'."
log_info "This screen will refresh in ${SLEEP_TIME_SECONDS} seconds."
sleep "${SLEEP_TIME_SECONDS}"
else
log_info 'Your node has already synced the blockchain.'
Expand Down
29 changes: 18 additions & 11 deletions test/test_nodebuilder
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ get_operating_system()
handle_exit()
{
kill_tail_process
[ -f nodebuilder ] && rm nodebuilder
[ -f "${STDOUT_TEST_FILENAME}" ] && rm "${STDOUT_TEST_FILENAME}"
[ -f "${STDERR_TEST_FILENAME}" ] && rm "${STDERR_TEST_FILENAME}"
if [ -f nodebuilder ]; then
rm nodebuilder
fi
if [ -f "${STDOUT_TEST_FILENAME}" ]; then
rm "${STDOUT_TEST_FILENAME}"
fi
if [ -f "${STDERR_TEST_FILENAME}" ]; then
rm "${STDERR_TEST_FILENAME}"
fi
}

handle_error()
Expand Down Expand Up @@ -91,12 +97,14 @@ validate_bitcoin_version()

validate_git_ref_short_name()
{
[ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" = 'true' ] ||
throw_error 'Not inside a Git repository.' "${LINENO}"
[ "$(basename "$(git rev-parse --show-toplevel)")" = 'nodebuilder' ] ||
throw_error 'Not in the nodebuilder repository.' "${LINENO}"
git rev-parse --quiet --verify "$1" ||
throw_error "$1 is not a valid branch, tag, or commit." "${LINENO}"
if command -v git > /dev/null 2>&1; then
[ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" = 'true' ] ||
throw_error 'Not inside a Git repository.' "${LINENO}"
[ "$(basename "$(git rev-parse --show-toplevel)")" = 'nodebuilder' ] ||
throw_error 'Not in the nodebuilder repository.' "${LINENO}"
git rev-parse --quiet --verify "$1" ||
throw_error "$1 is not a valid branch, tag, or commit." "${LINENO}"
fi
}

readonly VALID_BITCOIN_VERSION_LIST='0.9.5 0.10.0 0.10.1 0.10.2 0.10.3 0.10.4 \
Expand Down Expand Up @@ -183,8 +191,7 @@ fi
# Execute the script with optional command line arguments
printf 'Executing command: %s\n' "${RUN_NODEBUILDER_COMMAND}"
if ! ${RUN_NODEBUILDER_COMMAND} \
> "${STDOUT_TEST_FILENAME}" \
2> "${STDERR_TEST_FILENAME}"; then
> "${STDOUT_TEST_FILENAME}"; then
throw_error "Failed to execute nodebuilder command."
fi

Expand Down
Loading