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

Some openSUSE improvement #262

Merged
merged 2 commits into from
May 11, 2022
Merged

Some openSUSE improvement #262

merged 2 commits into from
May 11, 2022

Conversation

dfaggioli
Copy link
Collaborator

This pull request does the following:

  1. fix openSUSE systemd (i.e., --init) enabled distrobox
  2. customize openSUSE images during init, for enabling recommended packages
  3. make it possible to keep recommended packages disabled --if one really wants that-- and do it in a way that is generic and can be used by other distroboxes and for other things

About 2 and 3, the first enter in a distrobox with is now quite a bit slower (because zypper is quite slow itself :-( ), but I think it's worth it. In fact, the resulting distrobox is now actually useful. E.g., GUI apps (but also non-GUI apps, as even just vim has problem withou recommended packages!) now works pretty much out of the box, once installed.

For comparison, I've created a Tumbleweed based distrobox, installed neofetch, vim and gedit, and it has ~600 packages. I've done the same on a rawhide one, and it has a little less than 500. So I think, all in all, it's fine, and well worth it.

@89luca89
Copy link
Owner

89luca89 commented May 6, 2022

Hi @dfaggioli thanks for the PR!

I was thinking, would it be better to default to something more generic like

${DBX_CONTAINER_UNMINIMIZE}

The upside would be easier documentation (one var for all distros) and we can use it to unminimize also Ubuntu Debian and Fedora (which I can add later after this PR ) 👍

distrobox-create Outdated Show resolved Hide resolved
@dfaggioli dfaggioli force-pushed the opensuse branch 2 times, most recently from 6a70d6e to 4a46217 Compare May 6, 2022 21:45
@dfaggioli
Copy link
Collaborator Author

dfaggioli commented May 6, 2022

Mmm... interesting, on openSUSE, something is now trying to install parallel-printer-support (really?!?!), which is trying to create stuff like /dev/lp0, and failing. This only happens with the toolbox image (which is why I didn't see, as I focused my testing on Tumbleweed)... Not sure why.

The most of the dependencies come from vte, and the packages are installed before marking /dev as a net-share. But we can't move all the package handling after that, because we need some of those packages there very early.

I can try to split packages installation in two steps. The second one (which for know would only contain vte packages, but I guess other packages, in future, may need the same treatment) will happen later, after mounts have been marked.

@dfaggioli
Copy link
Collaborator Author

I can try to split packages installation in two steps. The second one (which for know would only contain vte packages, but I guess other packages, in future, may need the same treatment) will happen later, after mounts have been marked.

Nope, I've just tested this, and it still does not work.

The only solution I'm seeing right now, is to lock out the parallel-printer-support package. Not being able to install such package inside a distrobox does not seem a big deal at all to me... So I'm updating the pull request to that effect.

If anyone see a better solution, I'm all ears :-D

@dfaggioli
Copy link
Collaborator Author

dfaggioli commented May 6, 2022

Hi @dfaggioli thanks for the PR!

I was thinking, would it be better to default to something more generic like

${DBX_CONTAINER_UNMINIMIZE}

Ok, I can do that.

One question: do I keep the DBX_CONTAINER_INIT_ prefix, for the variable name, and then only define in the environment the variables that have that prefix (as I'm doing right now)?

Or shall I just drop the _INIT_ part, and just put in the env all the DBX_CONTAINER_ variables? If we're making this generic, I'm thinking this second solution would be just fine, but I'm happy to do it the way you like it better. :-)

@89luca89
Copy link
Owner

89luca89 commented May 7, 2022

Hi @dfaggioli thanks for the PR!
I was thinking, would it be better to default to something more generic like
${DBX_CONTAINER_UNMINIMIZE}

Ok, I can do that.

One question: do I keep the DBX_CONTAINER_INIT_ prefix, for the variable name, and then only define in the environment the variables that have that prefix (as I'm doing right now)?

Or shall I just drop the _INIT_ part, and just put in the env all the DBX_CONTAINER_ variables? If we're making this generic, I'm thinking this second solution would be just fine, but I'm happy to do it the way you like it better. :-)

I think droppint INIT is fine, after this I think I'll make it also a command line flag (--unminimize something like that) so that it can also be configured in the conf files and so on 👍

@89luca89
Copy link
Owner

89luca89 commented May 7, 2022

I can try to split packages installation in two steps. The second one (which for know would only contain vte packages, but I guess other packages, in future, may need the same treatment) will happen later, after mounts have been marked.

Nope, I've just tested this, and it still does not work.

The only solution I'm seeing right now, is to lock out the parallel-printer-support package. Not being able to install such package inside a distrobox does not seem a big deal at all to me... So I'm updating the pull request to that effect.

If anyone see a better solution, I'm all ears :-D

Doubt that we need parallel printer in a container 🤔 so maybe blocking it is ok I guess

distrobox-init Outdated Show resolved Hide resolved
@dfaggioli
Copy link
Collaborator Author

I was thinking, would it be better to default to something more generic like

${DBX_CONTAINER_UNMINIMIZE}

The upside would be easier documentation (one var for all distros) and we can use it to unminimize also Ubuntu Debian and Fedora (which I can add later after this PR ) +1

Hey, me again, and sorry for bothering. I was back working on this, and I can't convince myself to like "unminimize", mostly because of the "inverted logic".

How about we call it something like DBX_CONTAINER_MINIMIZE or DBX_CONTAINER_MINIMAL_IMAGE ? Then, for openSUSE, I'd just set onlyRequires to true, unless I find that the variable is set to true (or 1).

It seems to me that this could work well also for other distros. In fact, AFAICT, Fedora installs soft dependency by default already, so one could just handle it in a similar way...

That said, if doing things this way is, for some reason that I don't see, unideal, or if you don't like, I'll go for UNMINIMIZE... Just let me know. :-)

@89luca89
Copy link
Owner

I was thinking, would it be better to default to something more generic like
${DBX_CONTAINER_UNMINIMIZE}
The upside would be easier documentation (one var for all distros) and we can use it to unminimize also Ubuntu Debian and Fedora (which I can add later after this PR ) +1

Hey, me again, and sorry for bothering. I was back working on this, and I can't convince myself to like "unminimize", mostly because of the "inverted logic".

How about we call it something like DBX_CONTAINER_MINIMIZE or DBX_CONTAINER_MINIMAL_IMAGE ? Then, for openSUSE, I'd just set onlyRequires to true, unless I find that the variable is set to true (or 1).

It seems to me that this could work well also for other distros. In fact, AFAICT, Fedora installs soft dependency by default already, so one could just handle it in a similar way...

That said, if doing things this way is, for some reason that I don't see, unideal, or if you don't like, I'll go for UNMINIMIZE... Just let me know. :-)

I was thinking the same to be honest 😄
Generally speaking I was thinking that UNMINIMIZE should be default, distrobox use cases is to have a usable userland, so having minimized containers, does not make a lot of sense

So maybe, without bothering to check variables, just unminimize it?

@dfaggioli
Copy link
Collaborator Author

How about we call it something like DBX_CONTAINER_MINIMIZE or DBX_CONTAINER_MINIMAL_IMAGE ? Then, for openSUSE, I'd just set onlyRequires to true, unless I find that the variable is set to true (or 1).
It seems to me that this could work well also for other distros. In fact, AFAICT, Fedora installs soft dependency by default already, so one could just handle it in a similar way...
That said, if doing things this way is, for some reason that I don't see, unideal, or if you don't like, I'll go for UNMINIMIZE... Just let me know. :-)

I was thinking the same to be honest smile

:-)

Generally speaking I was thinking that UNMINIMIZE should be default, distrobox use cases is to have a usable userland, so having minimized containers, does not make a lot of sense

Totally agree!

So maybe, without bothering to check variables, just unminimize it?

You mean we just get rid of it entirely?

@89luca89
Copy link
Owner

You mean we just get rid of it entirely?

The variable yes, we can just add the de-minimization inside the zypper section, and should be ok
After that I'll do the same for the other distributions/package managers

@89luca89
Copy link
Owner

I'd put the conf manipulation just before the shell_pkg installation, so we ensure that all the base dependencies are installed with recommends and docs 👍

systemd may not be part (and, as a matter of fact, it's not!) of the
container image. Which means that a distrobox created with '--init'
will never work.

Add it there.

Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
@89luca89
Copy link
Owner

@dfaggioli
I'd also check for:

rpm.install.excludedocs=yes

That also is really useful to unminimize 👍

@dfaggioli dfaggioli force-pushed the opensuse branch 2 times, most recently from c7b2de0 to 3e729c6 Compare May 11, 2022 18:08
@dfaggioli
Copy link
Collaborator Author

@dfaggioli I'd also check for:

rpm.install.excludedocs=yes

That also is really useful to unminimize +1

Heh, we indeed do that as well (at least for Tumbleweed images... but not for toolbox images):

https://build.opensuse.org/package/view_file/openSUSE:Factory/opensuse-tumbleweed-image/config.sh?expand=1

In openSUSE images, zypper is usually configured to ignore recommended
packages (i.e., weak dependencies). This is one of the reasons why
images are small, and also why only an handful of packages are installed
in the distrobox, during init.

However, this also means that quite a few things (e.g., GUI apps) may
not work out-of-the-box for users, and that more packages would need to
be installed (and it's often not super easy to tell which ones!).

Note also that recommended packages are enabled by default in "regular"
openSUSE/SUSE installs, so having them enabled in the distrobox as well,
is most likely what distrobox users expects.

Let's, therefore, enable them. This makes the initialization of the
dbox (i.e., the first `distrobox enter`) a bit slow, as much more
packages will be installed (and zypper is not really something one can
call fast!), but the improved user experience is worth it.

For the same reason, let's also make sure that we install the docs
files of the RPM packages.

A small side effect is that, on certain image, a package that does
not install properly when inside rootless podman could be pulled in.
Since that is parallel-printer-support, which we'll never going to
need inside a distrobox, we can just lock it out.

Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
@89luca89
Copy link
Owner

Cool all green now 😄 merging!
Thanks for the contribution!

@89luca89 89luca89 merged commit 88aaf06 into 89luca89:main May 11, 2022
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.

None yet

2 participants