|
16 | 16 | "outputs": [], |
17 | 17 | "source": [ |
18 | 18 | "# Import pieces from codeflare-sdk\n", |
19 | | - "from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication" |
| 19 | + "from codeflare_sdk import RayCluster, TokenAuthentication" |
20 | 20 | ] |
21 | 21 | }, |
22 | 22 | { |
|
62 | 62 | "# Create and configure our cluster object\n", |
63 | 63 | "# The SDK will try to find the name of your default local queue based on the annotation \"kueue.x-k8s.io/default-queue\": \"true\" unless you specify the local queue manually below\n", |
64 | 64 | "cluster_name = \"interactivetest\"\n", |
65 | | - "cluster = Cluster(ClusterConfiguration(\n", |
| 65 | + "cluster = RayCluster(\n", |
66 | 66 | " name=cluster_name,\n", |
67 | 67 | " head_cpu_requests=1,\n", |
68 | 68 | " head_cpu_limits=1,\n", |
69 | 69 | " head_memory_requests=6,\n", |
70 | 70 | " head_memory_limits=8,\n", |
71 | | - " head_extended_resource_requests={'nvidia.com/gpu':1}, # For GPU enabled workloads set the head_extended_resource_requests and worker_extended_resource_requests\n", |
72 | | - " worker_extended_resource_requests={'nvidia.com/gpu':1},\n", |
| 71 | + " head_accelerators={'nvidia.com/gpu':1}, # For GPU enabled workloads set the head_accelerators and worker_accelerators\n", |
| 72 | + " worker_accelerators={'nvidia.com/gpu':1},\n", |
73 | 73 | " num_workers=2,\n", |
74 | 74 | " worker_cpu_requests='250m',\n", |
75 | 75 | " worker_cpu_limits=1,\n", |
76 | 76 | " worker_memory_requests=4,\n", |
77 | 77 | " worker_memory_limits=6,\n", |
78 | 78 | " # image=\"\", # Optional Field \n", |
79 | | - " write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n", |
80 | 79 | " # local_queue=\"local-queue-name\" # Specify the local queue manually\n", |
81 | | - "))" |
| 80 | + ")" |
82 | 81 | ] |
83 | 82 | }, |
84 | 83 | { |
|
151 | 150 | "source": [ |
152 | 151 | "from codeflare_sdk import generate_cert\n", |
153 | 152 | "# Create required TLS cert and export the environment variables to enable TLS\n", |
154 | | - "generate_cert.generate_tls_cert(cluster_name, cluster.config.namespace)\n", |
155 | | - "generate_cert.export_env(cluster_name, cluster.config.namespace)" |
| 153 | + "generate_cert.generate_tls_cert(cluster_name, cluster.namespace)\n", |
| 154 | + "generate_cert.export_env(cluster_name, cluster.namespace)" |
156 | 155 | ] |
157 | 156 | }, |
158 | 157 | { |
|
0 commit comments