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

[k8s] Use images.csv catalog to get container image tags #2556

Merged
merged 6 commits into from
Sep 15, 2023

Conversation

romilbhardwaj
Copy link
Collaborator

@romilbhardwaj romilbhardwaj commented Sep 14, 2023

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.

Copy link
Collaborator

@landscapepainter landscapepainter left a 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.
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
mapping SkyPilot image tags to corresponding container image tags.
mapping SkyPilot image tags to corresponding container image ids.

Copy link
Collaborator Author

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.

Comment on lines 204 to 211
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')
Copy link
Collaborator

@landscapepainter landscapepainter Sep 15, 2023

Choose a reason for hiding this comment

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

Suggested change
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?

Copy link
Collaborator Author

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?

sky/clouds/service_catalog/constants.py Outdated Show resolved Hide resolved
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.

LGTM.

sky/clouds/kubernetes.py Outdated Show resolved Hide resolved
@romilbhardwaj
Copy link
Collaborator Author

Thanks for the feedback @landscapepainter and @Michaelvll! Merging now.

@romilbhardwaj romilbhardwaj merged commit 2240180 into master Sep 15, 2023
18 checks passed
@romilbhardwaj romilbhardwaj deleted the k8s_image_catalog branch September 15, 2023 05:54
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.

[k8s] Use images.csv for storing SkyPilot image tags
3 participants