Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hourly price and instance type to env SKYPILOT_CLUSTER_INFO #4326

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tylerweitzman
Copy link

Adds the following KV to the SKYPILOT_CLUSTER_INFO json dump

{...
'hourly_price': handle.get_hourly_price(),
'instance_type': handle.launched_resources.instance_type,
}

Ran an existing workflow with it to see the values successfully added

{"cluster_name": "sky-e72c-ubuntu", "cloud": "GCP", "region": "us-central1", "zone": "us-central1-a", "hourly_price": 0.26203, "instance_type": "n2-highmem-4"}

Copy link
Collaborator

@Michaelvll Michaelvll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these new info @tylerweitzman! LGTM.

A future TODO: add these new information into our docs: https://skypilot.readthedocs.io/en/latest/running-jobs/environment-variables.html#environment-variables-for-run

Could you help run format.sh in the root folder of the repo to get our CI passed?

@@ -203,7 +203,7 @@ def get_cluster_info(
instances[instance_id] = [
common.InstanceInfo(
instance_id=instance_id,
internal_ip=instance_info['private_ip'],
internal_ip=instance_info.get('private_ip', instance_info.get('ip')), # Fallback to public IP if private not available
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
internal_ip=instance_info.get('private_ip', instance_info.get('ip')), # Fallback to public IP if private not available
# Fallback to public IP if private not available
internal_ip=instance_info.get('private_ip', instance_info.get('ip')),

This may fix the linting/formating issue : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants