hashicorp / nomad

Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations.
https://www.nomadproject.io/
Other
14.81k stars 1.94k forks source link

Add the ability to attach to the allocation #19850

Open bra-fsn opened 7 months ago

bra-fsn commented 7 months ago

Proposal

Nomad already implements alloc exec, which can be used for example to enter into the running context (container) and issue commands interactively. This is akin to docker exec, which offers the same feature. It would be great to have the same functionality as docker attach, which enables the user to attach to the running process' stdin/stdout/stderr along with the ability to control it (for example send a CTRL-c to the process).

Use-cases

The same as docker attach, getting the running process's terminal. This feature could be used for running interactive applications inside nomad (either controller by a human or a machine) or to create pipes, for example the following command: cat /data/big_uncompressed_file | nomad alloc attach a2ec5a0a > compressed.zpaq would stream uncompressed data into a Nomad contrainer, run a resource intensive transformer on it and write the result into a local file.

Attempted Solutions

AFAIK no such feature exists currently.

lgfa29 commented 7 months ago

Hi @bra-fsn 👋

Thanks for the suggestion. I've placed in our backlog for further roadmaping.