BretFisher / dogvscat

Sample Docker Swarm cluster stack of tools
http://dogvs.cat
MIT License
504 stars 127 forks source link

PR: create node in parallel (instead of one after the other) #21

Closed pascalandy closed 5 years ago

pascalandy commented 5 years ago

As we can execute bash commands to run in parallel, I manage to create y nodes in parallel :) Much faster.

BretFisher commented 5 years ago

The current shell script is async AFAIK.

pascalandy commented 5 years ago

Humm, from what I could observe, docker-machine script creates the node-n1, then once done, it starts the second one and so on.

BretFisher commented 5 years ago

The & at the end of each command in the bash loop frees the loop to start the next loop before the previous command finishes. See creation here and how the responses are async:

asciicast

pascalandy commented 5 years ago

Oh! In the script version I have, (dec 2018), the & was not there! That's why I was confused. Good to know!

The & at the end of each command