agent: |
kCWBHxpZilKc9mcoNC5HStart an ec2 instance
Start an ec2 instance
There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.
inputs
outputs
cmd = f'aws ec2 start-instances --instance-ids {instance_id}'
op = _exe(None, cmd)
msg = "Instance was down. Restarted the instance"
print(msg)
task_title = context.task_title
msg_type = "SUCCESS"
context.job_context[task_title] = {"msg" : msg, "msg_type" : msg_type}
copied
- 1FS6km40Slgy4DKab5lkmWait until the instance is running
1
Wait until the instance is running
There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.It takes a few seconds for the instance to come up. Keep checking the status for a few seconds. After a specified number of iterations, just give up and print an error message.
inputsoutputsimport time op = "" iter = 0 if "running" not in op and iter < 3: cmd = f'aws ec2 describe-instances --instance-ids {instance_id} --query "Reservations[].Instances[].State.Name" --output text' op = _exe(None, cmd) iter = iter + 1 time.sleep(60) cmd = f'aws ec2 describe-instances --instance-ids {instance_id} --query "Reservations[].Instances[].State.Name" --output text' op = _exe(None, cmd) task_title = context.task_title if "running" not in op: msg = f"Giving up. The host doesn't seem to be coming up: {instance_id}" msg_type = "ERROR" print(msg) context.proceed = False else: msg = f"This instance {instance_id} is now running" msg_type = "SUCCESS" print(msg) context.log(msg_type, msg) context.job_context[task_title] = {"msg" : msg, "msg_type" : msg_type}copied1 - 2vvE6yWNtxdJIwucjupz2Mount the volumes if needed
2
There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.inputsoutputsmount /dev/xvdb /datacopied2