semaphoreui / semaphore

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

Offline runners are not removed but are selected for task execution #1796

Open enpaul opened 8 months ago

enpaul commented 8 months ago

Last week I started the process of migrating my Semaphore instance to using remote runners. In the process of testing, I spun up a few temporary runners using Docker and didn't bother setting up a persistent storage volume for them. After doing this a few times I could no longer launch a task, as every task would hang indefinitely on "starting..." while waiting to be assigned to a runner. A quick investigation of the database showed that all the runners I launched and exited were still registered with Semaphore and presumably still being assigned tasks. I was able to resolve this by connecting to the database and manually deleting the runner registrations for the now-deactivated runners.

I know runners are still fairly new to the ecosystem, but I wanted to raise this as both an operational and administration issue.

Some potential solutions I thought of quick:

This is an amazing project and I'm really excited to work with it more!

fiftin commented 8 months ago

Hi @enpaul

When designing, I had a different concept in mind than that of GitLab.

Offline runner in ok. Because it can be started by demand. We have webhooks for this.

So. When user starts a task, Semaphore find suitable runner and call webhook if it is provided. Currently result of webhook not handled, but I think we should handle it.

Yes, we can add logic: if webhook not provided we shouldn't use offline runner. I think it is right way.

bernd-mueller-el commented 1 month ago

Hello, I get the same at my test environment. Is there a plan when this will be implemented? I can see here Milestone with 2.9, is this the version of semaphoreUI? I ask because my semaphore container for server and runner shows me 2.10. Kind Regards