IDR / idr-utils

Utility scripts for managing IDR submissions
BSD 2-Clause "Simplified" License
2 stars 6 forks source link

Stdout not available on stats.py #27

Open pwalczysko opened 3 years ago

pwalczysko commented 3 years ago

See https://github.com/IDR/SubmissionWorkflow/pull/32#issuecomment-698356122 and the follow-up comments and the output below for the bckgr.

Synopsis: If you are not logged in to OMERO and start the stats.py script as per the doc, there will be a wait and no output or warning. The script will not start executing, instead waiting for you to log in, but giving you no indication of that.

[pwalczysko@pilot-idr0072-omeroreadwrite ~]$ /opt/omero/server/venv3/bin/python ~/idr-utils/scripts/stats.py --release prod86 idr0048-abdeladim-chroms -vv >> /tmp/prod86-pw-test.tsv
2020-09-24 14:20:58,264 DEBUG Added file /home/pwalczysko/omero/tmp/.lock_testm_q4hncj.tmp
2020-09-24 14:20:58,264 DEBUG Chose global tmpdir: /home/pwalczysko/omero/tmp
2020-09-24 14:20:58,267 DEBUG Using temp dir: /home/pwalczysko/omero/tmp/omero_pwalczysko/26849
2020-09-24 14:20:59,102 DEBUG Removed /home/pwalczysko/omero/sessions/localhost/demo/02fe74da-ca37-4635-9cf7-d79b1f395e61
2020-09-24 14:20:59,102 DEBUG Removed /home/pwalczysko/omero/sessions/localhost/demo/._LASTSESS_

Long wait

Then, in another terminal, a new ssh and

[pwalczysko@pilot-idr0072-omeroreadwrite ~]$ vi /tmp/prod86-pw-test.tsv

which shows

Previous session expired for demo on localhost:4064
Server: [localhost:4064]
~                                                                               
~                                                                               
~                 

cc @manics @sbesson

manics commented 3 years ago

An easy way around this is to add a --output <filename> or --append <filename> argument to the script instead of relying on stdout.

joshmoore commented 3 years ago

from https://github.com/IDR/SubmissionWorkflow/pull/32#issuecomment-698402503 should https://github.com/ome/omero-py/commit/1657d142d3349f0f7e2d7a107a36373bf76cbe68 not be updated to also check stdout for tty-ness?

>>> import sys
>>> sys.stdout.isatty()
True
>>>
(base) ~ $python -c "import sys; print(sys.stdout.isatty())" | cat
False