nomad icon indicating copy to clipboard operation
nomad copied to clipboard

Add working directory parameter to exec driver

Open cyruseuros opened this issue 4 years ago • 6 comments

Fixes #10979

cyruseuros avatar Aug 01 '21 15:08 cyruseuros

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar Aug 01 '21 15:08 hashicorp-cla

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.

cyruseuros avatar Aug 02 '21 10:08 cyruseuros

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 avatar Aug 13 '21 22:08 schmichael

@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!

cyruseuros avatar Aug 15 '21 15:08 cyruseuros

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 avatar Aug 16 '21 18:08 schmichael

@schmichael having this ported to the java driver would also be nice to have

eveld avatar Oct 07 '21 07:10 eveld