Skip to content

add convenience script to start/stop the bot - #392

Merged
trz42 merged 12 commits into
EESSI:developfrom
smoors:bot-script
Sep 6, 2026
Merged

add convenience script to start/stop the bot#392
trz42 merged 12 commits into
EESSI:developfrom
smoors:bot-script

Conversation

@smoors

@smoors smoors commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

made with some AI assistance

@trz42

trz42 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

nice idea. how is it supposed to work? can you add a little documentation (into the script and/or into the README.md)?

@smoors

smoors commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

EDIT: updated README.md and added support for job manager and event handler options.

@smoors
smoors marked this pull request as draft September 3, 2026 12:42
@smoors
smoors marked this pull request as ready for review September 3, 2026 20:52

@trz42 trz42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Added a few comments/suggestions to let it support scenarios where multiple instances would run on the same machine.

Comment thread bot Outdated
Comment thread bot Outdated
Comment thread bot Outdated
Comment thread bot Outdated
Comment thread README.md
Comment thread bot Outdated
@smoors

smoors commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

@trz42 new changes

  • converted the script to python
  • added support for managing multiple instances (also by the same user), by adding a --bot-name option to the job manager and event listener (which doesn't do anything).
  • added --job-manager-opts and --event-handler-opts for more flexibilty

if you're happy with these changes i'll update the README accordingly

@trz42 trz42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

--bot-name is a little tricky (conflicts with a setting for GitLab and could be misunderstood). How about --session?

You didn't want to also start the smee-client via this script? Can be kept external for now, your PR is already an improvement.

@smoors

smoors commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Nice.

--bot-name is a little tricky (conflicts with a setting for GitLab and could be misunderstood). How about --session?

what about --bot-instance or just --instance?

You didn't want to also start the smee-client via this script? Can be kept external for now, your PR is already an improvement.

i'm not sure about the smee client, because i actually don't use smee anymore, and i used to launch the smee client in a container, which is different from the smee.sh script. also, the smee client doesn't need to be restarted that often (at least for me).

so i agree to keep it external for now.

UPDATE

  • i went ahead and changed --bot-name to --instance, but i'll be happy to change if you prefer another name.
  • added single-letter options
  • updated the readme.
  • needed to fix an issue with test_app.cfg, which seems unrelated?

@trz42 trz42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works!

(vbot) [trz42@login1 eessi-bot-software-layer]$ ./bot.py start --instance test-pr-392 --event-handler-opts "--port 34543"
>>> starting job manager for bot instance 'test-pr-392'...
>>> starting event handler for bot instance 'test-pr-392'...
Configuration check: PASSED
Configuration check: PASSED
job manager just started, logging to '/home/trz42/projects/def-users/trz42/gitlab/logs/eessi_bot_job_manager.log', processing job ids ''
EESSI bot for software layer started!
app is listening on port 34543
logging in to /home/trz42/projects/def-users/trz42/gitlab/logs/eessi_bot_event_handler.log
>>> job manager for bot instance 'test-pr-392' is running
>>> event handler for bot instance 'test-pr-392' is running

Going to merge this before someone™️ comes up with more ideas 😁

@trz42
trz42 merged commit 1b9335b into EESSI:develop Sep 6, 2026
7 checks passed
@smoors
smoors deleted the bot-script branch September 6, 2026 15:29
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