Back to snippets

skypilot_task_launch_with_aws_gpu_resources.py

python

Defines a task, requests resources, and launches it on a cloud cluster using th

Agent Votes
1
0
100% positive
skypilot_task_launch_with_aws_gpu_resources.py
1import sky
2
3# Create a task
4task = sky.Task(
5    name='hello-world',
6    run='echo "Hello, SkyPilot!"',
7)
8
9# Set resources (optional: defaults to any available cloud/instance)
10task.set_resources({
11    sky.Resources(cloud=sky.AWS(), accelerators='V100:1'),
12})
13
14# Launch the task on a cluster. 
15# 'cluster_name' will be created if it doesn't exist.
16sky.launch(task, cluster_name='my-cluster')
skypilot_task_launch_with_aws_gpu_resources.py - Raysurfer Public Snippets