Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/bgunnar5/status-pager #420

Merged
merged 5 commits into from
Aug 23, 2023

Conversation

bgunnar5
Copy link
Member

@bgunnar5 bgunnar5 commented Jun 5, 2023

Losing my mind with celery atm so I took a break and added the status pager functionality for you. This is my first contribution to Maestro so let me know if there's anything else I need to do that I haven't yet.

@FrankD412
Copy link
Member

@bgunnar5 -- Thanks for the contribution! I'll review it this week and get back to you. For now, the changes at a glance seem reasonable, I'd just like to test how this behaves locally. Also, it looks like the doc building step in the testing failed so that needs to pass before we can merge this in.

@FrankD412 FrankD412 self-requested a review June 7, 2023 19:26
@bgunnar5
Copy link
Member Author

bgunnar5 commented Jun 7, 2023

Sounds good.

Regarding the docs test failing, it seems to have an import error with the virtualenv package (which shouldn't be a result of anything I modified):

ImportError

  cannot import name 'Python2Supports' from 'virtualenv.create.describe' (/home/docs/checkouts/readthedocs.org/user_builds/maestrowf/envs/420/lib/python3.10/site-packages/virtualenv/create/describe.py)

  at ~/checkouts/readthedocs.org/user_builds/maestrowf/envs/420/lib/python3.10/site-packages/virtualenv/create/via_global_ref/builtin/python2/python2.py:6 in <module>
        2│ import json
        3│ import os
        4│ from pathlib import Path
        5│ 
    →   6│ from virtualenv.create.describe import Python2Supports
        7│ from virtualenv.create.via_global_ref.builtin.ref import PathRefToDest
        8│ from virtualenv.info import IS_ZIPAPP
        9│ from virtualenv.util.zipapp import read as read_from_zipapp
       10│

@jwhite242 I think this is the same error that Lina is getting in the weave_ci pipeline when she's trying to build the docs. Any idea how to resolve this?

@jwhite242
Copy link
Collaborator

Maybe.. so the error she had was a different import error, and this one it's not clear what's causing it as the import error message gets injected randomly in poetry's stdout. I was able to get around it by pinning poetry to 1.4.2 for now, which the readthedocs build doesn't do (1.5.x fails for me with the same error). So try changing this line to pin poetry to that version:

- pip install poetry>=1.2

@jwhite242
Copy link
Collaborator

One question on the pager/theme issues you'd found: is there an exception that gets thrown, or is it just a terminal emulator error that we can't do anything about in here? Meaning, there's no sort of try/except block we can do to auto-rollback the use styles flag in the pager here?

@bgunnar5
Copy link
Member Author

bgunnar5 commented Jun 7, 2023

I haven't seen any errors thrown when using pager and theme together. If the pager doesn't accept customization it'll just display something like this in the terminal window:
image

I don't believe there's a way to try/except catch this. I did add a message in the maestro status --help page for the --disable-theme description talking about how setting MANPAGER or PAGER to be "less -r" may be the fix for this. Maybe I could add a little printed message to be displayed on each status run that says this instead so users don't have to go searching for it?

@bgunnar5
Copy link
Member Author

bgunnar5 commented Jun 7, 2023

this specific issue is weird @doutriaux1 because if you don't use the pager functionality then the ANSI colors work just fine, so I'm not quite sure if this relates to stdout/stderr or if this is something different entirely

@jwhite242
Copy link
Collaborator

jwhite242 commented Jun 12, 2023

I haven't seen any errors thrown when using pager and theme together. If the pager doesn't accept customization it'll just display something like this in the terminal window: image

I don't believe there's a way to try/except catch this. I did add a message in the maestro status --help page for the --disable-theme description talking about how setting MANPAGER or PAGER to be "less -r" may be the fix for this. Maybe I could add a little printed message to be displayed on each status run that says this instead so users don't have to go searching for it?

Ok, thanks for checking on the error source. Just want to make sure we catch things when we can to give better error messaging to the users

@jwhite242
Copy link
Collaborator

So I think the only thing really missing now is adding these options to the docs. The cli args for sure need to get put in here: https://github.com/LLNL/maestrowf/blob/f5fcad59a697a389359b00c8faf1576050924404/docs/Maestro/cli.md?plain=1

But maybe also one of the admonitions (https://squidfunk.github.io/mkdocs-material/reference/admonitions/) would be good in the montoring section of the user guide (https://github.com/LLNL/maestrowf/blob/f5fcad59a697a389359b00c8faf1576050924404/docs/Maestro/monitoring.md?plain=1) to mention what to do if things look garbled. Not sure which one's most appropriate here, Tip, Note, Info,... or maybe even Warning?

@bgunnar5
Copy link
Member Author

Good call, can't believe I forgot docs! I added a note admonition in the monitoring section and two sections for the theme and pager additions that you should easily be able to expand on in the future if you'd like.

@FrankD412
Copy link
Member

@jwhite242 @bgunnar5 -- sorry for my silence here, been focused elsewhere. I have time off this weekend starting today and plan to catch up here. Looks like @jwhite242 has it in hand though 😄

@bgunnar5
Copy link
Member Author

No worries! Jeremy and I were discussing these changes a bit before I even made this branch so he's pretty up-to-date on everything I've been doing here 😄

@jwhite242
Copy link
Collaborator

So, just two minor comments/changes and then think we can get this in:

can you add a short mention that this is usually tied to the 'less' command which also enables some extra help/navigation/etc options; don't need to enumerate them I think, as telling users what command is running and that they are there gives them the info to find all this out from the authoritative source.

also, after merging in develop, can you tick the dev version too? should be on 1.1.10dev3 with this one (apologies for the manual bits here; working on some better ci based management for this to make it easier and more robust).

and thanks again for contributing this! this is going to be great for large studies!

@jwhite242 jwhite242 merged commit 3283b01 into LLNL:develop Aug 23, 2023
jwhite242 added a commit that referenced this pull request Dec 12, 2023
1.1.10 Release (#432)

* Sync up read the docs config with dev environments using poetry (#399)
* Print usage on command line when no args are provided (#404)
* Add sacct fallback to slurm adapter to improve robustness of job tracking (#405)
* Update Flurm Job State mappings for flux versions >= 0.26 (#407)
* Bump certifi from 2021.10.8 to 2022.12.7 to address security issue (#409)
* Bump cryptography from 37.0.1 to 38.0.3 to address security issue (#410)
* Add missing shbang in unscheduled scripts from lsf adapter (#411)
* Update poetry lockfile to address dependabot flagged security issues (#412)
* Fix for Dockerfile smell DL3006 (#418)
* Port Maestro documentation to mkdocs and expand coverage of features and tutorials (#403)
* Update version info to be driven from pyproject.toml exclusively, and hook up to command line (#419)
* Pin mermaid to < 10.x due to api change (#422)
* Bump lock file certifi from 2022.12.7 to 2023.7.22 to address security issue (#426)
* Refactor flux adapter to avoid using pickle to talk to flux brokers installed in external environments (#415)
   Also adds flux integration tests to exercise against real flux brokers
* Add pager functionality to status command (#420)
* Patch broken flux job cancellation (#428)
* Insulate slurm adapters from user customization of squeue and sacct output formats (#431)
   Also adds live unit and integration tests for slurm adapter

---------

Co-authored-by: Francesco Di Natale <frank.dinatale1988@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bruno P. Kinoshita <kinow@users.noreply.github.com>
Co-authored-by: Charles Doutriaux <doutriaux1@llnl.gov>
Co-authored-by: Giovanni Rosa <grosa23@yahoo.com>
Co-authored-by: Brian Gunnarson <49216024+bgunnar5@users.noreply.github.com>
jwhite242 added a commit that referenced this pull request Feb 6, 2024
1.1.10 Release (#432)

* Sync up read the docs config with dev environments using poetry (#399)
* Print usage on command line when no args are provided (#404)
* Add sacct fallback to slurm adapter to improve robustness of job tracking (#405)
* Update Flurm Job State mappings for flux versions >= 0.26 (#407)
* Bump certifi from 2021.10.8 to 2022.12.7 to address security issue (#409)
* Bump cryptography from 37.0.1 to 38.0.3 to address security issue (#410)
* Add missing shbang in unscheduled scripts from lsf adapter (#411)
* Update poetry lockfile to address dependabot flagged security issues (#412)
* Fix for Dockerfile smell DL3006 (#418)
* Port Maestro documentation to mkdocs and expand coverage of features and tutorials (#403)
* Update version info to be driven from pyproject.toml exclusively, and hook up to command line (#419)
* Pin mermaid to < 10.x due to api change (#422)
* Bump lock file certifi from 2022.12.7 to 2023.7.22 to address security issue (#426)
* Refactor flux adapter to avoid using pickle to talk to flux brokers installed in external environments (#415)
   Also adds flux integration tests to exercise against real flux brokers
* Add pager functionality to status command (#420)
* Patch broken flux job cancellation (#428)
* Insulate slurm adapters from user customization of squeue and sacct output formats (#431)
   Also adds live unit and integration tests for slurm adapter

---------

Co-authored-by: Francesco Di Natale <frank.dinatale1988@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bruno P. Kinoshita <kinow@users.noreply.github.com>
Co-authored-by: Charles Doutriaux <doutriaux1@llnl.gov>
Co-authored-by: Giovanni Rosa <grosa23@yahoo.com>
Co-authored-by: Brian Gunnarson <49216024+bgunnar5@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants