tradingstrategy-ai / tqdm-loggable

Logging friendly progress messages for TQDM progress bars
21 stars 3 forks source link

Fix datalore support #7

Open nzjrs opened 3 months ago

nzjrs commented 3 months ago

Filing this here largely for the Google, but the following strategy no longer works in my datalore instance

https://github.com/tradingstrategy-ai/tqdm-loggable/commit/f2ba8cd8a10cce0ba383e08bd16310aff8eed624#diff-8f6245b26419d140403423b91b1c396467c83a3db96945b89266689983f9be18

as AGENT_MANAGER_HOST now returns an IP address for me.

The list of current environment variables that mention datalore in their key or value, and so could be used to replace the above, are:

('DATALORE_AGENT_MODE', 'CONTAINER'), ('DATALORE_USER', 'datalore'), ('DATALORE_HOME', '/opt/datalore')
nzjrs commented 3 months ago

And rich.progress uses this trick https://github.com/Textualize/rich/blob/0d7e598fe7ead1cca6b590c1de7f54ba19255d11/rich/console.py#L529