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

Allow to bind tmpfs to a custom path bound to each run #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kit-ty-kate
Copy link
Contributor

Implement the new (tmpfs ...) option suggested in ocaml/opam#4586 (comment)

Copy link
Contributor

@talex5 talex5 left a comment

Choose a reason for hiding this comment

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

Looks good. I suggest extending the Dockerfile unit-test to check the output, however:

https://github.com/ocurrent/obuilder/blob/master/test/test.ml#L462

Fmt.pf f "--mount=type=tmpfs,target=%s" target

let pp_run ~ctx f { Spec.cache; shell; network = _; tmpfs } =
Fmt.pf f "RUN %a%a%a" Fmt.(list (pp_cache ~ctx ++ const string " ")) cache (Fmt.list pp_tmpfs) tmpfs pp_wrap shell
Copy link
Contributor

@talex5 talex5 Mar 8, 2021

Choose a reason for hiding this comment

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

Not convinced the spacing is correct here. Probably worth updating the unit-tests to check this.

@kit-ty-kate
Copy link
Contributor Author

leaving aside the issues in the docker part, I'm experiencing some issues with the base idea.

On ppc64, linux by default [1][2] has a PAGESIZE of 64k (:scream:), which means that to untar the opam-repository archive (which contains ~42500 files) it will take at least 2.5Go. That multiplied by the capacity on pisto for example and we're already in OOM-kill territory 😞

PAGESIZE=64k is only a default, so in theory if we're compiling our own kernel it could be done but at this point maybe it's not worth it. I'm not sure if there is any workaround, I couldn't find any but maybe somebody else has an idea. Maybe simply reducing the capacity from 80 by half and reducing the size allocated for tmpfs to 4Go so that there is still some ram left for the actual programs and some cache.

[1] https://github.com/torvalds/linux/blob/master/arch/powerpc/configs/ppc64_defconfig#L54
[2] https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal/tree/debian.master/config/config.common.ubuntu#n7458

@avsm
Copy link
Member

avsm commented Mar 17, 2021

Dropping to a 4k page size on the ppc64 worker's shouldnt be a problem

@kit-ty-kate
Copy link
Contributor Author

Dropping to a 4k page size on the ppc64 worker's shouldnt be a problem

It still requires us to build our own kernel. Is that something that we want?
We'll probably end up using https://wiki.ubuntu.com/Kernel/MainlineBuilds at some point to fix #47 but they provide easy to use deb files. I could poke around to see what they use and how to package things properly using a custom build if you want.

@MisterDA MisterDA force-pushed the master branch 2 times, most recently from 89e84ac to ccd3f2f Compare February 3, 2023 12:39
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.

3 participants