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

Allow concurrency for tasks that does not collide. Fixes #365 #366

Merged
merged 1 commit into from Aug 19, 2017

Conversation

Projects
None yet
2 participants
@Natanande
Contributor

Natanande commented May 29, 2017

Two different concurrency modes are implemented, and is enabled by
setting "concurrency_mode" in the config file to either "project" or "node".

When "project" concurrency is enabled, tasks will run in parallel if and
only if they do not share the same project id, with no regard to the
nodes/hosts that are affected.

When "node" concurrency is enabled, a task will run in parallel if and
only if the hosts affected by tasks already running does not intersect
with the hosts that would be affected by the task in question.

If "concurrency_mode" is not specified, no task will start before the
previous one has finished.

The collision check is based on the output from the "--list-hosts"
argument to ansible, which uses the hosts specified in the inventory.
Thus, if two different hostnames are used that points to the same node,
such as "127.0.0.1" and "localhost", there will be no collision and two
tasks may connect to the same node concurrently. If this behaviour is
not desired, one should make sure to not include aliases for their hosts
in their inventories when enabling concurrency mode.

To restrict the amount of parallel tasks that runs at the same time, one
can add the "max_parallel_tasks" to the config file. This defaults to a
humble 10 if not specified.

Allow concurrency for tasks that does not collide
Two different concurrency modes are implemented, and is enabled by
setting "concurrency_mode" in the config file to either "project" or "node".

When "project" concurrency is enabled, tasks will run in parallel if and
only if they do not share the same project id, with no regard to the
nodes/hosts that are affected.

When "node" concurrency is enabled, a task will run in parallel if and
only if the hosts affected by tasks already running does not intersect
with the hosts that would be affected by the task in question.

If "concurrency_mode" is not specified, no task will start before the
previous one has finished.

The collision check is based on the output from the "--list-hosts"
argument to ansible, which uses the hosts specified in the inventory.
Thus, if two different hostnames are used that points to the same node,
such as "127.0.0.1" and "localhost", there will be no collision and two
tasks may connect to the same node concurrently. If this behaviour is
not desired, one should make sure to not include aliases for their hosts
in their inventories when enabling concurrency mode.

To restrict the amount of parallel tasks that runs at the same time, one
can add the "max_parallel_tasks" to the config file. This defaults to a
humble 10 if not specified.
@matejkramny

This comment has been minimized.

Show comment
Hide comment
@matejkramny

matejkramny May 29, 2017

Member

👍 will check this out & test

Thanks!

Member

matejkramny commented May 29, 2017

👍 will check this out & test

Thanks!

@Natanande

This comment has been minimized.

Show comment
Hide comment
@Natanande

Natanande May 30, 2017

Contributor

Also provides partial solution to #237

Contributor

Natanande commented May 30, 2017

Also provides partial solution to #237

@matejkramny

This comment has been minimized.

Show comment
Hide comment
@matejkramny

matejkramny Aug 16, 2017

Member

Many thanks for this. I'm reviewing if it breaks anything & will be merged shortly after.

My apologies for the long delay.

Member

matejkramny commented Aug 16, 2017

Many thanks for this. I'm reviewing if it breaks anything & will be merged shortly after.

My apologies for the long delay.

@matejkramny matejkramny merged commit 8bc1b7f into ansible-semaphore:develop Aug 19, 2017

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@Echobob Echobob referenced this pull request Aug 28, 2017

Closed

Concurrent deploys #365

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