Hi, we are setting up a new yocto build with drone, and experimenting with the exec runner. Since the workspace is 20-30GB, and is largely re-used, we would like to keep the same working dir for subsequent builds. Is this possible?
Thanks!
Hi, we are setting up a new yocto build with drone, and experimenting with the exec runner. Since the workspace is 20-30GB, and is largely re-used, we would like to keep the same working dir for subsequent builds. Is this possible?
Thanks!
Our first thought is:
It seems this essentially what the drone runner would have to do anyway.
It is not possible to keep the same workspace between executions. But you could disable clone and change your working directory, as you mentioned.
clone:
disable: true
steps:
- name: clone
commands:
- cd /some/other/path
- git pull ...
A shared workspace is not something we designed for, and it would be problematic if two pipelines tried to use the same workspace at the same time. For this reason, stateful workspaces are considered out of scope for this runner.
With that being said, the idea behind custom runners is that anyone in the community can create their own Drone runner. So writing your own custom runner is always an option if existing runners are not a good fit for your project. We would also consider paid development to create a custom runner.
@bradrydzewski thanks for your reply, /tmp usually is not that large as its mounted as tmpfs, so this will limit the space available in general. so IMO offering a top level mount would be a good thing
We could make the base directory configurable. For example, the ability to override and change from /tmp/drone-${TEMP}
to /some/custom/dir/drone-${TEMP}
. The workspace would still be ephemeral, however.
Yes I think that must be fine
I think you can pass TMPDIR=/some/other/dir
to the runner using the environment configuration file. This will override where Go creates the default temporary directory, at least according to the docs. This may not require any coding change on our end.
@bradrydzewski I set
TMPDIR=/scratch
in
/etc/sysconfig/drone-runner-exec
and then restart systemd service
systemctl restart drone-runner-exec.service
and it works beautifully