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

Add Ubuntu ISO #626

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open

Add Ubuntu ISO #626

wants to merge 45 commits into from

Conversation

dappnodedev
Copy link
Contributor

This PR aims to provide a new dappnode ISO image based on Ubuntu, instead of Debian

@dappnodedev dappnodedev marked this pull request as ready for review June 10, 2024 14:11
@dappnodedev dappnodedev requested a review from a team as a code owner June 10, 2024 14:11
}

# 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 docker-buildx-plugin docker-compose-plugin | tee -a $LOG_FILE

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add buildx-plugin? does ubuntu need it and debian doesnt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script dappnode_install_pre is executed both in Debian and Ubuntu. I added it because it is recommended here: https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository and we also use it to build packages for several architectures


# Not working in Ubuntu ISO because the user is not created before executing late-commands

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is not working in ubuntu and has to be done in dappnode_install.sh, shouldnt we only add user in docker group only if NOT in ubuntu? to avoid unnecessary warning or errors

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Ubuntu it will just not be executed because the user with ID 1000 does not exist yet.

fi

echo -e "\e[32mAdding user to docker group...\e[0m" 2>&1 | tee -a $LOGFILE
addUserToDockerGroup

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if all distros (debian, ubuntu..) call addUserToDockerGroup() here, we can remove it from dappnode_install_pre.sh right?

run: |
echo -en "# Versions\n| Package | Version |\n|---|---|\nbind.dnp.dappnode.eth|${BIND_VERSION}|\n|ipfs.dnp.dappnode.eth|${IPFS_VERSION}|\n|vpn.dnp.dappnode.eth |${VPN_VERSION}|\n|dappmanager.dnp.dappnode.eth|${DAPPMANAGER_VERSION}|\n|wifi.dnp.dappnode.eth|${WIFI_VERSION}|\n|https.dnp.dappnode.eth|${HTTPS_VERSION}|\n|wireguard.dnp.dappnode.eth|${WIREGUARD_VERSION}|\n# Changes\nChanges implemented in release ${CORE_VERSION}\n# Attended version\nInstall and customize DAppNode using the attended ISO: **DAppNode-${CORE_VERSION}-debian-bookworm-amd64.iso**\n\n## ISO SHA-256 Checksum\n\`\`\`\nshasum -a 256 DAppNode-${CORE_VERSION}-debian-bookworm-amd64.iso\n${SHASUM_ATTENDED}\n\`\`\`\n# Unattended version\nInstall DAppNode easily using the unattended ISO: **DAppNode-${CORE_VERSION}-debian-bookworm-amd64-unattended.iso**\nDo a reboot right after the installation\n:warning: **Warning**: This ISO will install Dappnode automatically, deleting all existing partitions on the disk\n\ndefault login data:\n - **__user__**: dappnode\n - **__password__**: dappnode.s0\n## ISO SHA-256 Checksum\n\`\`\`\nshasum -a 256 DAppNode-${CORE_VERSION}-debian-bookworm-amd64-unattended.iso\n${SHASUM_UNATTENDED}\n\`\`\`\n# DAppNode for Raspberry Pi 4 64bit\n[Instructions](https://github.com/dappnode/DAppNode/wiki/DAppNodeARM-Installation-Guide)\n\ndefault login data:\n - **__user__**: dappnode\n - **__password__**: dappnodepi" > CHANGELOG.md
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I mistakenly removed this

run: |
cp ./images/DAppNode-debian-bookworm-amd64.iso DAppNode-${CORE_VERSION}-debian-bookworm-amd64.iso
file=$(ls images/Dappnode-debian-*.iso)
attended_filename="${file/images\/Dappnode-/Dappnode-${CORE_VERSION}-}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

run: |
cp ./images/DAppNode-debian-bookworm-amd64.iso DAppNode-${CORE_VERSION}-debian-bookworm-amd64-unattended.iso
file=$(ls images/Dappnode-ubuntu-*.iso)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

samer, why this change?

core_filename="${file/images\/Dappnode-/Dappnode-${CORE_VERSION}-}"
unattended_filename="${core_filename/%.iso/-unattended.iso}"

mv "$file" "$unattended_filename"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

# Ubuntu ISO UNATTENDED
- name: Build Ubuntu unattended
run: |
sed -i -e "/BASE_OS/s/ubuntu/debian/" docker-compose.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be done in a different PR, looks weird to edit compose env instead of running something like docker compose run --env see https://docs.docker.com/compose/environment-variables/set-environment-variables/#set-environment-variables-with-docker-compose-run---env

sed -i -e "/UNATTENDED/s/true/false/" docker-compose.yml
docker-compose build
docker-compose up
docker-compose up --build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should consider using new docker compose instead of legacy docker-compose

@@ -22,4 +22,8 @@ fi
mkdir -p /usr/src/app/dappnode
touch /usr/src/app/dappnode/iso_install.log

/usr/src/app/iso/scripts/generate_dappnode_iso_debian.sh
if [ "$BASE_OS" = "ubuntu" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say its cleaner to do something like

/usr/src/app/iso/scripts/${BASE_OS}.sh

iso/scripts/generate_dappnode_iso_debian.sh Show resolved Hide resolved
@@ -290,6 +323,30 @@ installExtraDpkg() {
fi
}

# The main user needs to be added to the docker group to be able to run docker commands without sudo
# Explained in: https://docs.docker.com/engine/install/linux-postinstall/
addUserToDockerGroup() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be done in the installer or pre-requisites script and why?

@@ -290,6 +323,30 @@ installExtraDpkg() {
fi
}

# The main user needs to be added to the docker group to be able to run docker commands without sudo
# Explained in: https://docs.docker.com/engine/install/linux-postinstall/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should stop relying on upstream documentation that may change at any time and start using something dynamic like https://github.com/docker/docker-install/tree/master

@@ -20,25 +19,33 @@ detect_installation_type() {
fi
}


add_docker_repo() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, we should be using something like https://github.com/docker/docker-install/tree/master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants