Giter VIP home page Giter VIP logo

Comments (2)

rteabeault avatar rteabeault commented on July 18, 2024

I have been working on this and wanted to see what people thought. This is also including functionality for #668.

Two new options to the upgrade task.
-C, --concurrency - Specifies the max number of nodes that can be converged concurrently.
-b, --bootstrap-order - Specifies that nodes are converged in the order specified in the stack_order.

Here is how these things work together. Consider the stack order

stack_order do
  bootstrap 'app::database'
  bootstrap 'app::service'
end

and a manifest

{
  "nodes": [
    {
      "groups": ["app::database"],
      "hosts": ["db1", "db2", "db3"]
    },
    {
      "groups": ["app::service"],
      "hosts": ["app1", "app2", "app3"]
    }
  ]
}

The first thing I am doing is getting the task_queue from the bootstrap_routine and then using that to group all hostnames in the correct order. So, in the above example I have

[["db1", "db2", "db3"], ["app1", "app2", "app3"]]

Now depending on the combination of the --concurrency and --bootstrap flags this array is transformed into an array of "concurrency groups". In other words it is an array of arrays where each sub array can be converged in parallel.

If --concurrency 2

# We don't care that db nodes and app nodes are converged in parallel. 
# We just are restricting the max number of parallel converges
[["db1", "db2"], ["db3", "app1"], ["app2", "app3"]]

if --concurrency 2 and --bootstrap-order

# We want all the database nodes to go first followed by all of the app nodes but we want 
# at most 2 nodes converging at any given time
[["db1", "db2"], ["db3"], ["app1", "app2"], ["app3"]]

If just --bootstrap-order

# We want all the db nodes to converge in parallel then the app nodes in parallel
[["db1", "db2", "db3"], ["app1", "app2", "app3"]]

And finally the behavior when neither flag is specified

# All nodes can be converged in parallel.
[["db1", "db2", "db3", "app1", "app2", "app3"]]

I would love to get some feedback on this. Thanks.

from motherbrain.

capoferro avatar capoferro commented on July 18, 2024

Given the associated PR was merged, I'm closing this for now. Let me know if there's more to do on this front.

from motherbrain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.