nomad
nomad copied to clipboard
Add working directory parameter to exec driver
Fixes #10979
Am I missing something? The executor definitely sets the working directory (see the test), but running a job end-to-end on linux doesn't seem to apply the setting. It's as if it's using the universal executor instead of the libcontainer one.
Sorry for the delay and frustration @wurosh and thanks for the contribution! There's a gRPC layer between the driver and executor which needs the WorkDir plumbed through. To make matters more interesting that layer involves protobufs, so I went ahead and pushed those changes. That appears to get it working with a dev agent and test job!
I think the outstanding items for this to get merged are:
- [ ] Fix tests
- [ ] Add Changelog entry - https://github.com/hashicorp/nomad/blob/main/contributing/CHANGELOG.md
- [ ] Add it to the docs - https://github.com/hashicorp/nomad/blob/main/website/content/docs/drivers/exec.mdx
@schmichael I only have my own stupidity to blame for my frustration. I was spoiled by the ease of writing nomad drivers where the gRPC layer is obscured by interfaces. I'll get on the outstanding items in the next couple of days. Thank you so much for the help!
Ha, don't feel bad. Nothing in our docs or tooling help you with this, and I'm not sure how to fix that. It's a really unfortunate dev story, and a pretty big cautionary tale for the Nomad team as we think about future use cases for gRPC.
@schmichael having this ported to the java driver would also be nice to have