$ sudo losetup -a
/dev/loop0: [65025]:1312560 (/home/ansible/derivative-binary/ae1f3d469da21e5532573f32b0f9415e14d849e8/Whonix-Gateway-XFCE-ae1f3d469da21e5532573f32b0f9415e14d849e8.Intel_AMD64.raw (deleted))
running sudo losetup -D does not detach it, but when I reboot the machine, sudo losetup -a shows nothing (so restarting does in fact kill the losetup, but only after the force umount)
I am not sure how all this stuff works. I love linux, but really feelin like a dumb webdev right now
Could either be the same issue here or something similar. Whatever that might beā¦
Can we automate rebooting the server? I am asking, because Iād like to iterate faster here.
If I detect a stale mount and folder /home/ansible exists can I tell the build script just the reboot the server? Then I could do more builds in quick succession.
I would also temporarily change the build script to a simpler state that does not create a full build but just to quickly debug the mount issue.
Okay so now CI always reboot the VPS before running the derivative-maker build step. This should fix the issue with sudo losetup --all having a lingering loopback
I think mount steps above can fix the issue with the mounted volume, if necessary.
If the build script and/or the CI scripts check for stray mounts, I guess is best if you decide.
The build script will check for stray mounts anyhow because non-CI builds should get a build error early when there is a stray mount. That test can stay independent from any potential test by the CI scripts.
Usually a CI sets environment variable CI=true. And depending on that, the build script could perform some action it does not do outside of CI.
But if the build script is a clean place to say āplease reboot the CIā that is highly questionable. Could be a rather unclean hack.
I guess -l, ālazy wonāt help much here. The mount is probably staying forever until reboot.
Sure, if that works.
An additional test that would probably be useful in the CI scripts (similar to the test already in the build script):
losetup_output=$($SUDO_TO_ROOT losetup --all)
if [ "$losetup_output" = "" ]; then
true "INFO: Output of losetup_output is empty. No stray loop devices, OK."
return 0
else
error TODO bail out here and reboot CI server
fi
That is probably ideal and better than what I said above.
Does it work for you if you run that command manually? I mean, the command will exit without error but will the mount point be unmounted indeed? If yes, Iāll happily add it to the build script.
Actually, I might just try that now.
I am very surprised a normal umount doesnāt work but umount with -l / --lazy works. Yeah, then that would mean thereās some sort of bug in umount or some other low level tool or even the kernel.
The help-steps folder however could be the place where we a short or several short scripts which contain the actual build command.
Or better, letās add a ci sub folder in the derivative-maker repository where the small scripts that define the actual clean and build command reside?
Reason: if the mount continues to make issues, I would use simpler build commands to just focus on the mount issue in quicker iteration.
Is there any way to speed up the builds to only run the relevant steps that have been affected in the code changes?
i.e. - Do we need to build ../monero-gui_0.18.1.0-1_all.deb when you only change a few things in the help steps or something?
Would be nice to have a ālightā build or something for iterating more quickly. Currently it takes over 1.5 hours to build fresh workstation and gateway VMs. Iād love it if we could make it where you have the ability to get feedback more quickly
I guess though when troubleshooting you can always just SSH in to the VPS and run the troublesome build step manually and see what is causing the problem. Just a thought though, I want this CI feature to make your life easier
No packages should be built and all packages would be downloaded from the Whonix binary repository. It would skip all the lengthy package creation.
How does that sounds?
How often will we use --remote-derivative-packages true? Maybe for git commits, use it. For git tags, do it āproperā and drop it?
Though, when using --remote-derivative-packages true we would not notice when package builds fail. But that isnāt very likely since if packages are updated, I need to build them locally anyhow.
Absolutely makes sense. In my previous build, a rookie mistake for forgetting $SUDO_TO_ROOT has lead to a failed build. Another 40 minutes to wait for me now until I can see if that is fixed now - unless I do a local build with local hacks which with the CI weāre trying to avoid.
Thatās also why I suggested Derivative Maker Automated CI Builder - #74 by Patrick - because then I would hack the build command to a much simpler various to a point where only a minimal raw image gets created with even nothing useful inside just to test various mount / umount to quickly get that fixed.