Remove vagrant lock from build.sh and run_test.sh (#190)

vagrant_lock was created in order to prevent parallel execution of two 'Vagrant up' operations in parallel. Previously it was necessary due to Vagrant internal Chef issue. Now several bugs in Vagrant are fixed and MDBCI uses own Chef to provision nodes for builds and tests. There is no need to wait for previous Vagrant run finished, removing all waiting from all scripts.
'rm vagrant_lock is still present to remove locks created by previous versions of build and test scripts-
This commit is contained in:
Timofey Turenko
2019-02-25 14:22:32 +02:00
committed by GitHub
parent 2440b48ccc
commit b0efcea3f6
6 changed files with 6 additions and 44 deletions

View File

@ -141,13 +141,6 @@ https://help.ubuntu.com/lts/serverguide/libvirt.html
https://github.com/vagrant-libvirt/vagrant-libvirt#installation
### vagrant is locked, waiting ...
```bash
rm ~/vagrant_lock
```
### Random VM creation failures
Plese check the amount of free memory and amount of running VMs

View File

@ -121,7 +121,3 @@ If test run was executed with parameter 'do_not_destroy' set yo 'yes' please do
[destroy](http://max-tst-01.mariadb.com:8089/view/axilary/job/destroy/) against your 'target'
This job also have to be executed if test run job crashed or it was interrupted.
In case of build or test job crash, interruption, Jenkins crash during Vagrant operation it is possible that Vagrant lock
stays in locked state and no other job can progress (job can be started, but it is waiting for Vagrant lock -
'/home/vagrant/vagrant_lock' can be seen in the job log). In this case lock can be removed by [remove_lock](http://max-tst-01.mariadb.com:8089/view/axilary/job/remove_lock/) job.

View File

@ -32,26 +32,17 @@ ${mdbci_dir}/mdbci --override --template ${MDBCI_VM_PATH}/${name}.json generate
mkdir ${MDBCI_VM_PATH}/$name/cnf
cp -r ${script_dir}/cnf/* ${MDBCI_VM_PATH}/$name/cnf/
while [ -f ~/vagrant_lock ]
do
echo "vagrant is locked, waiting ..."
sleep 5
done
touch ~/vagrant_lock
echo ${JOB_NAME}-${BUILD_NUMBER} >> ~/vagrant_lock
echo "running vagrant up $provider"
${mdbci_dir}/mdbci up $name --attempts 3
if [ $? != 0 ]; then
echo "Error creating configuration"
rm ~/vagrant_lock
rm -f ~/vagrant_lock
exit 1
fi
#cp ~/build-scripts/team_keys .
${mdbci_dir}/mdbci public_keys --key ${team_keys} $name
rm ~/vagrant_lock
rm -f ~/vagrant_lock
exit 0

View File

@ -91,7 +91,7 @@ set -x
if [ "${do_not_destroy_vm}" != "yes" ] ; then
${mdbci_dir}/mdbci destroy $name
fi
rm ~/vagrant_lock
rm -f ~/vagrant_lock
exit 1
fi
${mdbci_dir}/mdbci snapshot take --path-to-nodes $name --snapshot-name clean
@ -105,7 +105,7 @@ else
if [ "${do_not_destroy_vm}" != "yes" ] ; then
${mdbci_dir}/mdbci destroy $name
fi
rm ~/vagrant_lock
rm -f ~/vagrant_lock
exit 1
fi