Georgehwp is looking for a way to add a unittest to verify if a VM setup was successful in Sky. Romil Bhardwaj provided guidance on using the Python API or CLI to check the status of the setup.
Georgehwp
Asked on Feb 19, 2024
sky launch
was successful:import sky
cluster_name='test'
cluster = [c for c in sky.status() if c['name']==cluster_name]
cluster[0]['status'] # ClusterStatus.UP indicates successful provisioning, including running setup
sky status
to output logs to a file and grep the text for the desired stage in the output:sky launch ... | tee /tmp/skyout.log
cat /tmp/skyout.log | grep 'Successfully provisioned cluster' # Exits with 0 if the cluster setup was completed