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

Supporting bind mounts in exec driver? #2115

Closed
ndriessen opened this issue Dec 15, 2016 · 7 comments
Closed

Supporting bind mounts in exec driver? #2115

ndriessen opened this issue Dec 15, 2016 · 7 comments

Comments

@ndriessen
Copy link

ndriessen commented Dec 15, 2016

Hi,
I am deploying a webserver as a service job using the exec driver with nomad. The idea is that all artifacts for other jobs are served by this web server.

However, at this moment it is impossible to use a folder / mount on the host that is mapped into the chroot and is being synchronized in 2 ways
e.g: if uploading a file to the webserver, it will write in the the chrooted folder from the host and changes are not reflected back to the original location on the host.
A simple solution would be to bind mount the folder after the new root has been created, but the exec driver doesn't allow to customize how the isolation happens in any way.

It would be great if the client configuration options could for example support something along these lines:
client { options { exec_bind_mounts { "/var/www" = "/var/www/" } } }

This would result in the driver doing a
mount --bind /var/www /var/lib/nomad/alloc/2919d1c7-d10e-0ff4-e7ab-6767133045c9/fileserve/var/www before starting the actual command specified by the job.

The host system could then use any available tech to sync the host folder across nodes. This would allow an easy way for persistent storage for the exec driver I believe without introduces complexity in the driver.

@c4milo
Copy link
Contributor

c4milo commented Jan 10, 2017

I hope this can be addressed as part of the generic support for volumes instead. I would like to be able to also mount cephfs volumes in addition to host's volumes.

@ashald
Copy link

ashald commented Feb 9, 2017

We actually facing the same situations: we need to mount some locations from host OS inside chrooted environment (rather than copy them) such as network mounts, external storage (PanFs) and just some dir that should we shared across allocations. Without this feature we just cannot run part of our applications. :(

@ashald
Copy link

ashald commented Feb 17, 2017

@ndriessen @c4milo I submitted a PR with this feature implemented - #2333. If you would like to give it a try I can upload a build for you.

@nicolai86
Copy link

Is there any information where this is on the roadmap?

@jorisdevrede
Copy link

What are the plans for supporting bind mounts in the exec (and java) driver? It appears that much of the preparations for this functionality are already in place. @dadgar can you shed some light on this?

@endocrimes
Copy link
Contributor

Hey folks,
We're now planning on introducing support for host bind mounts across various task drivers and plugins via #5377. Please follow along there for updates 😄.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants