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

Add support for command line state control #119

Closed
Josh65-2201 opened this issue Feb 19, 2023 · 15 comments
Closed

Add support for command line state control #119

Josh65-2201 opened this issue Feb 19, 2023 · 15 comments
Labels
enhancement New feature or request

Comments

@Josh65-2201
Copy link

Josh65-2201 commented Feb 19, 2023

V7 has support for starting (--send-unpause), pausing (--send-pause) and finishing (--send-finish) via the command line for use in task scheduler. I can't find these for v8

@Josh65-2201 Josh65-2201 changed the title Add supprot for command line control Add support for command line state control Mar 1, 2023
@kbernhagen
Copy link
Contributor

Until the client supports those commands, you might try my script:

lufah - Little Utility for FAH v8

@jcoffland jcoffland added the enhancement New feature or request label Mar 9, 2023
@marcosfrm
Copy link
Contributor

These options are very useful for text only servers. Other possible candidates:

  • Get/set configuration: --send-command 'options cfg1=value1 cfg2=value2' (cfg1 to get, cfg1! to use default value).
  • Queue information: --send-command queue-info.
  • Dump WU. In v7: --send-command 'slot-delete 00' (or 01, etc).

@jcoffland
Copy link
Member

I wonder if a Python interface might be more useful than how this was implemented in v7. A Python script/library could also be run in a continuous mode where it constantly monitored a client. It could also login to your F@H account and give you access to all your machines.

The only downside I see is that Windows users would need to install Python but these days that's pretty easy. Microsoft even offers it in their app store.

@kbernhagen
Copy link
Contributor

kbernhagen commented Feb 9, 2024

There is also no python by default on macOS.

If you try to run python3 the system may offer to install command line developer tools, which includes python3. If one just wants python, they need to download from python.org.

@kbernhagen
Copy link
Contributor

My lufah script is python, runs on all platforms, and is working well for me.

My python skills are admittedly weak. There is no chance of adding node support without a lot of help.

@kbernhagen
Copy link
Contributor

I have not used it, but there is https://pyinstaller.org/

@kmb-abc
Copy link

kmb-abc commented Aug 16, 2024

Any progress on restoring the pause/unpause from previous client versions? I am not exactly thrilled to have my system cranking away during work hours. I loved being able to help by setting up scheduler to run in designated hours. May need to drop my participation if this cannot be restored in timely manner.

@kbernhagen
Copy link
Contributor

As far as I know, the only scheduler for v7, besides roll-your-own, was the Chrome Folding in the dark plugin.

See also
FoldingAtHome/fah-web-client-bastet#53

@kmb-abc
Copy link

kmb-abc commented Aug 16, 2024

Clearly I have not paid attention to my system's F@H efforts. I only recently realized it was not running, so I updated the client. Original setup had systemctl timer services set up as described here: https://www.ctrl.blog/entry/how-to-fahclient-schedule.html#section-linux
I would be nice to restore the command input options this solution was leveraging.

@kbernhagen
Copy link
Contributor

kbernhagen commented Aug 16, 2024

You can use those systemd files now with v8 using my script.
If needed, install pipx.
As the user that will run the service units, pipx install lufah:

pipx install lufah

Modify the systemd files slightly:

ExecStart=/usr/bin/FAHClient --send-pause
Becomes
ExecStart=%h/.local/bin/lufah . pause

ExecStart=/usr/bin/FAHClient --send-unpause
Becomes
ExecStart=%h/.local/bin/lufah . fold

@kbernhagen
Copy link
Contributor

Note that you will not make work unit deadlines if you restrict folding hours too much.

You might prefer to start folding early, then set finish a couple hours later.

@jcoffland
Copy link
Member

v8.4.4 includes a Python script fahctl that can send fold, pause and finish to the v8 client from the command line. Use @kbernhagen's lufah for more control options.

kbernhagen pushed a commit to kbernhagen/fah-client-bastet that referenced this issue Aug 19, 2024
kbernhagen pushed a commit to kbernhagen/fah-client-bastet that referenced this issue Aug 22, 2024
kbernhagen added a commit to kbernhagen/fah-client-bastet that referenced this issue Aug 22, 2024
kbernhagen pushed a commit to kbernhagen/fah-client-bastet that referenced this issue Aug 22, 2024
Revert "Added fahctl command line client control script.  FoldingAtHome#119"

This reverts commit 29042aa.
@jcoffland
Copy link
Member

Implemented in v8.4.4.

@Korb
Copy link

Korb commented Sep 24, 2024

Implemented in v8.4.4.

Where can I read more about how to use the scheduler in Windows to pause and unpause a client at certain times of certain days of the week, on a schedule?

@kbernhagen
Copy link
Contributor

https://learn.microsoft.com/en-us/windows/win32/taskschd/about-the-task-scheduler

To use fahctl, you may need to open a powershell window and install dependencies.

python -m pip install websocket-client

fahctl —help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants