You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
group"work" {
volume"repo_group" {
source="repo_host"type="host"read_only=true
}
task"builder1" {
driver="raw_exec"volume_mount {
# the "volume" would be essentially be the "lowerdir" of the OverlayFS mountvolume="repo_group"type="overlayfs"# proposed# the upper, work and merged directories can be possibly created automatically# "inside" the 'destination' directory.# example: /my_dir/upper, /my_dir/work, /my_dir/mergeddestination="/my_dir"
}
...
With the above setup, the "raw_exec" task can use the "merged" directory (/my_dir/merged) as a COW location to do temporary writes.
Example: The lowerdir (/repo on the host), should eventually get mounted to /my_dir/merged on the host itself.
The use case for the above is as follows:
"/repo" is some large sized source code (gigs) which cannot be easily "cloned" into every build task (it'll take too much time and disk space).
Multiple tasks will be running, which would like to do a git pull before they start building from the source code.
Hence, the directory is mounted and the build tasks can do their own "COW" 'git pull' for latest code, build from there and then the overlayfs mount can be removed.
FWIW, some other job/entity will ensure that "/repo" itself is updated periodically (say, once-a-week) to keep the pulls of each of the task small.
Nomad version
Nomad v0.10.1 (829f9af35c77d564b3dab74454eeba9bf25e2df8)
Operating system and Environment details
CentOS 7/8
Ubuntu 16.04/18.04
Issue
This is a feature request.
Reproduction steps
This is a feature request.
Currently
bind
mounts are supported forexec
, etc.The feature request if for
overlayfs
so that evenraw_exec
can use it.Job file (if appropriate)
The following are the config parameters that I have tried with.
I have made up some fields which could make sense in OverlayFS context.
Ref: https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt for terminology 'lowerdir', 'upperdir', 'workdir', 'merged'.
In the agent config:
in the job definition:
With the above setup, the "raw_exec" task can use the "merged" directory (
/my_dir/merged
) as a COW location to do temporary writes.Example: The lowerdir (
/repo
on the host), should eventually get mounted to/my_dir/merged
on the host itself.The use case for the above is as follows:
"/repo" is some large sized source code (gigs) which cannot be easily "cloned" into every build task (it'll take too much time and disk space).
Multiple tasks will be running, which would like to do a
git pull
before they start building from the source code.Hence, the directory is mounted and the
build
tasks can do their own "COW" 'git pull' for latest code, build from there and then theoverlayfs
mount can be removed.FWIW, some other job/entity will ensure that "/repo" itself is updated periodically (say, once-a-week) to keep the pulls of each of the task small.
Thoughts?
Regards,
Shantanu Gadgil
possibly related:
#1546
#2355
The text was updated successfully, but these errors were encountered: