semaphoreui / semaphore

Modern UI for Ansible, Terraform, OpenTofu, PowerShell and other DevOps tools.
https://semaphoreui.com
MIT License
10.39k stars 1.05k forks source link

Only one runner is getting tasks, other runners won't get any #1879

Open plaurent-dev opened 6 months ago

plaurent-dev commented 6 months ago

Hi There, On ubuntu 22.04, Semaphore v2.9.58 running as a service, installed from deb package. Actually i've got one server and one runner, working properly. I've tried to prepare another runner to be added (pltest03) but as far as i see, it won't get any task.

On pltest03, Config. json

{
"runner": {
  "registration_token": "token",
  "config_file": "/home/myfolder/semaphore/runner/runner.config_file",
  "api_url": "http://serverip:3000/api",
  "max_parallel_tasks": 10
  }
 }

after starting service, journalctl -f is giving me.

Mar 28 13:28:32 pltest03 semaphore[1553]: Loading config
Mar 28 13:28:32 pltest03 semaphore[1553]: Validating config
Mar 28 13:28:32 pltest03 semaphore[1553]: time="2024-03-28T13:28:32Z" level=info msg="Trying to register on server"
Mar 28 13:28:32 pltest03 semaphore[1553]: time="2024-03-28T13:28:32Z" level=info msg="Runner registered on server"
Mar 28 13:28:32 pltest03 systemd[1]: semaphore.service: Consumed 4.506s CPU time.
Mar 28 13:28:32 pltest03 systemd[1]: Started Semaphore Ansible.

I can find the runner.config_file containing the following : {"runner_id":6,"token":"mzZie/73pzfP1nuBndqlqALo5krFQg/u/4QcEb0kKS4="}

What i did : Reinstall the whole without any success. (initially had the most recent version, switched to v2.9.58)

Any hints ?

Regards,

plaurent-dev commented 6 months ago

Hi there, I've just upgraded to version 2.9.68~beta but still the same. I thought my pltest03 pc was faulty for some reasons and tried to create another brand new one, pltest04. Still the same. Is there anything i'm doing wrong ?

To test this out, i am using demo project, running every minute through cron job.

I can't figure out how to make multiple runners to work with the server.

config.json file is the same as the first (and only one) working runner and it seems the runner.config_file is well created.

 semaphore runner start --config ./config.json
Loading config
Validating config
INFO[0000] Attempting to register on the server
INFO[0000] Registering a new runner
INFO[0000] The runner has been started

{"runner_id":4,"token":"fILJZ/SIEoZQ7MNYrWw4rBzRkbfTBKnfoSRnjOup2R4="}

ifooth commented 2 months ago

same +1 with version 2.10.22-e44910d-1721658299

elliotnev27 commented 2 months ago

Try lowering your max_parallel_tasks to 1 in your runner's config.

In my testing, Sempahore won't start using additional runners until the previous runner is already maxed out.