From 655d527d5fda5dbc8de1a4eec216f015833bdca2 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Tue, 2 Feb 2016 08:52:32 -0500 Subject: [PATCH] Add a fan in, fan out example and test --- examples/graph10.yaml | 128 ++++++++++++++++++++++++++++++++++++++++++ test/shell/t5.sh | 10 ++++ test/shell/t5.yaml | 128 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 266 insertions(+) create mode 100644 examples/graph10.yaml create mode 100755 test/shell/t5.sh create mode 100644 test/shell/t5.yaml diff --git a/examples/graph10.yaml b/examples/graph10.yaml new file mode 100644 index 00000000..7fdf4b94 --- /dev/null +++ b/examples/graph10.yaml @@ -0,0 +1,128 @@ +--- +graph: mygraph +comment: simple exec fan in to fan out example to demonstrate optimization +types: + exec: + - name: exec1 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec2 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec3 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec4 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec5 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec6 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec7 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec8 + cmd: sleep 15s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present +edges: +- name: e1 + from: + type: exec + name: exec1 + to: + type: exec + name: exec4 +- name: e2 + from: + type: exec + name: exec2 + to: + type: exec + name: exec4 +- name: e3 + from: + type: exec + name: exec3 + to: + type: exec + name: exec4 +- name: e4 + from: + type: exec + name: exec4 + to: + type: exec + name: exec5 +- name: e5 + from: + type: exec + name: exec4 + to: + type: exec + name: exec6 +- name: e6 + from: + type: exec + name: exec4 + to: + type: exec + name: exec7 diff --git a/test/shell/t5.sh b/test/shell/t5.sh new file mode 100755 index 00000000..77a9932f --- /dev/null +++ b/test/shell/t5.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +. etcd.sh # start etcd as job # 1 + +# should take slightly more than 35s, but fail if we take 45s) +timeout --kill-after=45s 40s ./mgmt run --file t5.yaml --converged-timeout=5 --no-watch & + +#jobs # etcd is 1 +#wait -n 2 # wait for mgmt to exit +. wait.sh # wait for everything except etcd diff --git a/test/shell/t5.yaml b/test/shell/t5.yaml new file mode 100644 index 00000000..7fdf4b94 --- /dev/null +++ b/test/shell/t5.yaml @@ -0,0 +1,128 @@ +--- +graph: mygraph +comment: simple exec fan in to fan out example to demonstrate optimization +types: + exec: + - name: exec1 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec2 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec3 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec4 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec5 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec6 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec7 + cmd: sleep 10s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present + - name: exec8 + cmd: sleep 15s + shell: '' + timeout: 0 + watchcmd: '' + watchshell: '' + ifcmd: '' + ifshell: '' + pollint: 0 + state: present +edges: +- name: e1 + from: + type: exec + name: exec1 + to: + type: exec + name: exec4 +- name: e2 + from: + type: exec + name: exec2 + to: + type: exec + name: exec4 +- name: e3 + from: + type: exec + name: exec3 + to: + type: exec + name: exec4 +- name: e4 + from: + type: exec + name: exec4 + to: + type: exec + name: exec5 +- name: e5 + from: + type: exec + name: exec4 + to: + type: exec + name: exec6 +- name: e6 + from: + type: exec + name: exec4 + to: + type: exec + name: exec7