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

Add a persistent /build_cache directory? #137

Open
EternityForest opened this issue Jul 4, 2021 · 3 comments
Open

Add a persistent /build_cache directory? #137

EternityForest opened this issue Jul 4, 2021 · 3 comments

Comments

@EternityForest
Copy link

Just a minor thing, but it could be a major help in some cases. What if we had a directory in the workspace that was mounted at /build_cache, and persisted between builds?

This would let you download very large files within build scripts without wasting bandwidth.

I can make a PR or work on this myself if there is interest!

@guysoft
Copy link
Owner

guysoft commented Jul 4, 2021

Could be done, the question is what are you trying to use it for?
In a way you already have this with BASE_APT_CACHE https://github.com/guysoft/CustomPiOS/blob/devel/src/modules/base/config#L60

The code for that happens here:
https://github.com/guysoft/CustomPiOS/blob/devel/src/custompios#L115

@EternityForest
Copy link
Author

I'm currently using a forked version with just these lines added, and I use it for a lot of things, like automatically fetching things from git repos, and for downloading the .NET runtimes. It's also useful for compiling things. There's no reason to recompile something when not much has changed, I can just do the whole compile right in the /build_cache.

  mkdir -p $BASE_WORKSPACE/build_cache
  mkdir -p $BASE_MOUNT_PATH/build_cache
  mount --bind $BASE_WORKSPACE/build_cache $BASE_MOUNT_PATH/build_cache

@guysoft
Copy link
Owner

guysoft commented Nov 17, 2021

ZynthianOS have a similar thing, what they do is place under the filesystem module what they have built and then unpack it in to the build.
I can see how a cache could be helpful, but thinking what kind of commands you would want to run in the build could help.
You could have seperate builds steps that use for example custompios_export commands and then move the results in to a filesystem section of a module.
The thing with a cache is that it can change during the build, this way you have definitive steps you could run.

Or you could build a base image, then use CustoPiZer which is what OctoPrint and OctoPi-Klipper do.

I can understand how what you do helps you, and it might be helpful to others and worthwhile to put in, I am just not sure of the structure yet and the solutions above are a more structured way to get stuff in to the image.

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