Haidra-Org / horde-worker-reGen

The default client software to create images for the AI-Horde
https://aihorde.net/
GNU Affero General Public License v3.0
93 stars 42 forks source link

Use SIGINT to stop the docker container #335

Closed CIB closed 2 weeks ago

CIB commented 3 weeks ago

This should allow the docker stop command to shut down the python process with SIGINT, allowing the process manager to stop the processes gracefully.

$ docker compose -f Dockerfiles/compose.cuda.yaml stop
[+] Stopping 1/1
 ✔ Container reGen  Stopped 
reGen  | 2024-11-01 01:53:44.889 | WARNING  | horde_worker_regen.process_management.process_manager:signal_handler:4162 - Shutting down after current jobs are finished...
reGen  | 2024-11-01 01:53:47.167 | INFO     | [HWRPM]:end_safety_processes:1516 - Ended safety process 0
reGen  | 2024-11-01 01:53:47.369 | INFO     | [HWRPM]:receive_and_handle_process_messages:1579 - Process 0 has ended with message: Process ended
reGen  | 2024-11-01 01:53:47.369 | INFO     | [HWRPM]:_process_control_loop:3793 - Shutting down process manager
reGen exited with code 0
tazlin commented 2 weeks ago

Thanks for the assist!