From bb26bb1ee57a3e079a9d43be2af6f0061d3dc39e Mon Sep 17 00:00:00 2001 From: shubhamchaudhary Date: Tue, 1 Oct 2019 02:57:35 +0530 Subject: [PATCH 01/13] added openebs-target-failure CR Signed-off-by: shubhamchaudhary --- .../openebs-target-failure/experiment_cr.yml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 charts/openebs/openebs-target-failure/experiment_cr.yml diff --git a/charts/openebs/openebs-target-failure/experiment_cr.yml b/charts/openebs/openebs-target-failure/experiment_cr.yml new file mode 100644 index 0000000..2ada932 --- /dev/null +++ b/charts/openebs/openebs-target-failure/experiment_cr.yml @@ -0,0 +1,53 @@ +-- +apiVersion: litmuschaos.io/v1alpha1 +description: + message: | + Kill the cstor target/Jiva controller container and check if gets created again +kind: ChaosExperiment +metadata: + labels: + litmuschaos.io/name: kubernetes + name: openebs-target-failure + namespace: shubham +spec: + definition: + args: + - -c + - ansible-playbook ./experiments/chaos/openebs_target_failure/test.yml -i /etc/ansible/hosts + -vv; exit 0 + command: + - /bin/bash + env: + - name: ANSIBLE_STDOUT_CALLBACK + value: default + - name: TARGET_NAMESPACE + value: openebs + - name: APP_NAMESPACE + value: shubham + - name: APP_LABEL + value: "name=percona" + - name: APP_PVC + value: percona-mysql-claim + - name: LIVENESS_APP_LABEL + value: "" + - name: LIVENESS_APP_NAMESPACE + value: "" + - name: DATA_PERSISTENCE + value: "" + - name: CHAOS_TYPE + value: "target-zrepl-kill" + - name: TARGET_CONTAINER + value: "cstor-volume-mgmt" + - name: DEPLOY_TYPE + value: deployment + labels: + name: openebs-target-failure + configmaps: + - name: target-failure + data: + parameters.yml: + litmusbook: /experiments/chaos/openebs_target_failure/run_litmus_test.yml + + + + From 9203e15f4134b607e81d80b3478472bad00c74e0 Mon Sep 17 00:00:00 2001 From: shubhamchaudhary Date: Tue, 1 Oct 2019 03:03:40 +0530 Subject: [PATCH 02/13] added openebs-target-failure CR Signed-off-by: shubhamchaudhary --- charts/openebs/openebs-target-failure/experiment_cr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/openebs/openebs-target-failure/experiment_cr.yml b/charts/openebs/openebs-target-failure/experiment_cr.yml index 2ada932..a043531 100644 --- a/charts/openebs/openebs-target-failure/experiment_cr.yml +++ b/charts/openebs/openebs-target-failure/experiment_cr.yml @@ -8,7 +8,7 @@ metadata: labels: litmuschaos.io/name: kubernetes name: openebs-target-failure - namespace: shubham + namespace: litmus spec: definition: args: @@ -23,7 +23,7 @@ spec: - name: TARGET_NAMESPACE value: openebs - name: APP_NAMESPACE - value: shubham + value: app-percona-ns - name: APP_LABEL value: "name=percona" - name: APP_PVC From ccb6c90731fca914e8cc63992021bdc03955d150 Mon Sep 17 00:00:00 2001 From: shubhamchaudhary Date: Thu, 3 Oct 2019 13:51:22 +0530 Subject: [PATCH 03/13] CI combine file Signed-off-by: shubhamchaudhary --- .travis.yml | 1 + Makefile | 7 ++++++- scripts/merge_all_cr.sh | 12 ++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 scripts/merge_all_cr.sh diff --git a/.travis.yml b/.travis.yml index 0e18f40..64c5073 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ dist: xenial # ubuntu 16.04 distro script: # runs only when PR is merged - make versionmaker + - make mergeExpCR after_success: # runs only when PR is merged and push the version file to master version - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then make push; fi diff --git a/Makefile b/Makefile index 6398425..b02cb78 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,12 @@ versionmaker: @echo "-----version maker-----" bash ./scripts/version_maker.sh +.PHONY: mergeExpCR +push: + @echo "--------merging experiment Crs-------" + bash ./scripts/merge_all_cr.sh + .PHONY: push push: @echo "---------git push to master-------" - bash ./scripts/push.sh \ No newline at end of file + bash ./scripts/push.sh diff --git a/scripts/merge_all_cr.sh b/scripts/merge_all_cr.sh new file mode 100644 index 0000000..7b2f995 --- /dev/null +++ b/scripts/merge_all_cr.sh @@ -0,0 +1,12 @@ +directories=$(ls -l ../charts/ | grep ^d | awk '{print $9}') +for directory in $directories +do + echo -e "---\n" > ../charts/$directory/experiments.yaml + subDirectories=$(ls -l ../charts/$directory | grep ^d | awk '{print $9}') + for subDirectory in $subDirectories + do + cat ../charts/$directory/$subDirectory/experiment.yaml >> ../charts/$directory/experiments.yaml + echo -e "\n---\n" >> ../charts/$directory/experiments.yaml + done +done + From 1e82190242cf8a5c12b2d5ef6f9c51d0905f4021 Mon Sep 17 00:00:00 2001 From: shubhamchaudhary Date: Thu, 3 Oct 2019 13:57:27 +0530 Subject: [PATCH 04/13] Add[CI]: Combine Experiments CR Signed-off-by: shubhamchaudhary --- .travis.yml | 2 +- Makefile | 6 +++--- scripts/{merge_all_cr.sh => combine_all_cr.sh} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename scripts/{merge_all_cr.sh => combine_all_cr.sh} (100%) diff --git a/.travis.yml b/.travis.yml index 64c5073..34cdabe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ dist: xenial # ubuntu 16.04 distro script: # runs only when PR is merged - make versionmaker - - make mergeExpCR + - make combineExpCR after_success: # runs only when PR is merged and push the version file to master version - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then make push; fi diff --git a/Makefile b/Makefile index b02cb78..3dae641 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,10 @@ versionmaker: @echo "-----version maker-----" bash ./scripts/version_maker.sh -.PHONY: mergeExpCR +.PHONY: combineExpCR push: - @echo "--------merging experiment Crs-------" - bash ./scripts/merge_all_cr.sh + @echo "--------Combining Experiments CR-------" + bash ./scripts/combine_all_cr.sh .PHONY: push push: diff --git a/scripts/merge_all_cr.sh b/scripts/combine_all_cr.sh similarity index 100% rename from scripts/merge_all_cr.sh rename to scripts/combine_all_cr.sh From 0a6a551c14b54da56641feaa73e683def81dba14 Mon Sep 17 00:00:00 2001 From: Shubham Chaudhary Date: Thu, 3 Oct 2019 14:03:29 +0530 Subject: [PATCH 05/13] Delete experiment_cr.yml Signed-off-by: shubhamchaudhary --- .../openebs-target-failure/experiment_cr.yml | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 charts/openebs/openebs-target-failure/experiment_cr.yml diff --git a/charts/openebs/openebs-target-failure/experiment_cr.yml b/charts/openebs/openebs-target-failure/experiment_cr.yml deleted file mode 100644 index a043531..0000000 --- a/charts/openebs/openebs-target-failure/experiment_cr.yml +++ /dev/null @@ -1,53 +0,0 @@ --- -apiVersion: litmuschaos.io/v1alpha1 -description: - message: | - Kill the cstor target/Jiva controller container and check if gets created again -kind: ChaosExperiment -metadata: - labels: - litmuschaos.io/name: kubernetes - name: openebs-target-failure - namespace: litmus -spec: - definition: - args: - - -c - - ansible-playbook ./experiments/chaos/openebs_target_failure/test.yml -i /etc/ansible/hosts - -vv; exit 0 - command: - - /bin/bash - env: - - name: ANSIBLE_STDOUT_CALLBACK - value: default - - name: TARGET_NAMESPACE - value: openebs - - name: APP_NAMESPACE - value: app-percona-ns - - name: APP_LABEL - value: "name=percona" - - name: APP_PVC - value: percona-mysql-claim - - name: LIVENESS_APP_LABEL - value: "" - - name: LIVENESS_APP_NAMESPACE - value: "" - - name: DATA_PERSISTENCE - value: "" - - name: CHAOS_TYPE - value: "target-zrepl-kill" - - name: TARGET_CONTAINER - value: "cstor-volume-mgmt" - - name: DEPLOY_TYPE - value: deployment - labels: - name: openebs-target-failure - configmaps: - - name: target-failure - data: - parameters.yml: - litmusbook: /experiments/chaos/openebs_target_failure/run_litmus_test.yml - - - - From 9f2242ef711fd896990c72588302e3f41e5e01c8 Mon Sep 17 00:00:00 2001 From: Shubham Chaudhary Date: Thu, 3 Oct 2019 14:31:37 +0530 Subject: [PATCH 06/13] Update Makefile Signed-off-by: shubhamchaudhary --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3dae641..f81845a 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,9 @@ versionmaker: bash ./scripts/version_maker.sh .PHONY: combineExpCR -push: - @echo "--------Combining Experiments CR-------" - bash ./scripts/combine_all_cr.sh +combineExpCR: + @echo "--------Combining Experiments CR-------" + bash ./scripts/combine_all_cr.sh .PHONY: push push: From 7a0dac5afab7afc614612191bc7e3277c71e49e6 Mon Sep 17 00:00:00 2001 From: shubhamchaudhary Date: Thu, 3 Oct 2019 14:41:53 +0530 Subject: [PATCH 07/13] Add[CI]: Combine Experiments CR Signed-off-by: shubhamchaudhary --- .travis.yml | 1 + scripts/combine_all_cr.sh | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 34cdabe..f7d9bff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ script: # runs only when PR is merged - make versionmaker - make combineExpCR + - echo pwd after_success: # runs only when PR is merged and push the version file to master version - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then make push; fi diff --git a/scripts/combine_all_cr.sh b/scripts/combine_all_cr.sh index 7b2f995..5861b64 100644 --- a/scripts/combine_all_cr.sh +++ b/scripts/combine_all_cr.sh @@ -1,12 +1,12 @@ -directories=$(ls -l ../charts/ | grep ^d | awk '{print $9}') +directories=$(ls -l ./charts/ | grep ^d | awk '{print $9}') for directory in $directories do - echo -e "---\n" > ../charts/$directory/experiments.yaml - subDirectories=$(ls -l ../charts/$directory | grep ^d | awk '{print $9}') + echo -e "---\n" > ./charts/$directory/experiments.yaml + subDirectories=$(ls -l ./charts/$directory | grep ^d | awk '{print $9}') for subDirectory in $subDirectories do - cat ../charts/$directory/$subDirectory/experiment.yaml >> ../charts/$directory/experiments.yaml - echo -e "\n---\n" >> ../charts/$directory/experiments.yaml + cat ./charts/$directory/$subDirectory/experiment.yaml >> ./charts/$directory/experiments.yaml + echo -e "\n---\n" >> ./charts/$directory/experiments.yaml done done From a6eee81dfa11bd18413a1aca9bfc108cbd7711b2 Mon Sep 17 00:00:00 2001 From: shubhamchaudhary Date: Thu, 3 Oct 2019 14:47:32 +0530 Subject: [PATCH 08/13] Add[CI]: Combine Experiments CR Signed-off-by: shubhamchaudhary --- scripts/combine_all_cr.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/combine_all_cr.sh b/scripts/combine_all_cr.sh index 5861b64..2c24159 100644 --- a/scripts/combine_all_cr.sh +++ b/scripts/combine_all_cr.sh @@ -9,4 +9,7 @@ do echo -e "\n---\n" >> ./charts/$directory/experiments.yaml done done +echo "validating combine charts" +cat ./charts/generic/ +cat ./charts/openebs/ From a68022ea33c910bcf18f563c6588e59ef0cb68d5 Mon Sep 17 00:00:00 2001 From: shubhamchaudhary Date: Thu, 3 Oct 2019 14:51:22 +0530 Subject: [PATCH 09/13] Add[CI]: Combine Experiments CR Signed-off-by: shubhamchaudhary --- scripts/combine_all_cr.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/combine_all_cr.sh b/scripts/combine_all_cr.sh index 2c24159..149d507 100644 --- a/scripts/combine_all_cr.sh +++ b/scripts/combine_all_cr.sh @@ -10,6 +10,6 @@ do done done echo "validating combine charts" -cat ./charts/generic/ -cat ./charts/openebs/ +cat ./charts/generic/experiments.yaml +cat ./charts/openebs/experiments.yaml From 924f81fd797bf0dfe4c3bfc1e0dc9790d75c856e Mon Sep 17 00:00:00 2001 From: shubhamchaudhary Date: Thu, 3 Oct 2019 14:55:50 +0530 Subject: [PATCH 10/13] Add[CI]: Combine Experiments CR Signed-off-by: shubhamchaudhary --- .travis.yml | 1 - scripts/combine_all_cr.sh | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f7d9bff..34cdabe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ script: # runs only when PR is merged - make versionmaker - make combineExpCR - - echo pwd after_success: # runs only when PR is merged and push the version file to master version - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then make push; fi diff --git a/scripts/combine_all_cr.sh b/scripts/combine_all_cr.sh index 149d507..ef9c6ec 100644 --- a/scripts/combine_all_cr.sh +++ b/scripts/combine_all_cr.sh @@ -9,7 +9,8 @@ do echo -e "\n---\n" >> ./charts/$directory/experiments.yaml done done -echo "validating combine charts" +echo "validating combine charts for generic" cat ./charts/generic/experiments.yaml +echo "validating combine charts for openebs" cat ./charts/openebs/experiments.yaml From 5cc43a6401c252a0dc6e649e148fd0512138fb35 Mon Sep 17 00:00:00 2001 From: shubhamchaudhary Date: Thu, 3 Oct 2019 17:27:57 +0530 Subject: [PATCH 11/13] Add[CI]: combine experiments CR Signed-off-by: shubhamchaudhary --- scripts/combine_all_cr.sh | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/scripts/combine_all_cr.sh b/scripts/combine_all_cr.sh index ef9c6ec..b2a4a53 100644 --- a/scripts/combine_all_cr.sh +++ b/scripts/combine_all_cr.sh @@ -1,12 +1,25 @@ -directories=$(ls -l ./charts/ | grep ^d | awk '{print $9}') +directories=$(find ./charts -maxdepth 1 -type d) for directory in $directories do - echo -e "---\n" > ./charts/$directory/experiments.yaml - subDirectories=$(ls -l ./charts/$directory | grep ^d | awk '{print $9}') + if [ $directory == "./charts" ] + then + continue + fi + subDirectories=$(find $directory -maxdepth 1 -type d) for subDirectory in $subDirectories - do - cat ./charts/$directory/$subDirectory/experiment.yaml >> ./charts/$directory/experiments.yaml - echo -e "\n---\n" >> ./charts/$directory/experiments.yaml + do + if [ $subDirectory == $directory ] + then + continue + fi + if test -f "$subDirectory/experiment.yaml"; then + if test -f "$directory/experiments.yaml"; then + cat $subDirectory/experiment.yaml >> $directory/experiments.yaml + else + cat $subDirectory/experiment.yaml > $directory/experiments.yaml + fi + echo -e "\n---\n" >> $directory/experiments.yaml + fi done done echo "validating combine charts for generic" From 60fc34de64cbf23ffa3360915b4685fd2d71df1c Mon Sep 17 00:00:00 2001 From: shubhamchaudhary Date: Thu, 3 Oct 2019 18:10:57 +0530 Subject: [PATCH 12/13] Add[CI]: combine experiments CRwq! Signed-off-by: shubhamchaudhary --- scripts/combine_all_cr.sh | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/scripts/combine_all_cr.sh b/scripts/combine_all_cr.sh index b2a4a53..538447a 100644 --- a/scripts/combine_all_cr.sh +++ b/scripts/combine_all_cr.sh @@ -1,29 +1,19 @@ -directories=$(find ./charts -maxdepth 1 -type d) +directories=$(find ../charts -maxdepth 1 -mindepth 1 -type d) for directory in $directories do - if [ $directory == "./charts" ] - then - continue - fi - subDirectories=$(find $directory -maxdepth 1 -type d) + subDirectories=$(find $directory -maxdepth 1 -mindepth 1 -type d) + echo -e "---\n" > $directory/experiments.yaml for subDirectory in $subDirectories do - if [ $subDirectory == $directory ] - then - continue - fi - if test -f "$subDirectory/experiment.yaml"; then - if test -f "$directory/experiments.yaml"; then + + if test -f "$subDirectory/experiment.yaml"; then cat $subDirectory/experiment.yaml >> $directory/experiments.yaml - else - cat $subDirectory/experiment.yaml > $directory/experiments.yaml - fi - echo -e "\n---\n" >> $directory/experiments.yaml + echo -e "\n---\n" >> $directory/experiments.yaml fi done done echo "validating combine charts for generic" -cat ./charts/generic/experiments.yaml +cat ../charts/generic/experiments.yaml echo "validating combine charts for openebs" -cat ./charts/openebs/experiments.yaml +cat ../charts/openebs/experiments.yaml From 7f3ff008f1d4bbcc015a8bcd72420e5052aedb64 Mon Sep 17 00:00:00 2001 From: shubhamchaudhary Date: Thu, 3 Oct 2019 18:15:06 +0530 Subject: [PATCH 13/13] Add[CI]: combine experiments CR Signed-off-by: shubhamchaudhary --- scripts/combine_all_cr.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/combine_all_cr.sh b/scripts/combine_all_cr.sh index 538447a..3c5356f 100644 --- a/scripts/combine_all_cr.sh +++ b/scripts/combine_all_cr.sh @@ -1,4 +1,4 @@ -directories=$(find ../charts -maxdepth 1 -mindepth 1 -type d) +directories=$(find ./charts -maxdepth 1 -mindepth 1 -type d) for directory in $directories do subDirectories=$(find $directory -maxdepth 1 -mindepth 1 -type d) @@ -13,7 +13,7 @@ do done done echo "validating combine charts for generic" -cat ../charts/generic/experiments.yaml +cat ./charts/generic/experiments.yaml echo "validating combine charts for openebs" -cat ../charts/openebs/experiments.yaml +cat ./charts/openebs/experiments.yaml