Skip to content
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

chef-run Concurrency Option #158

Open
jonsmorrow opened this issue Nov 20, 2019 · 0 comments
Open

chef-run Concurrency Option #158

jonsmorrow opened this issue Nov 20, 2019 · 0 comments
Labels
Triage: Feature Request Indicates an issue requesting new functionality. Type: Enhancement Adds new functionality.

Comments

@jonsmorrow
Copy link
Contributor

As a chef-run operator,

I would like to be able to control the concurrency of my chef-runs,

So that I can better orchestrate my adhoc tasks ..

For example, let’s assume I have defined a range of hosts (tomcat-prod[1:10]) I want chef-run against to patch Java and restart Tomcat .. My recipe looks something like this:


package 'java-1.8.0-openjdk-devel' do

action :upgrade

notifies :restart, 'service[tomcat]', :delayed

end

service 'tomcat' do

action :nothing

end

The problem I am having is that they will all upgrade and restart at the same time, which means downtime .. I would like to have the opportunity to use a --concurrency option that would limit how many hosts are being worked on at the same time << very similar to the knife ssh option .. If possible, I would like to also be able to define a percentage value that would calculate how many hosts exists, and then based on my percentage value, work on the allowed amount ..

Example commands are:


# ASSUME 10 hosts total

# only work on 5 nodes at a time

chef-run tomcat-prod[1:10] upgrade_and_restart.rb --concurrency 5 ..

# only work on 50% of nodes at a time (i.e. 5 in in this example)

chef-run tomcat-prod[1:10] upgrade_and_restart.rb --concurrency '50%' ..

Before you say: “Greg, you already know there are 10 hosts, so just define 5 and be done with it” .. This is true, BUT, I have another idea submitted were we allow hosts pattern matching using regex, and if that comes true, then the chef-run operator may not know how many hosts exist and so we should allow them to deal in percentages vs hard numbers ..

Thanks and let me know if you have questions .. Here is a link to how Ansible is doing it using serial :: https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_delegation.html#rolling-update-batch-size

Aha! Link: https://chef.aha.io/epics/WS-E-28

@tas50 tas50 transferred this issue from chef/chef-workstation Feb 13, 2021
@marcparadise marcparadise added Triage: Feature Request Indicates an issue requesting new functionality. Type: Enhancement Adds new functionality. labels Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage: Feature Request Indicates an issue requesting new functionality. Type: Enhancement Adds new functionality.
Projects
None yet
Development

No branches or pull requests

2 participants