Skip to content

Free concurrency mode #1833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Harfusha opened this issue Mar 13, 2024 · 19 comments
Open

Free concurrency mode #1833

Harfusha opened this issue Mar 13, 2024 · 19 comments

Comments

@Harfusha
Copy link

Would be nice to have a 3rd option to allow the same task to deploy concurrently. I've been using semaphore to provision VM's on my proxmox cluster.

There's no reason I couldn't run the same task concurrently in this scenario and it would have been nice if the option was there.

Originally posted by @jfloodnet in #366 (comment)

The tasks we are running cannot collide with each other so free strategy would be nice to have.

@TallerAxouxere
Copy link

idem, i need 5 task with the same playbook :(

@rajcz
Copy link

rajcz commented Mar 22, 2024

Hello all,

I also require this. I'm managing over ten tasks within a single playbook simultaneously :). Does anyone on the team have an idea of when enhancements might be implemented? Thank you!

Pavel

@fiftin
Copy link
Collaborator

fiftin commented Mar 23, 2024

Hi @tboerger do you have a time to do this? :)

@Harfusha
Copy link
Author

Hello, is there any update on this issue?

@fatihusta
Copy link

Hi @Harfusha

If I understand correctly, the ansible configuration below may help you.

Create this file in the project folder.
ansible.cfg

Copy these config into ansible.cfg

[defaults]
force_color = True
host_key_checking = False
callbacks_enabled = profile_tasks, timer
interpreter_python = auto

[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=30m -o ConnectionAttempts=100 -o UserKnownHostsFile=/dev/null
pipelining = True

The important part is ssh_connection section.

This configuration runs the same task in parallel on different hosts.

@Harfusha
Copy link
Author

Harfusha commented Apr 4, 2024

Hello, but we need to run multiple tasks at same time at same host. We are running tasks on same server but for diffrent client domains.

@fatihusta
Copy link

Ansible has async feature, but I never tried.

@Harfusha
Copy link
Author

Harfusha commented Apr 4, 2024

But the tasks we are running are independent. There can be running 5 times 1 playbook with diffrent parameters on single host and 5 diffrent playbooks on same host at a same time.

When this happens, than the last task can be waiting more than hour.

We cannot group them because each of them is doing something else or has diffrent target. And they are not ran at a same timre but when multiple long tasks are added, than the queue is created.

We have our task created that all of them are independent and cannot collide with any other task.

We are using parallel tasks for all we can, but this is not possible when the tasks are added at diffrent time.

If free concurrency mode would be added task would not wait for each other. When i add up time from all tasks then 80% of time is just waiting for task to finish.

@jfloodnet
Copy link

Yep, the use case for me is a single target host that can handle the same task executing concurrently. The current model doesn't allow it.

@TallerAxouxere
Copy link

TallerAxouxere commented Apr 8, 2024

I want to launch the same playbook on multiple machines simultaneously, but with the adjustment you indicate, I couldn't achieve it. Use different IPs on each launch.

Captura de pantalla 2024-04-08 181407

@Harfusha
Copy link
Author

Any update on this issue?

@Harfusha
Copy link
Author

Harfusha commented May 7, 2024

Any updates?

1 similar comment
@Harfusha
Copy link
Author

Any updates?

@MarcoRizk
Copy link

This feature would make the tool more usable, since most of the time we need to run the same playbook multiple times on different hosts and i don't want to be blocked when the need emerges to run on another host while another is running knowing that some of our tasks take a long time to run

@jdhayes
Copy link
Contributor

jdhayes commented Sep 17, 2024

A similar discussion we had previously here.

@gaoyue1989
Copy link
Contributor

I think we can add a field “allow_simultaneous” similar to awx when setting the template。
In order to avoid some conflict problems

A similar discussion we had previously here.

@MarcoRizk
Copy link

I was gonna suggest something similar to @gaoyue1989 a boolean flag in the task template should allow users to customize how they want their tasks to run

@gaoyue1989
Copy link
Contributor

From the previous discussion, the previous conflict may be caused by executing git clone for each task. Considering that git changes are not frequent, you can add memory cache during execution. For example, if the task is running, execute git clone at intervals. If it is within the cache time, use the local directory file

A similar discussion we had previously here.

@Harfusha
Copy link
Author

I see you have open PR for non git based repos, but i need this functionality for git repos. Why you dont add condition if last commit (That would normally be cloned) is already cloned in current directory, that way both can run side by side. If commit would be diffrent, task will normally wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants