lufah - Little Utility for FAH v8

This forum contains information about 3rd party applications which may be of use to those who run the FAH client and one place where you might be able to get help when using one of those apps.

Moderator: Site Moderators

Post Reply
calxalot
Site Moderator
Posts: 1115
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

lufah - Little Utility for FAH v8

Post by calxalot »

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.

Usage

Code: Select all

usage: lufah [-h] [-v] [-d] [--version] <peer> <command> ...

Little Utility for FAH v8

positional arguments:
  <peer>             [host][:port][/group] Use "." for localhost. Peer can be
                     a comma-separated list of hosts for commands units, info,
                     fold, finish, pause: host[:port],host[:port],...
  <command>
    status           show json snapshot of client state
    units            show table of all units by group
    fold
    finish
    pause
    unpause          alias for fold
    config           get or set config values
    groups           show json array of resource group names
    create-group     create group if it does not exist
    info             show peer host and client info
    log              show log; use control-c to exit
    watch            show incoming messages; use control-c to exit
    get              show json value at dot-separated key path in client state
    unlink-account
    link-account     <account-token> [<machine-name>]
    restart-account  restart account/node connection
    wait-until-paused
                     run until all target groups seem paused
    enable-all-gpus  enable all unclaimed gpus in specified group
    start            start local client service; peer must be "."
    stop             stop local client service; peer must be "."

options:
  -h, --help         show this help message and exit
  -v, --verbose
  -d, --debug
  --version          show program's version number and exit

Examples

lufah . units
lufah /rg2 finish
lufah other.local/rg1 status
lufah /mygpu1 config cpus 0
lufah . config -h
lufah host1,host2,host3 units
lufah host1,host2,host3 info

Notes

If not given, the default command is 'units'.

In 8.3, /group config cpus <n> is not limited to unused cpus across groups.

Group names for fah 8.1 must:
  begin "/", have only letters, numbers, period, underscore, hyphen
Group names on 8.3 can have spaces and special chars.
Web Control 8.3 trims leading and trailing white space when creating groups.
Group "/" is taken to mean the default group, which is "".
For a group name actually starting with "/", use prefix "//".

An error may not be shown if the initial connection times out.
If group does not exist on 8.1, this script may hang until silent timeout.
Config priority does not seem to work. Cores are probably setting priority.
Commands start and stop are macOS-only.
Marcos FRM
Posts: 23
Joined: Fri Feb 23, 2024 6:26 pm

Re: lufah - Little Utility for FAH v8

Post by Marcos FRM »

Cannot get/set some configs:

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
User, team, passkey, and cause work.

Code: Select all

$ lufah --version
0.4.3
calxalot
Site Moderator
Posts: 1115
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: lufah - Little Utility for FAH v8

Post by calxalot »

Some config items are only valid for groups on v8.3+

I think everything but user, team, passkey, cause
calxalot
Site Moderator
Posts: 1115
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: lufah - Little Utility for FAH v8

Post by calxalot »

Try

Code: Select all

lufah / config cpus 4
calxalot
Site Moderator
Posts: 1115
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: lufah - Little Utility for FAH v8

Post by calxalot »

I didn’t think it was wise to allow some keys to be set on all groups. Nor to allow some and not others.
calxalot
Site Moderator
Posts: 1115
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: lufah - Little Utility for FAH v8

Post by calxalot »

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.
Marcos FRM
Posts: 23
Joined: Fri Feb 23, 2024 6:26 pm

Re: lufah - Little Utility for FAH v8

Post by Marcos FRM »

Thanks, using "/" works. It would be nice a hint about this in "lufah . config -h" output.
calxalot wrote: Wed Jul 24, 2024 2:14 am If you need to use lufah with v8.4, I can push another release that supports progress and eta.
No hurry.
Marcos FRM
Posts: 23
Joined: Fri Feb 23, 2024 6:26 pm

Re: lufah - Little Utility for FAH v8

Post by Marcos FRM »

Noob question: can I dump a WU?
calxalot
Site Moderator
Posts: 1115
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: lufah - Little Utility for FAH v8

Post by calxalot »

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.
Marcos FRM
Posts: 23
Joined: Fri Feb 23, 2024 6:26 pm

Re: lufah - Little Utility for FAH v8

Post by Marcos FRM »

Perhaps a "dump-all" command.
calxalot
Site Moderator
Posts: 1115
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: lufah - Little Utility for FAH v8

Post by calxalot »

Ok. Sounds dangerous. Maybe make it interactive or require a —force flag.
Marcos FRM
Posts: 23
Joined: Fri Feb 23, 2024 6:26 pm

Re: lufah - Little Utility for FAH v8

Post by Marcos FRM »

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.
calxalot
Site Moderator
Posts: 1115
Joined: Sat Dec 08, 2007 1:33 am
Location: San Francisco, CA
Contact:

Re: lufah - Little Utility for FAH v8

Post by calxalot »

Ok. It will be > 80 columns. I added Core type, which made it 79.
Maybe I should use python os.get_terminal_size()
Post Reply