revert the change from #842 that makes launchrunfarm block on instances passing status checks. make ci use instance_liveness instead

This commit is contained in:
Sagar Karandikar 2022-03-31 01:22:33 +00:00
parent 6ac0329a7a
commit 3a333930ca
2 changed files with 7 additions and 7 deletions

View File

@ -11,6 +11,10 @@ from common import *
# This is expected to be launch from the ci container
from ci_variables import *
# Reuse manager utilities
sys.path.append(ci_workdir + "/deploy/runtools")
from runtools import instance_liveness
def initialize_manager_hosted():
""" Performs the prerequisite tasks for all CI jobs that will run on the manager instance
@ -21,6 +25,9 @@ def initialize_manager_hosted():
# Catch any exception that occurs so that we can gracefully teardown
try:
# wait for machine to be reachable
instance_liveness()
# wait until machine launch is complete
with cd(manager_home_dir):
with settings(warn_only=True):

View File

@ -429,19 +429,12 @@ def instance_privateip_lookup_table(instances):
ips_to_instances = zip(ips, instances)
return { ip: instance for (ip, instance) in ips_to_instances }
def wait_on_instance_boot(instance_id):
""" Blocks on EC2 instance boot """
ec2_client = boto3.client('ec2')
waiter = ec2_client.get_waiter('instance_status_ok')
waiter.wait(InstanceIds=[instance_id])
def wait_on_instance_launches(instances, message=""):
""" Take a list of instances (as returned by create_instances), wait until
instance is running. """
rootLogger.info("Waiting for instance boots: " + str(len(instances)) + " " + message)
for instance in instances:
instance.wait_until_running()
wait_on_instance_boot(instance.id)
rootLogger.info(str(instance.id) + " booted!")
def terminate_instances(instanceids, dryrun=True):