Skip to content

Commit

Permalink
[OCI] Set default image to ubuntu LTS 22.04 (#4517)
Browse files Browse the repository at this point in the history
* set default gpu image to skypilot:gpu-ubuntu-2204

* add example

* remove comment line

* set cpu default image to 2204

* update change history
  • Loading branch information
HysunHe authored Jan 3, 2025
1 parent 8d762dd commit 6a6d667
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 2 deletions.
33 changes: 33 additions & 0 deletions examples/oci/gpu-oraclelinux9.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: gpu-task

resources:
# Optional; if left out, automatically pick the cheapest cloud.
cloud: oci

accelerators: A10:1

disk_size: 1024

disk_tier: high

image_id: skypilot:gpu-oraclelinux9


# Working directory (optional) containing the project codebase.
# Its contents are synced to ~/sky_workdir/ on the cluster.
workdir: .

num_nodes: 1

# Typical use: pip install -r requirements.txt
# Invoked under the workdir (i.e., can use its files).
setup: |
echo "*** Running setup. ***"
# Typical use: make use of resources, such as running training.
# Invoked under the workdir (i.e., can use its files).
run: |
echo "*** Running the task on OCI ***"
echo "hello, world"
nvidia-smi
echo "The task is completed."
33 changes: 33 additions & 0 deletions examples/oci/gpu-ubuntu-2204.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: gpu-task

resources:
# Optional; if left out, automatically pick the cheapest cloud.
cloud: oci

accelerators: A10:1

disk_size: 1024

disk_tier: high

image_id: skypilot:gpu-ubuntu-2204


# Working directory (optional) containing the project codebase.
# Its contents are synced to ~/sky_workdir/ on the cluster.
workdir: .

num_nodes: 1

# Typical use: pip install -r requirements.txt
# Invoked under the workdir (i.e., can use its files).
setup: |
echo "*** Running setup. ***"
# Typical use: make use of resources, such as running training.
# Invoked under the workdir (i.e., can use its files).
run: |
echo "*** Running the task on OCI ***"
echo "hello, world"
nvidia-smi
echo "The task is completed."
8 changes: 6 additions & 2 deletions sky/clouds/utils/oci_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
configuration.
- Hysun He ([email protected]) @ Nov.12, 2024: Add the constant
SERVICE_PORT_RULE_TAG
- Hysun He ([email protected]) @ Jan.01, 2025: Set the default image
from ubuntu 20.04 to ubuntu 22.04, including:
- GPU: skypilot:gpu-ubuntu-2004 -> skypilot:gpu-ubuntu-2204
- CPU: skypilot:cpu-ubuntu-2004 -> skypilot:cpu-ubuntu-2204
"""
import os

Expand Down Expand Up @@ -117,15 +121,15 @@ def get_default_gpu_image_tag(cls) -> str:
# the sky's user-config file (if not specified, use the hardcode one at
# last)
return skypilot_config.get_nested(('oci', 'default', 'image_tag_gpu'),
'skypilot:gpu-ubuntu-2004')
'skypilot:gpu-ubuntu-2204')

@classmethod
def get_default_image_tag(cls) -> str:
# Get the default image tag. Instead of hardcoding, we give a choice to
# set the default image tag in the sky's user-config file. (if not
# specified, use the hardcode one at last)
return skypilot_config.get_nested(
('oci', 'default', 'image_tag_general'), 'skypilot:cpu-ubuntu-2004')
('oci', 'default', 'image_tag_general'), 'skypilot:cpu-ubuntu-2204')

@classmethod
def get_sky_user_config_file(cls) -> str:
Expand Down

0 comments on commit 6a6d667

Please sign in to comment.