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

infra: Remove unnecessary deps from install deps #5844

Conversation

jkonecny12
Copy link
Member

@jkonecny12 jkonecny12 commented Aug 20, 2024

One of the biggest use cases for the install_dependencies.sh script is to get dependencies to the container for development easily. However, container management services are not usable from the container directly and are not helpful for development (just runtime dependency).

These packages are:

  • podman
  • ostree
  • skopeo

Having these in the container is blocking easy way to call these from inside of the container in similar cases like distrobox-host-exec which enables you to call container commands (allows our make commands) from inside of the distrobox container.

@github-actions github-actions bot added the f41 label Aug 20, 2024
@jkonecny12
Copy link
Member Author

/kickstart-test --waive infra only

@jkonecny12 jkonecny12 added the infrastructure Changes affecting mostly infrastructure label Aug 20, 2024
Copy link
Contributor

@KKoukiou KKoukiou left a comment

Choose a reason for hiding this comment

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

This should rather be properly implemented through an --disable-bootc argument in configure.ac

Then the spec file can conditionally build anaconda without bootc dependencies.

I am not expert in build tools, so we can pull in someone else for opinion, but I am pretty sure this solution here suboptimal to the suggested one.

@jkonecny12
Copy link
Member Author

I don't think this have to be bootc related.

Also do we want to complicate our code because of this script. Seems to me too much effort for a little gain.

@jkonecny12
Copy link
Member Author

Also when I'm thinking about it, it won't help here. Having support in configure.ac won't be usable by the script because the script is not building the RPM but only reading spec file. It don't have any information from the configure step.

Copy link
Contributor

@KKoukiou KKoukiou left a comment

Choose a reason for hiding this comment

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

I believe it's a valid scenario to want to build anaconda without bootc support, no?
So expect for that I find the suggested solution cleaner, it's an improvement to be able to remove dependencies when these are not used.
Happy to discuss this further.

@@ -42,7 +42,9 @@ sed 's/@PACKAGE_VERSION@/0/; s/@PACKAGE_RELEASE@/0/; s/%{__python3}/python3/' ./
build_deps=$(rpmspec -q --buildrequires $TEMP | sed 's/>=.*$//')
# add also runtime dependencies for the local development
# remove anaconda packages and also '(glibc-langpack-en or glibc-all-langpacks)' which will fail otherwise
requires_deps=$(rpmspec -q --requires $TEMP | grep -v -E "(anaconda-|-widgets| or )" | sed 's/>=.*$//')
# remove podman, ostree (and skopeo as ostree dependency) because these are not required for development of Anaconda
# and are breaking easy use of host commands from the container (distrobox-host-exec)
Copy link
Contributor

Choose a reason for hiding this comment

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

You can do something like:

`rpmspec --define "build_bootc 0 ..."

Copy link
Contributor

Choose a reason for hiding this comment

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

And in the spec file:

diff --git anaconda.spec.in anaconda.spec.in
index 709ab7fcc2..0602d95d42 100644
--- anaconda.spec.in
+++ anaconda.spec.in
@@ -46,6 +46,7 @@ Source0: https://github.com/rhinstaller/%{name}/releases/download/%{name}-%{vers
 %define subscriptionmanagerver 1.26
 %define utillinuxver 2.15.1
 %define rpmostreever 2023.2
+%define build_bootc 1
 
 BuildRequires: libtool
 BuildRequires: gettext-devel >= %{gettextver}
@@ -273,7 +274,9 @@ Requires: skopeo
 # External tooling for managing NVMe-FC devices in the installation environment
 Requires: nvme-cli
 # Needed for bootc
+%if %{build_bootc}
 Requires: podman
+%endif

Copy link
Member Author

Choose a reason for hiding this comment

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

This is great. I wasn't aware that rpmspec supports this. Sounds good.

@M4rtinK
Copy link
Contributor

M4rtinK commented Aug 21, 2024

What about external contributors ? I think some of them might be using this script prepare their environment for Anaconda development ?

@KKoukiou
Copy link
Contributor

What about external contributors ? I think some of them might be using this script prepare their environment for Anaconda development ?

You mean installing the deps on their machine directly and not container I guess? Installing the RPM dependencies just helps code editor programs to not complain about missing imports. Nothing more than that. Not sure what you see as problematic here.

@martinpitt
Copy link
Contributor

@KKoukiou asked for opinions here. My gut feeling about the current PR change is "hackish, but bearable". The goal is 100% legit -- it doesn't make sense to pull in podman & friends onto developer laptops or toolboxes. Whether you do this with rpm conditionals or sed doesn't make too much practical difference.

FTR, for my own toolboxes I use flatpak-spawn wrappers to call things like podman. I suppose distrobox-host-exec does something similar.

@KKoukiou
Copy link
Contributor

@KKoukiou asked for opinions here. My gut feeling about the current PR change is "hackish, but bearable". The goal is 100% legit -- it doesn't make sense to pull in podman & friends onto developer laptops or toolboxes. Whether you do this with rpm conditionals or sed doesn't make too much practical difference.

FTR, for my own toolboxes I use flatpak-spawn wrappers to call things like podman. I suppose distrobox-host-exec does something similar.

Thank you Martin.

Copy link
Contributor

@KKoukiou KKoukiou left a comment

Choose a reason for hiding this comment

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

Feel free to decide to keep it like this and merge or implement the suggestions.

@jkonecny12
Copy link
Member Author

jkonecny12 commented Aug 22, 2024

@KKoukiou asked for opinions here. My gut feeling about the current PR change is "hackish, but bearable". The goal is 100% legit -- it doesn't make sense to pull in podman & friends onto developer laptops or toolboxes. Whether you do this with rpm conditionals or sed doesn't make too much practical difference.

FTR, for my own toolboxes I use flatpak-spawn wrappers to call things like podman. I suppose distrobox-host-exec does something similar.

Distrobox has a great solution for this. It works in a way that you will symlink the distrobo-host-exec script to the PATH (usually to /usr/bin in my case) and it will just behave as the command you want. Super easy to use and pretty helpful in general.

One of the biggest use cases for the install_dependencies.sh script is
to get dependencies to the container for development easily. However,
container management services are not usable from the container directly
and are not helpful for development (just runtime dependency).

Having these in the container could block easy way to call binaries from
inside of the container in similar cases like `distrobox-host-exec`
which enables you to call container commands (allows our make commands)
from inside of the distrobox container.
Others are just wrong to be installed on developer machine for example
gnome-kiosk.
@jkonecny12 jkonecny12 force-pushed the master-remove-podman-from-install-dependencies branch from 3ec3319 to 3d5a065 Compare August 22, 2024 14:51
@jkonecny12 jkonecny12 changed the title infra: Remove podman etc. from install deps script infra: Remove unnecessary deps from install deps Aug 22, 2024
@jkonecny12
Copy link
Member Author

OK, I changed this to a list of dependencies which shouldn't be on the developer machine. This will make size of the deps almost halved.
Also if someone will use this on the host machine directly (not toolbx container) it won't install packages as gnome-kiosk which in some cases might be even hurtful to the machine.

@jkonecny12
Copy link
Member Author

As before, this is not requirement to merge. I would honestly like to hear what do you think @KKoukiou

@jkonecny12
Copy link
Member Author

Closed in favor of #5854

@jkonecny12 jkonecny12 closed this Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f41 infrastructure Changes affecting mostly infrastructure
Development

Successfully merging this pull request may close these issues.

4 participants