lufah - Little Utility for FAH v8
Moderator: Site Moderators
-
- Site Moderator
- Posts: 1506
- Joined: Sat Dec 08, 2007 1:33 am
- Location: San Francisco, CA
- Contact:
lufah - Little Utility for FAH v8
https://github.com/kbernhagen/lufah
This is a python command line utility script that should
work on macOS, Linux, and Windows.
Requirements
- python 3.8+
Install
- pip3 install lufah
There are so many ways to install python, that I will not attempt to tell how.
Please use Google or your favorite search engine.
This is a python command line utility script that should
work on macOS, Linux, and Windows.
Requirements
- python 3.8+
Install
- pip3 install lufah
There are so many ways to install python, that I will not attempt to tell how.
Please use Google or your favorite search engine.
-
- Posts: 33
- Joined: Fri Feb 23, 2024 6:26 pm
Re: lufah - Little Utility for FAH v8
Cannot get/set some configs:
User, team, passkey, and cause work.
Code: Select all
$ lufah . info
Host: alma
Client: 8.4.2
OS: linux 4.18
CPU: 4 cores, amd64, "Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz"
$ lufah . config on-idle
null
$ lufah . config keep-awake
null
$ lufah . config cpus
null
$ lufah . config cpus 4
ERROR: cannot set "cpus" on group None
Code: Select all
$ lufah --version
0.4.3
-
- Site Moderator
- Posts: 1506
- Joined: Sat Dec 08, 2007 1:33 am
- Location: San Francisco, CA
- Contact:
Re: lufah - Little Utility for FAH v8
Some config items are only valid for groups on v8.3+
I think everything but user, team, passkey, cause
I think everything but user, team, passkey, cause
-
- Site Moderator
- Posts: 1506
- Joined: Sat Dec 08, 2007 1:33 am
- Location: San Francisco, CA
- Contact:
Re: lufah - Little Utility for FAH v8
Try
Code: Select all
lufah / config cpus 4
-
- Site Moderator
- Posts: 1506
- Joined: Sat Dec 08, 2007 1:33 am
- Location: San Francisco, CA
- Contact:
Re: lufah - Little Utility for FAH v8
I didn’t think it was wise to allow some keys to be set on all groups. Nor to allow some and not others.
-
- Site Moderator
- Posts: 1506
- Joined: Sat Dec 08, 2007 1:33 am
- Location: San Francisco, CA
- Contact:
Re: lufah - Little Utility for FAH v8
If you need to use lufah with v8.4, I can push another release that supports progress and eta. Only matters for the units command.
-
- Posts: 33
- Joined: Fri Feb 23, 2024 6:26 pm
-
- Posts: 33
- Joined: Fri Feb 23, 2024 6:26 pm
Re: lufah - Little Utility for FAH v8
Noob question: can I dump a WU?
-
- Site Moderator
- Posts: 1506
- Joined: Sat Dec 08, 2007 1:33 am
- Location: San Francisco, CA
- Contact:
Re: lufah - Little Utility for FAH v8
No, because the api requires the uuid of the unit. I was lazy and didn’t think making folks type the uuid was cool.
Suggestions are welcome.
Suggestions are welcome.
-
- Posts: 33
- Joined: Fri Feb 23, 2024 6:26 pm
Re: lufah - Little Utility for FAH v8
Perhaps a "dump-all" command.
-
- Site Moderator
- Posts: 1506
- Joined: Sat Dec 08, 2007 1:33 am
- Location: San Francisco, CA
- Contact:
Re: lufah - Little Utility for FAH v8
Ok. Sounds dangerous. Maybe make it interactive or require a —force flag.
-
- Posts: 33
- Joined: Fri Feb 23, 2024 6:26 pm
Re: lufah - Little Utility for FAH v8
It would be helpful to have 'timeout' and 'deadline' information in the output of the 'units' command. Or only 'deadline', to know when the WU will be automatically dumped if not completed in time.
-
- Site Moderator
- Posts: 1506
- Joined: Sat Dec 08, 2007 1:33 am
- Location: San Francisco, CA
- Contact:
Re: lufah - Little Utility for FAH v8
Ok. It will be > 80 columns. I added Core type, which made it 79.
Maybe I should use python os.get_terminal_size()
Maybe I should use python os.get_terminal_size()
Re: lufah - Little Utility for FAH v8
It would be nice if it could display the total estimated PPD for a group. I didn't test this in many configurations and I'm not the best Python programmer but this patch works for me:
Code: Select all
diff --git a/src/lufah/commands/core/units.py b/src/lufah/commands/core/units.py
index 6de1415..a01743f 100644
--- a/src/lufah/commands/core/units.py
+++ b/src/lufah/commands/core/units.py
@@ -210,8 +210,15 @@ def units_table_lines(clients: list[FahClient]) -> list[str]:
else:
for group in groups:
name_group = f"{name}/{group}"
- lines.append(f"{name_group:<25} " + _group_status(client, group))
units = units_for_group(client, group)
+ status = _group_status(client, group)
+ if units:
+ ppd_total = 0
+ for unit in units:
+ ppd_total += unit.get("ppd", 0)
+ else:
+ ppd_total = ""
+ lines.append(f"{name_group:<25} " + f"{status:<26}" + f"{ppd_total}")
if not units:
continue
for unit in units:
-
- Site Moderator
- Posts: 1506
- Joined: Sat Dec 08, 2007 1:33 am
- Location: San Francisco, CA
- Contact:
Re: lufah - Little Utility for FAH v8
Sure.
My groups have one or zero units.
Would you only want a total when >1 unit in a group?
Would it be interesting to have an all groups total when there are multiple units?
My groups have one or zero units.
Would you only want a total when >1 unit in a group?
Would it be interesting to have an all groups total when there are multiple units?