-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
Supporting for docker tmpfs volume mounts in steps #3621
base: main
Are you sure you want to change the base?
Conversation
0d7fb00
to
25c9f6d
Compare
Could you provide some details what you are trying to achieve by using a tmpfs, so we can maybe help you implementing it? |
Using docker's This allows for all actions within Downside: no state persistence between containers in a pipelines. I.e. cloning must be disabled and everything must happen in one step. I want to add a boolean flag (currently named While there is already an undocumented |
Wouldn't it be possible to pass a tmpfs volume across all steps of a workflow? We could maybe add it as option to https://woodpecker-ci.org/docs/next/usage/workflow-syntax#workspace. |
Of course but this wouldn't help/solve the case I am describing. These mounts would live outside of The additional issue is that you don't always want this. I.e. it only really helps for instances with a lot of RAM and you can use that RAM instead of a physical disk. On small VMs/homelabs with like 4 GB of RAM, you don't wanna use this as otherwise it will stall the host completely. And setting a sensible default there is not so easy (by default all available memory is provided for the mount). So to me it makes most sense to have both options as "enabled on request" including a size limitation of how much RAM should be used for the mount. And maybe even a top-level env var which allows to prevent these kind of mounts on the admin side. And "proper" documentation on how and when to use this option. Usage Example: https://vladmihalcea.com/how-to-run-integration-tests-at-warp-speed-with-docker-and-tmpfs/ Quote from the docker ref:
|
Sure, I was talking about the workspace as well. I basically wanted to suggest to allow a user to use a tmpfs for the workspace:
tmpfs: true |
Regarding the permission part, we could automatically add a label |
That is the exact purpose of this PR 😄️ How the step setting should be named then and structured is TBD. I already tested it in a previous version (not in this PR) by hardcoding the TMPFS creation. Worked fine.
That might be one option but I guess you need a config setting on the admin side to allow/disallow this for pipelines in general. And/or to limit the size of the tmpfs mount. A label can surely also be added but I think there's no way around global options which apply to all agents, so that this feature doesn't require a dedicated agent necessarily. |
fix #862