semaphoreui / semaphore

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

Runner question #1519

Open OliPou opened 1 year ago

OliPou commented 1 year ago

Hi team,

I'm using this amazing tools for several month an I'm still amaze by the activity on this project. Thanks for your work 👍 ! To day I would like to have precision on the runner feature.

In the documentation https://docs.ansible-semaphore.com/administration-guide/runners it says :

How does it work do you have tags or label system like in gitlab ?

Regards,

fiftin commented 1 year ago

Hi @OliPou

Thank you ;)

Currently you can switch semaphore to "runner mode" and Semaphore will send all tasks to runners instead on running tasks locally. You can have multiple runners and Semaphore will distribute tasks between them randomly.

Currently that's all.

What planned:

Semaphore doesn't have Pipeline like a code, so we can't implement tags or label system like in gitlab. But we can give ability to choose runner from UI.

mhzawadi commented 1 year ago

please keep us posted on the runner progress, also if you need testers I have an interest

mhill8304 commented 11 months ago

@fiftin - Is it possible to specify a particular runner now via environment variables or similar?

daniel-hiller commented 7 months ago

Any news on this?

mhzawadi commented 6 months ago

Now that I have this all working, I would love to have the ability to select what runners a task is run on. As I have 3 locations that all have runners ready, but no way to say that a task should only run on the local runner.

If you need testers please shout, as I am using this to update my servers weekly and also to update my docker stack/compose files.

mhzawadi commented 6 months ago

Also a list of runners in the UI would be great

OliPou commented 6 months ago

That will really be a key feature ! Do you have any idea of a when this feature will be released ?

fiftin commented 6 months ago

Hi @mhzawadi do you already use runners?

You need ability to select runner and inventory for work with specific location? Please provide mode details about use case.

mhzawadi commented 6 months ago

Hey @fiftin ,

Not using runners yet, have them connected and ready.

I have 3 locations, home an OVH dedi in France and a host at my work. They all have a runner ready to work, but I dont want to run home things from the OVH dedi.

I want to point a task (playbook, with inventory) at a runner, so that I can update home with the home runner and the OVH dedi with the OVH runner.

That help?

fiftin commented 6 months ago

Yes, it is good idea. We can add field to Inventory to specify which Runner must be used for it.

daniel-hiller commented 6 months ago

That would be so nice

Right now, the playbook has to establish a vpn connection first to run in a customer network.

mhzawadi commented 6 months ago

Yes, it is good idea. We can add field to Inventory to specify which Runner must be used for it.

Yes please, that would be sweet

OliPou commented 5 months ago

Hi,

@fiftin do you have any update on this feature 😃?

tboerger commented 4 months ago

If there is an update available it will be posted. In the meantime you could subscribe to this issue to receive updates. Every comment gets sent out to anybody subscribed to this issue, just commenting with the question if there is an update is petty annoying.

2cre8it commented 1 month ago

Hi Semaphore UI Team,

My organisation is evaluating Semaphore UI as our automation platform, and so far everything has been great. However, as I'll be needing to run various ansible playbooks over 20000 nodes, we'll need to rely a fleet to runners to ensure the job gets done in a timely manner.

I have setup 2x runners in a PoC environment (I'm running Semaphore UI v2.10.22, on Ubuntu 22.04 VM's) and getting them integrated to the semaphore UI host was easy enough. All the tasks are indeed being executed on the runners.

However, I noticed several problems with the runners when I start applying some real life scenarios:

  1. I noticed the selection of the runners for task execution was not random. it appears the semaphore host will use the first available runner on the list until it reaches its max_parallel_tasks value before it selects the next runner in the list. I managed to observe this behaviour when I setup the 2 runners in the semaphore hosts's DB with this settings:

    Runner 1: max_parallel_tasks 2 Runner 2: max_parallel_tasks 1

I then lunched 3 jobs from the semaphore UI. The first 2 jobs was executed on Runner 1, while the 3rd job was execute on Runner 2.

Q: Is there anyway this behaviour can be changed? Ideally the runner selection, as its most basic form, is completely random, or just straight round robin?

  1. I also noticed when a Runner is "offline" (I simulated this by shutting down the runner process), it appears the semaphore host is not aware of this. Thus when semaphore hosts decided to use (say runner 1) as the execute host, the job still just get stuck and nothing happens.

Q: Is there any health checking mechanisms between the semaphore host & the runners so that if a runner goes offline, the semaphore host will "strike out" that runner from its task selection?

I noticed an effective way to strike out a runner from task selection is to make value "max_parallel_tasks" for that runner in the DB to be 0.

Like the product so far. Would love to be able to use this for our production use. We just need more understanding on these issues.

Thanks in advance!