Skip to content

payu support command to print modules and machine info.#710

Open
Qian-HuiChen wants to merge 1 commit intopayu-org:masterfrom
ACCESS-NRI:payu-support-info
Open

payu support command to print modules and machine info.#710
Qian-HuiChen wants to merge 1 commit intopayu-org:masterfrom
ACCESS-NRI:payu-support-info

Conversation

@Qian-HuiChen
Copy link
Copy Markdown
Collaborator

Thanks to @CodeGat 's suggestion!

This PR creates a payu support command which prints out some system information for troubleshooting and support requests.

Example of usage:

$USER@gadi $ payu support
========================================
  Payu Version:      1.2.1+101.gd97ecfa.dirty
  Payu Path:         /scratch/$PROJECT/$USER/payu-training-venv/bin
  Python Version:    3.11.13
  Python Path:       /scratch/$PROJECT/$USER/payu-training-venv/bin/python3
  LOADEDMODULES:     pbs
  Machine Info:      Linux gadi-login-05.gadi.nci.org.au xxxxx.el8.nci.x86_64 x86_64 GNU/Linux
========================================

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 94.11765% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.88%. Comparing base (d97ecfa) to head (2de940f).

Files with missing lines Patch % Lines
payu/subcommands/support_cmd.py 94.11% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #710      +/-   ##
==========================================
+ Coverage   63.70%   63.88%   +0.18%     
==========================================
  Files          67       68       +1     
  Lines        5554     5588      +34     
==========================================
+ Hits         3538     3570      +32     
- Misses       2016     2018       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aidanheerdegen
Copy link
Copy Markdown
Collaborator

I know I was the one who suggested uname, but there is a nice builtin python package for querying this information and more

https://docs.python.org/3.14/library/platform.html

Rather than suggest specific changes I thought I'd just point to it and let you have a look and decide if you wanted to use that to replace some of the code.

@Qian-HuiChen
Copy link
Copy Markdown
Collaborator Author

I know I was the one who suggested uname, but there is a nice builtin python package for querying this information and more

https://docs.python.org/3.14/library/platform.html

I can definitely do that. I was exploring the platform package this morning and used it to mimic the spack debug report.
I was not sure which is the best way to use. Platform package returns a more readable format. I initially thought it was my problem that the uname output looks like alien language 😂

@aidanheerdegen
Copy link
Copy Markdown
Collaborator

I was not sure which is the best way to use. Platform package returns a more readable format.

It is more standard, so it insulates the code from underlying changes in operating system implementation. So from that point alone it is probably worth doing. Plus it has nice functions to return python versions which doesn't require logic to parse and split.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants