Add support for preemptible instances in node-e2e

Preemptible instances are cheaper, and the small chanse of a vm being
killed doesn't matter when running during development. This is a
tradeoff the user should be able to decide on.

More info here:
https://cloud.google.com/compute/docs/instances/preemptible

The default setting is false, so unless setting
PREEMPTIBLE_INSTANCES=true, everything will behave as before.

Signed-off-by: Odin Ugedal <odin@ugedal.com>
This commit is contained in:
Odin Ugedal
2019-08-16 15:32:10 +02:00
parent 4e7fd98763
commit e20c2b1f32
3 changed files with 11 additions and 6 deletions

View File

@@ -94,6 +94,7 @@ if [ "${remote}" = true ] ; then
instance_prefix=${INSTANCE_PREFIX:-"test"}
cleanup=${CLEANUP:-"true"}
delete_instances=${DELETE_INSTANCES:-"false"}
preemptible_instances=${PREEMPTIBLE_INSTANCES:-"false"}
test_suite=${TEST_SUITE:-"default"}
# Get the compute zone
@@ -149,7 +150,7 @@ if [ "${remote}" = true ] ; then
--image-project="${image_project}" --instance-name-prefix="${instance_prefix}" \
--delete-instances="${delete_instances}" --test_args="${test_args}" --instance-metadata="${metadata}" \
--image-config-file="${image_config_file}" --system-spec-name="${system_spec_name}" \
--extra-envs="${extra_envs}" --test-suite="${test_suite}" \
--preemptible-instances="${preemptible_instances}" --extra-envs="${extra_envs}" --test-suite="${test_suite}" \
2>&1 | tee -i "${artifacts}/build-log.txt"
exit $?