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

Use systemd-nspawn --volatile=overlay when not btrfs ? #10

Open
kapouer opened this issue Mar 16, 2022 · 7 comments
Open

Use systemd-nspawn --volatile=overlay when not btrfs ? #10

kapouer opened this issue Mar 16, 2022 · 7 comments

Comments

@kapouer
Copy link
Contributor

kapouer commented Mar 16, 2022

This makes a huge performance gain, however i'm only building small packages with nspawn,
and i wonder if that option would exhaust memory when building a much bigger package.

@spanezz
Copy link
Contributor

spanezz commented Mar 17, 2022

Uh right, this should really be an option, as it makes a lot of sense in a CI. In theory if one is building large packages one can size up swapspace accordingly

@kapouer
Copy link
Contributor Author

kapouer commented Mar 17, 2022

NB:
one must disable f"--overlay={chroot.chroot_dir}:{self.overlay_dir}:/",
or at least adapt it, to gain from using memory.

@kapouer
Copy link
Contributor Author

kapouer commented Mar 23, 2022

NB2:
The combo --volatile=overlay --read-only allows one to set a higher concurrency than 1 on the gitlab-runner:
systemd-nspawn doesn't lock the "image".

@spanezz
Copy link
Contributor

spanezz commented Mar 24, 2022

NB2: The combo --volatile=overlay --read-only allows one to set a higher concurrency than 1 on the gitlab-runner: systemd-nspawn doesn't lock the "image".

That's interesting: systemd-nspawn(1)'s documentation of --read-only says "It is also implied if --volatile= is used", and from that it would look like specifying --read-only would be redundant. You instead observed a change of behaviour compared to just --volatile=overlay?

@kapouer
Copy link
Contributor Author

kapouer commented Mar 24, 2022

If i remember well, without "read-only" the image is locked.

@kapouer
Copy link
Contributor Author

kapouer commented Mar 24, 2022

I'll check again in a few days (i have rebuilds to do soon).

@spanezz
Copy link
Contributor

spanezz commented Mar 25, 2022

I've implemented this, turned off by default for now unless enabled setting RAMDISK = True at the beginning of the script.

I added a comment with details about --read-only, to prevent it becoming potential cargo-culting in the future.

I'll leave the issue open until when you do rebuild and can check on it

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

No branches or pull requests

2 participants