Let's introduce a RestartPolicy filed for a VM so users can customize what happens when a startup script fails for example. I propose to have 3 options:
Never - same behaviour as right now. A VM just goes into Failed status.
Always - just starts VM and runs the startup script again.
AlwaysErase - deletes the existing VM, clones it again and runs it.
Let's also make sure startup scripts have some predefined environment variables like ORCHARD_WORKER_NAME, TART_IMAGE and ORCHARD_VM_NAME/ORCHARD_VM_UID.
I see one major AlwaysErase use case: running ephemeral CI workers that are getting recreated after every job.
cd ~/actions-runner
./config.sh --url https://github.com/cirruslabs --name $ORCHARD_VM_NAME --labels "orchard,$TART_IMAGE" --token $GITHUB_TOKEN --ephemeral
./run.sh
exit 1 # so AlwaysErase restart policy will re-create the VM
Hey @fkorotkov!
I can see you've skipped AlwaysErase during the implementation. Is there any alternative to set up ephemeral vms, or it's not supported yet?
Let's introduce a
RestartPolicy
filed for a VM so users can customize what happens when astartup
script fails for example. I propose to have 3 options:Never
- same behaviour as right now. A VM just goes intoFailed
status.Always
- just starts VM and runs thestartup
script again.AlwaysErase
- deletes the existing VM, clones it again and runs it.Let's also make sure
startup
scripts have some predefined environment variables likeORCHARD_WORKER_NAME
,TART_IMAGE
andORCHARD_VM_NAME
/ORCHARD_VM_UID
.I see one major
AlwaysErase
use case: running ephemeral CI workers that are getting recreated after every job.Where
startupscript.sh
looks like: