-
Notifications
You must be signed in to change notification settings - Fork 532
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
[k8s] Use images.csv
catalog to get container image tags
#2556
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome @romilbhardwaj. Left some comments. Tested out and it works smoothly. This should be good to go after.
"""Kubernetes Catalog. | ||
|
||
Kubernetes does not require a catalog of instances, but we need an image catalog | ||
mapping SkyPilot image tags to corresponding container image tags. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mapping SkyPilot image tags to corresponding container image tags. | |
mapping SkyPilot image tags to corresponding container image ids. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, they are still container image tags (e.g., ubuntu:latest
), since container image ids are hex values and are typically not used to specify images to use.
sky/clouds/kubernetes.py
Outdated
image_id = self.IMAGE_GPU if acc_count > 0 else self.IMAGE_CPU | ||
# Get the container image ID from the service catalog. | ||
# Note that currently we do not support custom images, so this condition | ||
# will always be triggered. In the future we may want to get image_id | ||
# from the resources object if it is set. | ||
if image_id.startswith('skypilot:'): | ||
image_id = service_catalog.get_image_id_from_tag( | ||
image_id, clouds='kubernetes') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image_id = self.IMAGE_GPU if acc_count > 0 else self.IMAGE_CPU | |
# Get the container image ID from the service catalog. | |
# Note that currently we do not support custom images, so this condition | |
# will always be triggered. In the future we may want to get image_id | |
# from the resources object if it is set. | |
if image_id.startswith('skypilot:'): | |
image_id = service_catalog.get_image_id_from_tag( | |
image_id, clouds='kubernetes') | |
image_id = None | |
image_tag = self.IMAGE_GPU if acc_count > 0 else self.IMAGE_CPU | |
# Get the container image ID from the service catalog. | |
# Note that currently we do not support custom images, so this condition | |
# will always be triggered. In the future we may want to get image_id | |
# from the resources object if it is set. | |
if image_tag.startswith('skypilot:'): | |
image_id = service_catalog.get_image_id_from_tag( | |
image_tag, clouds='kubernetes') |
Perhaps we should separate between image_tag
and image_id
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, its a bit ambiguous here. However, since the image_id can also come from resources
in the future, perhaps its best to leave image_id
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks for the feedback @landscapepainter and @Michaelvll! Merging now. |
Closes #2430.
We now use
images.csv
to store a mapping of skypilot image tags to actual container registry tags. This will allow us to push updates to the path/tag of the default k8s image used without having to update clients. Previously, these container tags were hardcoded in kubernetes.py.bash format.sh
sky launch -c mycluster --cloud kubernetes
constants.py
after [k8s] Addimages.csv
for Kubernetes skypilot-catalog#47 is merged.