From 35c35a7023348111bb8eab593de466f5cc71cc13 Mon Sep 17 00:00:00 2001 From: Chuy Garcia <75956027+chuygarcia92@users.noreply.github.com> Date: Wed, 28 Aug 2024 15:05:51 +0200 Subject: [PATCH 1/3] Verification for RPGF5 (#633) adding a temporary JSON to verify the repository in Optimism's RPGF5 --- funding.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 funding.json diff --git a/funding.json b/funding.json new file mode 100644 index 0000000..f01a264 --- /dev/null +++ b/funding.json @@ -0,0 +1,5 @@ +{ + "opRetro": { + "projectId": "0xf839a585342327848d4541a6fcc315404e879537a60a1370f2cd45a94283a1ba" + } +} From 198cf8725d183c5b462d4a205c209c1d9b4e7f22 Mon Sep 17 00:00:00 2001 From: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com> Date: Wed, 28 Aug 2024 15:06:58 +0200 Subject: [PATCH 2/3] Use docker compose binary in test ci (#634) Use docker compose binary in test ci --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9d9a232..369d1b0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,8 +40,8 @@ jobs: uses: actions/checkout@v4 - name: create iso run: | - docker-compose build - docker-compose up + docker compose build + docker compose up ls images/ - name: verify image run: | From f2b4ddb548e6fb8aa5eac37558986819bce0252e Mon Sep 17 00:00:00 2001 From: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com> Date: Thu, 26 Sep 2024 17:00:33 +0200 Subject: [PATCH 3/3] Use new docker compose (#639) * use docker compose instead of docker-compose * update debian image --- .github/workflows/artifacts.yml | 8 ++-- .github/workflows/release.yml | 8 ++-- Dockerfile | 1 - iso/scripts/generate_dappnode_iso_debian.sh | 4 +- scripts/dappnode_install_pre.sh | 47 ++++++++++----------- 5 files changed, 32 insertions(+), 36 deletions(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 015f220..0aa3946 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -72,8 +72,8 @@ jobs: - name: Build attended run: | sed -i -e "/UNATTENDED/s/true/false/" docker-compose.yml - docker-compose build - docker-compose up + docker compose build + docker compose up # Verify ISO attended created - name: Check iso attended @@ -89,8 +89,8 @@ jobs: - name: Build unattended run: | sed -i -e "/UNATTENDED/s/false/true/" docker-compose.yml - docker-compose build - docker-compose up + docker compose build + docker compose up # Verify ISO unattended was created - name: Check iso unattended diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 48b32d8..6d289db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,8 +72,8 @@ jobs: - name: Build attended run: | sed -i -e "/UNATTENDED/s/true/false/" docker-compose.yml - docker-compose build - docker-compose up + docker compose build + docker compose up # Verify ISO attended created - name: Check iso attended @@ -89,8 +89,8 @@ jobs: - name: Build unattended run: | sed -i -e "/UNATTENDED/s/false/true/" docker-compose.yml - docker-compose build - docker-compose up + docker compose build + docker compose up # Verify ISO unattended was created - name: Check iso unattended diff --git a/Dockerfile b/Dockerfile index a7784e2..e5ef57e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,6 @@ FROM docker:dind # hadolint ignore=DL3018 RUN apk update && \ apk add --no-cache xorriso git xz curl ca-certificates iptables cpio bash perl-utils \ - docker-compose && \ rm -rf /var/cache/apk/* #RUN apk add -U --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing aufs-util diff --git a/iso/scripts/generate_dappnode_iso_debian.sh b/iso/scripts/generate_dappnode_iso_debian.sh index 3f02fb7..329995d 100755 --- a/iso/scripts/generate_dappnode_iso_debian.sh +++ b/iso/scripts/generate_dappnode_iso_debian.sh @@ -2,10 +2,10 @@ set -e # Source = https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.5.0-amd64-netinst.iso -ISO_NAME=debian-12.5.0-amd64-netinst.iso +ISO_NAME=debian-12.7.0-amd64-netinst.iso ISO_PATH="/images/${ISO_NAME}" ISO_URL=https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/ -SHASUM="013f5b44670d81280b5b1bc02455842b250df2f0c6763398feb69af1a805a14f ${ISO_PATH}" +SHASUM="8fde79cfc6b20a696200fc5c15219cf6d721e8feb367e9e0e33a79d1cb68fa83 ${ISO_PATH}" echo "Downloading debian ISO image: ${ISO_NAME}..." if [ ! -f ${ISO_PATH} ]; then diff --git a/scripts/dappnode_install_pre.sh b/scripts/dappnode_install_pre.sh index 2966bb1..9259405 100755 --- a/scripts/dappnode_install_pre.sh +++ b/scripts/dappnode_install_pre.sh @@ -6,7 +6,6 @@ DAPPNODE_DIR="/usr/src/dappnode" LOGS_DIR="$DAPPNODE_DIR/logs" lsb_dist="$(. /etc/os-release && echo "$ID")" - #!ISOBUILD Do not modify, variables above imported for ISO build detect_installation_type() { @@ -20,7 +19,6 @@ detect_installation_type() { fi } - add_docker_repo() { apt-get update -y apt-get remove -y docker docker-engine docker.io containerd runc | tee -a $LOG_FILE @@ -28,16 +26,16 @@ add_docker_repo() { mkdir -p /etc/apt/keyrings && chmod -R 0755 /etc/apt/keyrings curl -fsSL "https://download.docker.com/linux/${lsb_dist}/gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg chmod a+r /etc/apt/keyrings/docker.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$lsb_dist $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$lsb_dist $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list >/dev/null } # DOCKER INSTALLATION install_docker() { apt-get update -y - apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin | tee -a $LOG_FILE + apt-get install -y docker-ce docker-ce-cli containerd.io | tee -a $LOG_FILE # Ensure xz is installed - [ -f "/usr/bin/xz" ] || ( apt-get install -y xz-utils) + [ -f "/usr/bin/xz" ] || (apt-get install -y xz-utils) USER=$(grep 1000 "/etc/passwd" | cut -f 1 -d:) [ -z "$USER" ] || usermod -aG docker "$USER" @@ -56,31 +54,31 @@ install_docker() { # DOCKER-COMPOSE FOR LEGACY SCRIPTS, SHOULD BE REMOVED EVENTUALLY alias_docker_compose() { - cat > /usr/local/bin/docker-compose</usr/local/bin/docker-compose </dev/null 2>&1 ; then + if modprobe wireguard >/dev/null 2>&1; then echo -e "\e[32m \n\n Verified wiregurd-dkms installation \n\n \e[0m" 2>&1 | tee -a $LOG_FILE else echo -e "\e[31m \n\n WARNING: wireguard kernel module is not installed, Wireguard DAppNode package might not work! \n\n \e[0m" 2>&1 | tee -a $LOG_FILE fi } -# LSOF INSTALLATION: used to scan host port 80 in use, https package installation will deppend on it +# LSOF INSTALLATION: used to scan host port 80 in use, https package installation will deppend on it install_lsof() { apt-get update -y apt-get install lsof -y | tee -a $LOG_FILE - if lsof -v >/dev/null 2>&1 ; then + if lsof -v >/dev/null 2>&1; then echo -e "\e[32m \n\n Verified lsof installation \n\n \e[0m" 2>&1 | tee -a $LOG_FILE else echo -e "\e[31m \n\n WARNING: lsof not installed, HTTPS DAppNode package might not be installed! \n\n \e[0m" 2>&1 | tee -a $LOG_FILE @@ -88,10 +86,10 @@ install_lsof() { } # IPTABLES INSTALLATION: mandatory for docker, on bullseye is not installed by default -install_iptables () { +install_iptables() { apt-get update -y apt-get install iptables -y | tee -a $LOG_FILE - if iptables -v >/dev/null 2>&1 ; then + if iptables -v >/dev/null 2>&1; then echo -e "\e[32m \n\n Verified iptables installation \n\n \e[0m" 2>&1 | tee -a $LOG_FILE else echo -e "\e[31m \n\n WARNING: iptables not installed, Docker may not work! \n\n \e[0m" 2>&1 | tee -a $LOG_FILE @@ -99,7 +97,7 @@ install_iptables () { } # HOST UPDATE -host_update () { +host_update() { apt-get update 2>&1 | tee -a $LOG_FILE apt-get -y upgrade 2>&1 | tee -a $LOG_FILE } @@ -122,8 +120,7 @@ if [ "$1" == "UPDATE" ]; then host_update 2>&1 | tee -a $LOG_FILE fi - -if find /etc/apt/ -name "*.list" -print0 | xargs --null cat | grep -q "https://download.docker.com/linux/$lsb_dist" ; then +if find /etc/apt/ -name "*.list" -print0 | xargs --null cat | grep -q "https://download.docker.com/linux/$lsb_dist"; then echo -e "\e[32m \n\n docker repo is already added \n\n \e[0m" 2>&1 | tee -a $LOG_FILE else add_docker_repo | tee -a $LOG_FILE @@ -136,15 +133,8 @@ else install_docker 2>&1 | tee -a $LOG_FILE fi -# Only install docker-compose if needed -if docker-compose -v >/dev/null 2>&1; then - echo -e "\e[32m \n\n docker-compose is already aliased \n\n \e[0m" 2>&1 | tee -a $LOG_FILE -else - alias_docker_compose 2>&1 | tee -a $LOG_FILE -fi - # Only install wireguard-dkms if needed -if modprobe wireguard >/dev/null 2>&1 ; then +if modprobe wireguard >/dev/null 2>&1; then echo -e "\e[32m \n\n wireguard-dkms is already installed \n\n \e[0m" 2>&1 | tee -a $LOG_FILE else install_wireguard_dkms 2>&1 | tee -a $LOG_FILE @@ -158,7 +148,10 @@ else fi #Check connectivity -{ [ -f /etc/network/interfaces ] && grep "iface en.* inet dhcp" /etc/network/interfaces &>/dev/null; } || { echo "Interfaces not found"; exit 1; } +{ [ -f /etc/network/interfaces ] && grep "iface en.* inet dhcp" /etc/network/interfaces &>/dev/null; } || { + echo "Interfaces not found" + exit 1 +} ## Add missing interfaces if [ -f /usr/src/dappnode/hotplug ]; then @@ -166,7 +159,11 @@ if [ -f /usr/src/dappnode/hotplug ]; then for IFACE in $(grep "en.*" /usr/src/dappnode/hotplug); do # shellcheck disable=SC2143 if [[ $(grep -L "$IFACE" /etc/network/interfaces) ]]; then - { echo "# $IFACE"; echo "allow-hotplug $IFACE"; echo "iface $IFACE inet dhcp"; } >> /etc/network/interfaces + { + echo "# $IFACE" + echo "allow-hotplug $IFACE" + echo "iface $IFACE inet dhcp" + } >>/etc/network/interfaces fi done fi