Usage: multi-docker -n -c -q -n, --name HOSTNAME_PREFIX format: $tbox_group.$HOSTNAME -c, --count count how much container do you need -q, --queues queues separated by "," -h, --help show this message
example: ./multi-docker -n dc-1g.taishan200-2280-2s48p-256g--a1 \ -c 1 \ -q dc-1g.taishan200-2280-2s48p-256g--a1
Signed-off-by: Xiao Shenwei xiaoshenwei96@163.com --- providers/multi-docker | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/providers/multi-docker b/providers/multi-docker index 64cafaa..54db8ab 100755 --- a/providers/multi-docker +++ b/providers/multi-docker @@ -9,10 +9,10 @@ require_relative './docker/docker' opt = {}
options = OptionParser.new do |opts| - opts.banner = 'Usage: multi-qemu [-t] [-n]' + opts.banner = 'Usage: multi-docker -n -c -q'
opts.separator '' - opts.on('-n HOSTNAME_PREFIX', '--name HOSTNAME_PREFIX', 'specify used hostname_prefix') do |name| + opts.on('-n HOSTNAME_PREFIX', '--name HOSTNAME_PREFIX', 'format: $tbox_group.$HOSTNAME') do |name| opt['hostname_prefix'] = name end
@@ -20,6 +20,10 @@ options = OptionParser.new do |opts| opt['nr_container'] = num end
+ opts.on('-q queues', '--queues queues', 'separated by ","') do |queues| + opt['queues'] = queues + end + opts.on_tail('-h', '--help', 'show this message') do puts opts exit @@ -28,13 +32,14 @@ end
if ARGV.size.zero? puts options - exit + exit 1 end
options.parse!(ARGV)
-hostname = opt['hostname_prefix'] || 'dc-1g' +hostname = opt['hostname_prefix'] || "dc-1g.#{ENV['HOSTNAME']}" nr_container = opt['nr_container'] || 1 +queues = opt['queues'] || "dc-1g.#{ENV['HOSTNAME']}"
-pids = multi_docker(hostname, nr_container) +pids = multi_docker(hostname, nr_container, queues) save_pid pids