Skip to content

openSUSE & Rancher Desktop support (rootless) #1163

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 14 additions & 0 deletions install_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ if [[ $activate_scenario_runner == true ]] ; then
print_message "Installing needed binaries for building ..."
if lsb_release -is | grep -q "Fedora"; then
sudo dnf -y install glib2 glib2-devel tinyproxy stress-ng lshw
elif cat /etc/os-release | grep -q "openSUSE"; then
sudo zypper -n in glib2-tools glib2-devel tinyproxy stress-ng lshw
else
sudo apt-get update
sudo apt-get install -y libglib2.0-0 libglib2.0-dev tinyproxy stress-ng lshw
Expand All @@ -31,6 +33,10 @@ if [[ $activate_scenario_runner == true ]] ; then
print_message "You can add -S to the install script to skip installing lm_sensors. However cluster mode and temperature reporters will not work then." >&2
exit 1
fi
elif cat /etc/os-release | grep -q "openSUSE"; then
if ! sudo zypper -n in sensors libsensors4-devel; then
print_message "Failed to install sensors libsensors4-devel; continuing without Sensors."
fi
else
if ! sudo apt-get install -y lm-sensors libsensors-dev; then
print_message "Failed to install lm-sensors libsensors-dev;" >&2
Expand Down Expand Up @@ -94,6 +100,10 @@ if [[ $activate_scenario_runner == true ]] ; then
print_message "Failed to install msr-tools; If you do not plan to use RAPL you can skip the installation by appending '-r'" >&2
exit 1
fi
elif cat /etc/os-release | grep -q "openSUSE"; then
if ! sudo zypper -n in msr-tools; then
print_message "Failed to install msr-tools; continuing without RAPL."
fi
else
if ! sudo apt-get install -y msr-tools; then
print_message "Failed to install msr-tools; If you do not plan to use RAPL you can skip the installation by appending '-r'" >&2
Expand All @@ -108,6 +118,8 @@ if [[ $activate_scenario_runner == true ]] ; then
{
if lsb_release -is | grep -q "Fedora"; then
sudo dnf -y install freeipmi ipmitool
elif cat /etc/os-release | grep -q "openSUSE"; then
sudo zypper -n in freeipmi ipmitool
else
sudo apt-get install -y freeipmi-tools ipmitool
fi
Expand All @@ -131,6 +143,8 @@ if ! mount | grep -E '\s/tmp\s' | grep -Eq '\stmpfs\s' && [[ $ask_tmpfs == true
if [[ "$tmpfs" == "Y" || "$tmpfs" == "y" ]] ; then
if lsb_release -is | grep -q "Fedora"; then
sudo systemctl unmask --now tmp.mount
elif cat /etc/os-release | grep -q "openSUSE"; then
echo "You probably already have /tmp on a tmpfs"
Copy link
Member

Choose a reason for hiding this comment

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

Can this not be force-enabled? If the user selects yes and action should happen I would argue.

Copy link
Member

Choose a reason for hiding this comment

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

This is the only question open. If you could force mount on tmpfs (typically through systemd) this is ready for merge

Copy link
Author

Choose a reason for hiding this comment

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

Good question, I have found out that tmpfs has been the standard for OpenSUSE almost 5 years for now.
Maybe we can skip this thing for opensuse, instead of asking the user. Or even better find out if it is already using tmpfs (which I don't know yet how to do).
Source: https://en.opensuse.org/openSUSE:Tmp_on_tmpfs

Copy link
Member

Choose a reason for hiding this comment

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

It can be checked, yes.

What is the output of: findmnt -n -o FSTYPE /tmp for you?
If it is tmpfs than the command works as expected and I can bring it in

else
sudo systemctl enable /usr/share/systemd/tmp.mount
fi
Expand Down
2 changes: 1 addition & 1 deletion lib/install_shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ function build_containers() {

if [[ $build_docker_containers == true ]] ; then
print_message "Building / Updating docker containers"
if docker info 2>/dev/null | grep rootless || [[ $(uname) == "Darwin" ]]; then
if docker info 2>/dev/null | grep rootless || docker info 2>/dev/null | grep lima-rancher-desktop || [[ $(uname) == "Darwin" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

lima to my knowledge is a VM based solution. What is the rationale here to check for this support?

Copy link
Member

Choose a reason for hiding this comment

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

is the sudo call failing on your system?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, it's failing because Rancher Desktop registers nerdctl or corresponding docker aliases within the rc file of the user.
The intention of this line is to check if Rancher Desktop is being used and then handle everything rootless.
But not just because of the rc configuration thing, but also because the default mode of Rancher Desktop is rootless.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, understood. I guess it should be changed then from our side. The sudo docker is legacy and since we now have the first quirk with it we remove it. The check for lima feels very specific and going for a general requirement to have the docker command be non-root runnable seems like the better option here. Feel free to remove the line. Otherwise I will remove it after merge.

print_message "Docker is running in rootless/VM mode. Using non-sudo call ..."
docker compose -f docker/compose.yml down
docker compose -f docker/compose.yml build
Expand Down
6 changes: 6 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ sudo rm -f /etc/sudoers.d/green-coding* || true # Linux
if [[ $(uname) == "Linux" ]]; then
if lsb_release -is | grep -q "Fedora"; then
sudo dnf -y remove msr-tools lm_sensors lm_sensors-devel glib2 glib2-devel tinyproxy stress-ng lshw ipmitool
elif cat /etc/os-release | grep -q "openSUSE"; then
sudo zypper rm -n msr-tools sensors libsensors4-devel glib2-tools glib2-devel tinyproxy stress-ng lshw freeipmi ipmitool
else
sudo apt remove -y lm-sensors libsensors-dev libglib2.0-0 libglib2.0-dev tinyproxy stress-ng lshw freeipmi-tools ipmitool msr-tools
fi
Expand All @@ -49,6 +51,8 @@ if [[ $(uname) == "Linux" ]]; then
if [[ "$pre_install" == "Y" || "$pre_install" == "y" ]] ; then
if lsb_release -is | grep -q "Fedora"; then
sudo dnf remove -y curl git make gcc python3 python3-devel
elif cat /etc/os-release | grep -q "openSUSE"; then
sudo zypper rm -n git make gcc python313 python313-pip python313-virtualenv
else
sudo apt remove -y git make gcc python3 python3-pip python3-venv
fi
Expand All @@ -58,6 +62,8 @@ if [[ $(uname) == "Linux" ]]; then
if [[ "$pre_docker" == "Y" || "$pre_docker" == "y" ]] ; then
if lsb_release -is | grep -q "Fedora"; then
sudo dnf remove -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
elif cat /etc/os-release | grep -q "openSUSE"; then
sudo zypper rm -n docker docker-compose docker-compose-switch
else
sudo apt remove -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
fi
Expand Down