Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit 72bd410

Browse files
committed
make everything work
1 parent c8a2b04 commit 72bd410

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

src/lattice/providers/example.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ def example_skypilot():
2929
config_path = os.path.join(os.path.dirname(__file__), "providers.yaml")
3030
provider = get_provider("skypilot", config_path=config_path)
3131

32-
# # Launch a cluster
33-
# print("1. Launching cluster...")
34-
# cluster_config = ClusterConfig(
35-
# # instance_type="g4dn.xlarge",
36-
# accelerators="RTX3090:1",
37-
# command="echo 'Hello from SkyPilot'",
38-
# )
39-
# result = provider.launch_cluster("my-cluster", cluster_config)
40-
# print(f" Result: {result}\n")
32+
# Launch a cluster
33+
print("1. Launching cluster...")
34+
cluster_config = ClusterConfig(
35+
# instance_type="g4dn.xlarge",
36+
accelerators="RTX3090:1",
37+
command="echo 'Hello from SkyPilot'",
38+
)
39+
result = provider.launch_cluster("my-cluster", cluster_config)
40+
print(f" Result: {result}\n")
4141

4242
# # Get cluster status
4343
# print("2. Getting cluster status...")
@@ -59,22 +59,23 @@ def example_skypilot():
5959
# job_result = provider.submit_job("my-cluster", job_config)
6060
# print(f" Job ID: {job_result.get('job_id')}\n")
6161

62-
# List jobs
63-
print("5. Listing jobs...")
64-
jobs = provider.list_jobs("my-cluster")
65-
for job in jobs:
66-
print(f" Job {job.job_id}: {job.state} - {job.job_name}")
62+
# # List jobs
63+
# print("5. Listing jobs...")
64+
# jobs = provider.list_jobs("my-cluster")
65+
# for job in jobs:
66+
# print(job)
67+
# print(f" Job {job.job_id}: {job.state} - {job.job_name}")
6768

68-
# # Get job logs
69+
# # # Get job logs
6970
# if jobs:
7071
# print(f"\n6. Getting logs for job {jobs[0].job_id}...")
7172
# logs = provider.get_job_logs("my-cluster", jobs[0].job_id, tail_lines=50)
72-
# print(f" Logs (first 200 chars): {str(logs)[:200]}...\n")
73+
# print(f" Logs: {str(logs)}...\n")
7374

74-
# # Stop cluster
75-
# print("7. Stopping cluster...")
76-
# stop_result = provider.stop_cluster("my-cluster")
77-
# print(f" Result: {stop_result}\n")
75+
# Stop cluster
76+
print("7. Stopping cluster...")
77+
stop_result = provider.stop_cluster("my-cluster")
78+
print(f" Result: {stop_result}\n")
7879

7980

8081
def example_slurm():

0 commit comments

Comments
 (0)