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

Conversation

thiloettelt
Copy link

Hello,

I made some rather naive changes to the install_linux.sh and install_shared.sh in order to support installation on openSUSE (tested on tumbleweed) and also triggering rootless mode when discovering Rancher Desktop.

Sincerely,
Thilo

- Rancher Desktop support (rootless)
@ArneTR
Copy link
Member

ArneTR commented Apr 26, 2025

Uhh, great! Thanks for the PR! 🥰

The submitted additions to the install files look all sound to me.

Could you also double check which libraries need to be uninstalled again in: https://github.com/green-coding-solutions/green-metrics-tool/blob/main/uninstall.sh

The uninstall script gives the option to first remove all installed libraries via the install script. So it will be the same listing I guess ... unless package naming for uninstall works differently on openSUSE

But also the uninstall script will remove pre-required dependencies, which we list in the docs under: https://docs.green-coding.io/docs/installation/installation-linux/#downloading-and-installing-required-packages

Could you list the packages and the respective names you had to install on your distribtion in the uninstall script?

I will then transport the information to the docs and update it with an openSUSE instruction given your PR.

Thanks again so much, we love that the tool gets used on openSUSE too :)

@ArneTR
Copy link
Member

ArneTR commented Jun 13, 2025

Hey @thiloettelt ,

we haven't heard any feedback on this PR for a while. Did you read the reply?

Happy to talk futher! Would be great if you could provide an update if the PR is still "alive"

@thiloettelt
Copy link
Author

What a timing, I just resumed working on the PR.
I have just updated the PR and want to test it on a clean VM.
I'll give you notice today, when it's done.

@thiloettelt
Copy link
Author

For conformity I'm also using lsb_release for OpenSUSE right now.
However I have found out that the lsb-release package is not installed on OpenSUSE by default.
The common way would be to use /etc/os-release
It should be something that basically works on any distro.
Not sure how to proceed with this.

@ArneTR
Copy link
Member

ArneTR commented Jun 13, 2025

Using /etc/os-release seems far cleaner. Please use that instead of lsb_release. We will also change the code on main. Thanks for the hint!

@thiloettelt
Copy link
Author

I have replaced lsb_release for the opensuse parts wirth /etc/os-release and added some missing optional uninstall commands for opensuse.

Copy link
Member

@ArneTR ArneTR left a comment

Choose a reason for hiding this comment

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

I looked at the PR and have some minor questions but also a confusion with lima, then I feel it can be merged in and is a really nice addition! Thanks again!

@@ -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

@@ -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.

uninstall.sh Outdated
@@ -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 --dry-run -n git make gcc python313 python313-pip python313-virtualenv
Copy link
Member

Choose a reason for hiding this comment

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

removal of curl here also? or can it not be removed as it is a core package?

Copy link
Author

Choose a reason for hiding this comment

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

I don't know about the curl, that's in the line that is not from me.
I believe all of these packages actually come installed on OpenSUSE, so I am not sure whether there should be an option to remove them for openSUSE.

Copy link
Member

Choose a reason for hiding this comment

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

I understand. To my research it is not installed in minimal. So in the spirit of "removing all dependencies" we will remove it. No need to update the PR. Will do it after merge

Copy link
Author

Choose a reason for hiding this comment

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

I had accidentally introduced --dry-run, which I just corrected.

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.

2 participants