runabol / tork

A distributed workflow engine
https://tork.run
MIT License
599 stars 40 forks source link

Fix: respect the image default workdir #245

Closed runabol closed 1 year ago

jspc commented 7 months ago

Hey @runabol , do you remember what the context was for this change? I'm working on a middleware that persists a mount across every task in a job, and I want to be able to set the workdir per task to this mountpoint.

I'm more than happy to submit a PR to add what I'm after, but want to make sure there's not a footgun waiting for me, or even that the change would be accepted!

runabol commented 7 months ago

@jspc The intention here was to respect the default image workdir since the container CMD might depend on that if using relative path for example.

But if the task specifies a files property then I override the default to a custom workdir.

For your use case, there is already supports for bind type mounts: https://github.com/runabol/tork/blob/main/runtime/docker/bind.go

I wonder if this would solve your problem.

jspc commented 7 months ago

So I'm already using that, but I want to avoid starting the run in every task with the line cd /blah.

I'll move this to an issue to talk through design, but I'll hopefully have a PR for this today