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

bootstrap_image and the local repositories #1167

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

praiskup
Copy link
Member

@praiskup praiskup commented Jul 27, 2023

We can not use user_mountpoints because these aren't (historically, not
sure what are the reasons) mounted too late during the Buildroot
preparation (after the self._init_pkg_management()).  This isn't
actually an issue when 'use_bootstrap_image == False' because we use the
package manager on host (so it actually sees the repository on host).

So newly we place the local_repo mount points into the "managed"
category, which seems even semantically better now.  We though need to
call the 'self.mounts.mountall_managed()' method a little bit later than
before, when the local repo BindMountPoints are already defined by
self.pkg_manager.initialize().

This problem has been triggered by the LVM test-case that creates a
custom local_repo (on host) with `baseurl=/tmp/foo` that needs to be
bind-mounted into the bootstrap chroot properly.

praiskup added a commit to praiskup/mock that referenced this pull request Jul 27, 2023
We can not use user_mountpoints because these aren't (historically, not
sure what are the reasons) mounted too late during the Buildroot
preparation (after the self._init_pkg_management()).  This isn't
actually an issue when 'use_bootstrap_image == False' because we use the
package manager on host (so it actually sees the repository on host).

So newly we place the local_repo mount points into the "managed"
category, which seems even semantically better now.  We though need to
call the 'self.mounts.mountall_managed()' method a little bit later than
before, when the local repo BindMountPoints are already defined by
self.pkg_manager.initialize().

Closes: rpm-software-management#1167
@praiskup praiskup changed the title LVM && file:// repositories bootstrap_image and the local repositories Jul 27, 2023
praiskup added a commit to praiskup/mock that referenced this pull request Jul 27, 2023
We can not use user_mountpoints because these aren't (historically, not
sure what are the reasons) mounted too late during the Buildroot
preparation (after the self._init_pkg_management()).  This isn't
actually an issue when 'use_bootstrap_image == False' because we use the
package manager on host (so it actually sees the repository on host).

So newly we place the local_repo mount points into the "managed"
category, which seems even semantically better now.  We though need to
call the 'self.mounts.mountall_managed()' method a little bit later than
before, when the local repo BindMountPoints are already defined by
self.pkg_manager.initialize().

Closes: rpm-software-management#1167
praiskup added a commit to praiskup/mock that referenced this pull request Jul 27, 2023
We can not use user_mountpoints because these aren't (historically, not
sure what are the reasons) mounted too late during the Buildroot
preparation (after the self._init_pkg_management()).  This isn't
actually an issue when 'use_bootstrap_image == False' because we use the
package manager on host (so it actually sees the repository on host).

So newly we place the local_repo mount points into the "managed"
category, which seems even semantically better now.  We though need to
call the 'self.mounts.mountall_managed()' method a little bit later than
before, when the local repo BindMountPoints are already defined by
self.pkg_manager.initialize().

Closes: rpm-software-management#1167
@praiskup praiskup added the release-blocker This needs to be shipped in the next release label Jul 27, 2023
@praiskup praiskup mentioned this pull request Jul 24, 2023
6 tasks
@FrostyX
Copy link
Member

FrostyX commented Aug 1, 2023

I tried the combination of local repositories and bootstrap image and it seems to work even without this PR

git checkout main

PYTHONPATH=/home/jkadlcik/git/mock/mock/py \
    sudo python3 py/mock.py \
    -r /etc/mock/fedora-38-x86_64.cfg \
    --configdir ../mock-core-configs/etc/mock \
    --bootstrap-chroot \
    --use-bootstrap-image \
    -a file:///home/jkadlcik/repo --install copr-cli

And the repo is successfully synced

file:///home/jkadlcik/repo                       2.9 MB/s | 3.0 kB     00:00
fedora                                           150 kB/s |  19 kB     00:00
updates                                          193 kB/s |  18 kB     00:00
local                                            2.9 MB/s | 3.0 kB     00:00

and the package is successfully installed from the repository

Dependencies resolved.
===================================================================================================
 Package                    Version                                        Repository              
===================================================================================================
Installing:
 copr-cli                   1.109-1.git.66.688323e.fc38                    _home_jkadlcik_repo     

So I am probably misunderstanding the issue?

@praiskup
Copy link
Member Author

praiskup commented Aug 1, 2023

PYTHONPATH=/home/jkadlcik/git/mock/mock/py \

Wow, I was never able to run Mock like that, I always do tito build --test --rpm --install first. Nice.

So I am probably misunderstanding the issue?

I bet this is related to --isolation=simple, i.e. the mock-in-container case. Can you please re-try?
The problem has been triggered by one of these cases:

for isolation in simple nspawn; do
for bootstrap in no-bootstrap-chroot bootstrap-chroot; do

@praiskup
Copy link
Member Author

praiskup commented Aug 1, 2023

You might need to --scrub=all first actually.

@praiskup
Copy link
Member Author

praiskup commented Aug 1, 2023

Ouch, no, this was detected by a different test case, sorry:

# Put the first RPMs into buildroot.
runcmd "$MOCKCMD --rebuild $srpm_version1 --resultdir $REPODIR" \

We can not use user_mountpoints because these aren't (historically, not
sure what are the reasons) mounted too late during the Buildroot
preparation (after the self._init_pkg_management()).  This isn't
actually an issue when 'use_bootstrap_image == False' because we use the
package manager on host (so it actually sees the repository on host).

So newly we place the local_repo mount points into the "managed"
category, which seems even semantically better now.  We though need to
call the 'self.mounts.mountall_managed()' method a little bit later than
before, when the local repo BindMountPoints are already defined by
self.pkg_manager.initialize().

This problem has been triggered by the LVM test-case that creates a
custom local_repo (on host) with `baseurl=/tmp/foo` that needs to be
bind-mounted into the bootstrap chroot properly.

Closes: rpm-software-management#1167
@praiskup
Copy link
Member Author

praiskup commented Aug 1, 2023

I updated the commit message with the info on how this can be triggered.

@praiskup praiskup merged commit 00043b0 into rpm-software-management:main Aug 2, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-blocker This needs to be shipped in the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants