jrxFive / python-nomad

Client library Hashicorp Nomad
https://python-nomad.readthedocs.io/en/latest/
MIT License
139 stars 73 forks source link

Wrap Nomad API use of character offset for task logs #88

Open ionosphere80 opened 5 years ago

ionosphere80 commented 5 years ago

For reading task logs (e.g., stdout/stderr), the Nomad API endpoint only supports passing an offset in characters instead of lines which makes implementation rather difficult. To ease implementation, the library should probably support returning a generator for iterating through each line in a particular log. The latter might also help enable using the follow option which currently keeps the requests session open and prevents assignment of the output to a variable. Also, attempting to use the follow option with a particularly large log leads to a traceback, likely due to a requests buffer filling up.

SwarnadeepC0 commented 3 years ago

Any workaround for it?