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

progress: set --cache-max-size in osbuild #812

Closed
wants to merge 1 commit into from

Conversation

mvo5
Copy link
Collaborator

@mvo5 mvo5 commented Jan 27, 2025

This commit allows controlling the osbuild --cache-max-size
option. By default it will set the cache to 20GiB but allows
this to be controlled by the user.

Thanks to Simon for raising this.

@mvo5 mvo5 requested review from achilleas-k and supakeen January 27, 2025 17:03
supakeen
supakeen previously approved these changes Jan 28, 2025
Copy link
Member

@supakeen supakeen left a comment

Choose a reason for hiding this comment

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

Happy about this; a quick note on the size. A single Fedora Minimal build takes up about 10 GiB of space so 20 GiB is indeed a decent minimum.

Note also that due to how we setup pipelines right now basically no output gets cached (at least in in the image-builder-case, I didn't verify the bootc-image-builder case yet).

@achilleas-k
Copy link
Member

Without checkpoints, osbuild will only cache sources.

@achilleas-k
Copy link
Member

I didn't verify the bootc-image-builder case yet

_, err := osbuild.RunOSBuild(manifest, store, outputDirectory, exports, nil, extraEnv, false, os.Stderr)

No checkpoints there.

Actually, we never set any checkpoints in osbuild-composer or bootc-image-builder (so far).

@supakeen
Copy link
Member

supakeen commented Jan 29, 2025

I didn't verify the bootc-image-builder case yet

_, err := osbuild.RunOSBuild(manifest, store, outputDirectory, exports, nil, extraEnv, false, os.Stderr)

No checkpoints there.

Actually, we never set any checkpoints in osbuild-composer or bootc-image-builder (so far).

It would be 'OK' to pass --checkpoint="*", something we implemented a while back I think. However; as I've said previously as well with the current way we generate pipelines nothing will actually get cached post the buildroot even when passing checkpoints.

Perhaps it'd be fine to then only pass --checkpoint="buildroot" for things that are generated by images?

@achilleas-k
Copy link
Member

with the current way we generate pipelines nothing will actually get cached post the buildroot even when passing checkpoints.

Why wouldn't they be cached? Do you mean because our build pipeline is dynamic it wont be reused or that it actually wont be cached?

Even with dynamic build packages, there are a lot of cases where a different build wont affect the build packages. Rebuilding the same image type (or a very similar one) with a different blueprint, depending on customizations, might or might not affect build packages. Introducing customizations often adds a package, but changing values might not. Neither does adding a blueprint package.

Going back to a fat build root isn't impossible or out of the question though. The reason we never had checkpoints in osbuild-composer and the service so far was lack of cleanup, which @mvo5 added a while ago.

@supakeen
Copy link
Member

with the current way we generate pipelines nothing will actually get cached post the buildroot even when passing checkpoints.

Why wouldn't they be cached? Do you mean because our build pipeline is dynamic it wont be reused or that it actually wont be cached?

Even with dynamic build packages, there are a lot of cases where a different build wont affect the build packages. Rebuilding the same image type (or a very similar one) with a different blueprint, depending on customizations, might or might not affect build packages. Introducing customizations often adds a package, but changing values might not. Neither does adding a blueprint package.

Going back to a fat build root isn't impossible or out of the question though. The reason we never had checkpoints in osbuild-composer and the service so far was lack of cleanup, which @mvo5 added a while ago.

The build pipeline can be cached as long as it's the same one twice (or multiple can be in the cache). However, the os pipeline contains UUIDs which are different for every build invalidating it, and all pipelines dependent on it.

@achilleas-k
Copy link
Member

The build pipeline can be cached as long as it's the same one twice (or multiple can be in the cache). However, the os pipeline contains UUIDs which are different for every build invalidating it, and all pipelines dependent on it.

aaah of course. Yes, sorry for the nonsense then. I was just focused on the build pipeline.

Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale Issue or PR with no activity for extended period of time label Mar 28, 2025
supakeen
supakeen previously approved these changes Mar 28, 2025
@supakeen supakeen removed the Stale Issue or PR with no activity for extended period of time label Mar 28, 2025
@mvo5 mvo5 marked this pull request as ready for review March 28, 2025 08:34
@supakeen supakeen enabled auto-merge March 28, 2025 08:58
@achilleas-k
Copy link
Member

osbuild [-h] [--cache DIRECTORY] [-l DIRECTORY] [--cache-max-size SIZE]\n               [--checkpoint ID] [--export ID] [--json]\n               [--output-directory DIRECTORY] [--inspect] [--monitor NAME]\n               [--monitor-fd FD] [--stage-timeout STAGE_TIMEOUT] [--version]\n               [--break [DEBUG_BREAK]] [--quiet]\n               MANIFEST\nosbuild: error: the following arguments are required: MANIFEST

This commit allows controlling the `osbuild --cache-max-size`
option. By default it will set the cache to 20GiB but allows
this to be controlled by the user.

Thanks to Simon for raising this.
@supakeen supakeen disabled auto-merge March 31, 2025 19:41
Copy link
Member

@supakeen supakeen left a comment

Choose a reason for hiding this comment

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

I will reapply this PR in image-builder as this PR targets files that have migrated there.

@mvo5
Copy link
Collaborator Author

mvo5 commented Apr 1, 2025

Yeah, lets close it here and reopen in ibcli.

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