diff options
author | dalyd <david.daly@mongodb.com> | 2017-02-01 13:31:50 -0500 |
---|---|---|
committer | dalyd <david.daly@mongodb.com> | 2017-02-13 16:09:47 -0500 |
commit | 3e6e0c3cac638b08fe4f27cde58a135851e89918 (patch) | |
tree | c3215d909a101b40eb2f8d279135ef247c3eed76 | |
parent | c114d37a74445f089b2320654c5ae7efa4c0e1ab (diff) | |
download | mongo-3e6e0c3cac638b08fe4f27cde58a135851e89918.tar.gz |
SERVER-27983: Move sys-perf state to /data from $HOME
(cherry picked from commit 15850d1ebfb49a810ae175724bb8e8f97b034840)
-rw-r--r-- | etc/system_perf.yml | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/etc/system_perf.yml b/etc/system_perf.yml index 0cf62dab4ef..85ed6d21281 100644 --- a/etc/system_perf.yml +++ b/etc/system_perf.yml @@ -39,7 +39,7 @@ post: working_dir: work script: | source ./dsienv.sh - if [ -e $HOME/infrastructure_provisioning/terraform/provisioned.${cluster} ]; then + if [ -e /data/infrastructure_provisioning/terraform/provisioned.${cluster} ]; then $DSI_PATH/bin/mark_idle.sh fi @@ -162,33 +162,46 @@ functions: set -v ./terraform get --update - command: shell.exec - # set up $HOME/infrastructure_provisioning to keep track of resources, + # set up /data/infrastructure_provisioning to keep track of resources, # and allow Evergreen to release resources from there params: script: | set -o verbose - if [ ! -d "$HOME/infrastructure_provisioning" ]; then + + # To force re-creation of existing instances, e.g. for a patch build, you can uncomment this: + #if [ -d "/data/infrastructure_provisioning" ]; then + # /data/infrastructure_provisioning/terraform/infrastructure_teardown.sh \ + # && rm -rf /data/infrastructure_provisioning + #fi + + # IF there's anything still in $HOME it's old or a mistake. Clean it up. + if [ -d "$HOME/infrastructure_provisioning" ]; then + $HOME/infrastructure_provisioning/terraform/infrastructure_teardown.sh \ + && rm -rf $HOME/infrastructure_provisioning + fi + + if [ ! -d "/data/infrastructure_provisioning" ]; then echo "copying terraform to Evergreen host" - mkdir $HOME/infrastructure_provisioning - cp -r terraform $HOME/infrastructure_provisioning/. - cp -r modules $HOME/infrastructure_provisioning/. + mkdir /data/infrastructure_provisioning + cp -r terraform /data/infrastructure_provisioning/. + cp -r modules /data/infrastructure_provisioning/. echo "copying infrastructure_teardown.sh to Evergreen host" - cp src/dsi/dsi/bin/destroy_cluster.sh $HOME/infrastructure_provisioning/terraform/infrastructure_teardown.sh + cp src/dsi/dsi/bin/destroy_cluster.sh /data/infrastructure_provisioning/terraform/infrastructure_teardown.sh fi - ls -l $HOME/infrastructure_provisioning + ls -l /data/infrastructure_provisioning "infrastructure provisioning": - command: shell.exec - # if $HOME/infrastructure_provisioning exists, get info about provisioned resources + # if /data/infrastructure_provisioning exists, get info about provisioned resources # from there otherwise provision resources from the cloud params: working_dir: work script: | set -e set -o verbose - if [ -e "$HOME/infrastructure_provisioning/terraform/terraform.tfstate" ]; then + if [ -e "/data/infrastructure_provisioning/terraform/terraform.tfstate" ]; then echo "Restrieving info for existing resources" - cp $HOME/infrastructure_provisioning/terraform/terraform.tfstate . + cp /data/infrastructure_provisioning/terraform/terraform.tfstate . else echo "No existing resources found" fi @@ -200,7 +213,7 @@ functions: # don't run this with "set -e" so we can set up properly for the teardown.sh set -o verbose source ./dsienv.sh - if [ ! -e $HOME/infrastructure_provisioning/terraform/provisioned.${cluster} ]; then + if [ ! -e /data/infrastructure_provisioning/terraform/provisioned.${cluster} ]; then EXISTING="false" else EXISTING="true" @@ -211,9 +224,9 @@ functions: if [ $? -eq 0 ]; then echo "Resource provisioned/updated." # copy terraform information needed for teardown - cp {terraform.tfstate,cluster.tf,terraform.tfvars,security.tf} $HOME/infrastructure_provisioning/terraform/. - rsync -vr ../modules $HOME/infrastructure_provisioning/modules - cd $HOME/infrastructure_provisioning/terraform + cp {terraform.tfstate,cluster.tf,terraform.tfvars,security.tf} /data/infrastructure_provisioning/terraform/. + rsync -vr ../modules /data/infrastructure_provisioning/modules + cd /data/infrastructure_provisioning/terraform ./terraform get # use provisioned.${shard} to indicate the type of clusters held by EVG host # remove previous information and keep the latest cluster type @@ -225,7 +238,7 @@ functions: yes yes | ./terraform destroy if [ $? != 0 ]; then yes yes | ./terraform destroy; fi echo "Resource released." - rm -r $HOME/infrastructure_provisioning + rm -r /data/infrastructure_provisioning echo "Cleaned up provisioning state on Evergreen host. Exiting test." exit 1 fi |