Skip to content

Commit c59884c

Browse files
Changes in docs for release: v0.16.0
1 parent 3e7b39e commit c59884c

File tree

3 files changed

+35
-458
lines changed

3 files changed

+35
-458
lines changed

docs/detailed-documentation/cluster/cluster.html

+32-63
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
121121
if self._job_submission_client:
122122
return self._job_submission_client
123123
if is_openshift_cluster():
124-
print(k8client.configuration.get_api_key_with_prefix(&#34;authorization&#34;))
125124
self._job_submission_client = JobSubmissionClient(
126125
self.cluster_dashboard_uri(),
127126
headers=self._client_headers,
@@ -212,7 +211,6 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
212211
mcad = self.config.mcad
213212
instance_types = self.config.machine_types
214213
env = self.config.envs
215-
local_interactive = self.config.local_interactive
216214
image_pull_secrets = self.config.image_pull_secrets
217215
dispatch_priority = self.config.dispatch_priority
218216
write_to_file = self.config.write_to_file
@@ -236,7 +234,6 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
236234
mcad=mcad,
237235
instance_types=instance_types,
238236
env=env,
239-
local_interactive=local_interactive,
240237
image_pull_secrets=image_pull_secrets,
241238
dispatch_priority=dispatch_priority,
242239
priority_val=priority_val,
@@ -512,13 +509,6 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
512509
verify_tls=True,
513510
):
514511
config_check()
515-
if (
516-
rc[&#34;metadata&#34;][&#34;annotations&#34;][&#34;sdk.codeflare.dev/local_interactive&#34;]
517-
== &#34;True&#34;
518-
):
519-
local_interactive = True
520-
else:
521-
local_interactive = False
522512
machine_types = (
523513
rc[&#34;metadata&#34;][&#34;labels&#34;][&#34;orderedinstance&#34;].split(&#34;_&#34;)
524514
if &#34;orderedinstance&#34; in rc[&#34;metadata&#34;][&#34;labels&#34;]
@@ -559,26 +549,34 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
559549
image=rc[&#34;spec&#34;][&#34;workerGroupSpecs&#34;][0][&#34;template&#34;][&#34;spec&#34;][&#34;containers&#34;][
560550
0
561551
][&#34;image&#34;],
562-
local_interactive=local_interactive,
563552
mcad=mcad,
564553
write_to_file=write_to_file,
565554
verify_tls=verify_tls,
566555
)
567556
return Cluster(cluster_config)
568557

569558
def local_client_url(self):
570-
if self.config.local_interactive == True:
571-
ingress_domain = _get_ingress_domain(self)
572-
return f&#34;ray://{ingress_domain}&#34;
573-
else:
574-
return &#34;None&#34;
559+
ingress_domain = _get_ingress_domain(self)
560+
return f&#34;ray://{ingress_domain}&#34;
575561

576562
def _component_resources_up(
577563
self, namespace: str, api_instance: client.CustomObjectsApi
578564
):
579565
if self.config.write_to_file:
580566
with open(self.app_wrapper_yaml) as f:
581-
yamls = yaml.load_all(f, Loader=yaml.FullLoader)
567+
yamls = list(yaml.load_all(f, Loader=yaml.FullLoader))
568+
for resource in yamls:
569+
enable_ingress = (
570+
resource.get(&#34;spec&#34;, {})
571+
.get(&#34;headGroupSpec&#34;, {})
572+
.get(&#34;enableIngress&#34;)
573+
)
574+
if resource[&#34;kind&#34;] == &#34;RayCluster&#34; and enable_ingress is not False:
575+
name = resource[&#34;metadata&#34;][&#34;name&#34;]
576+
print(
577+
f&#34;Forbidden: RayCluster &#39;{name}&#39; has &#39;enableIngress&#39; set to &#39;True&#39; or is unset.&#34;
578+
)
579+
return
582580
_create_resources(yamls, namespace, api_instance)
583581
else:
584582
yamls = yaml.load_all(self.app_wrapper_yaml, Loader=yaml.FullLoader)
@@ -699,13 +697,6 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
699697
plural=&#34;rayclusters&#34;,
700698
name=name,
701699
)
702-
elif resource[&#34;kind&#34;] == &#34;Secret&#34;:
703-
name = resource[&#34;metadata&#34;][&#34;name&#34;]
704-
secret_instance = client.CoreV1Api(api_config_handler())
705-
secret_instance.delete_namespaced_secret(
706-
namespace=namespace,
707-
name=name,
708-
)
709700

710701

711702
def _create_resources(yamls, namespace: str, api_instance: client.CustomObjectsApi):
@@ -718,12 +709,6 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
718709
plural=&#34;rayclusters&#34;,
719710
body=resource,
720711
)
721-
elif resource[&#34;kind&#34;] == &#34;Secret&#34;:
722-
secret_instance = client.CoreV1Api(api_config_handler())
723-
secret_instance.create_namespaced_secret(
724-
namespace=namespace,
725-
body=resource,
726-
)
727712

728713

729714
def _check_aw_exists(name: str, namespace: str) -&gt; bool:
@@ -1185,7 +1170,6 @@ <h2 class="section-title" id="header-classes">Classes</h2>
11851170
if self._job_submission_client:
11861171
return self._job_submission_client
11871172
if is_openshift_cluster():
1188-
print(k8client.configuration.get_api_key_with_prefix(&#34;authorization&#34;))
11891173
self._job_submission_client = JobSubmissionClient(
11901174
self.cluster_dashboard_uri(),
11911175
headers=self._client_headers,
@@ -1276,7 +1260,6 @@ <h2 class="section-title" id="header-classes">Classes</h2>
12761260
mcad = self.config.mcad
12771261
instance_types = self.config.machine_types
12781262
env = self.config.envs
1279-
local_interactive = self.config.local_interactive
12801263
image_pull_secrets = self.config.image_pull_secrets
12811264
dispatch_priority = self.config.dispatch_priority
12821265
write_to_file = self.config.write_to_file
@@ -1300,7 +1283,6 @@ <h2 class="section-title" id="header-classes">Classes</h2>
13001283
mcad=mcad,
13011284
instance_types=instance_types,
13021285
env=env,
1303-
local_interactive=local_interactive,
13041286
image_pull_secrets=image_pull_secrets,
13051287
dispatch_priority=dispatch_priority,
13061288
priority_val=priority_val,
@@ -1576,13 +1558,6 @@ <h2 class="section-title" id="header-classes">Classes</h2>
15761558
verify_tls=True,
15771559
):
15781560
config_check()
1579-
if (
1580-
rc[&#34;metadata&#34;][&#34;annotations&#34;][&#34;sdk.codeflare.dev/local_interactive&#34;]
1581-
== &#34;True&#34;
1582-
):
1583-
local_interactive = True
1584-
else:
1585-
local_interactive = False
15861561
machine_types = (
15871562
rc[&#34;metadata&#34;][&#34;labels&#34;][&#34;orderedinstance&#34;].split(&#34;_&#34;)
15881563
if &#34;orderedinstance&#34; in rc[&#34;metadata&#34;][&#34;labels&#34;]
@@ -1623,26 +1598,34 @@ <h2 class="section-title" id="header-classes">Classes</h2>
16231598
image=rc[&#34;spec&#34;][&#34;workerGroupSpecs&#34;][0][&#34;template&#34;][&#34;spec&#34;][&#34;containers&#34;][
16241599
0
16251600
][&#34;image&#34;],
1626-
local_interactive=local_interactive,
16271601
mcad=mcad,
16281602
write_to_file=write_to_file,
16291603
verify_tls=verify_tls,
16301604
)
16311605
return Cluster(cluster_config)
16321606

16331607
def local_client_url(self):
1634-
if self.config.local_interactive == True:
1635-
ingress_domain = _get_ingress_domain(self)
1636-
return f&#34;ray://{ingress_domain}&#34;
1637-
else:
1638-
return &#34;None&#34;
1608+
ingress_domain = _get_ingress_domain(self)
1609+
return f&#34;ray://{ingress_domain}&#34;
16391610

16401611
def _component_resources_up(
16411612
self, namespace: str, api_instance: client.CustomObjectsApi
16421613
):
16431614
if self.config.write_to_file:
16441615
with open(self.app_wrapper_yaml) as f:
1645-
yamls = yaml.load_all(f, Loader=yaml.FullLoader)
1616+
yamls = list(yaml.load_all(f, Loader=yaml.FullLoader))
1617+
for resource in yamls:
1618+
enable_ingress = (
1619+
resource.get(&#34;spec&#34;, {})
1620+
.get(&#34;headGroupSpec&#34;, {})
1621+
.get(&#34;enableIngress&#34;)
1622+
)
1623+
if resource[&#34;kind&#34;] == &#34;RayCluster&#34; and enable_ingress is not False:
1624+
name = resource[&#34;metadata&#34;][&#34;name&#34;]
1625+
print(
1626+
f&#34;Forbidden: RayCluster &#39;{name}&#39; has &#39;enableIngress&#39; set to &#39;True&#39; or is unset.&#34;
1627+
)
1628+
return
16461629
_create_resources(yamls, namespace, api_instance)
16471630
else:
16481631
yamls = yaml.load_all(self.app_wrapper_yaml, Loader=yaml.FullLoader)
@@ -1675,7 +1658,6 @@ <h3>Instance variables</h3>
16751658
if self._job_submission_client:
16761659
return self._job_submission_client
16771660
if is_openshift_cluster():
1678-
print(k8client.configuration.get_api_key_with_prefix(&#34;authorization&#34;))
16791661
self._job_submission_client = JobSubmissionClient(
16801662
self.cluster_dashboard_uri(),
16811663
headers=self._client_headers,
@@ -1824,7 +1806,6 @@ <h3>Methods</h3>
18241806
mcad = self.config.mcad
18251807
instance_types = self.config.machine_types
18261808
env = self.config.envs
1827-
local_interactive = self.config.local_interactive
18281809
image_pull_secrets = self.config.image_pull_secrets
18291810
dispatch_priority = self.config.dispatch_priority
18301811
write_to_file = self.config.write_to_file
@@ -1848,7 +1829,6 @@ <h3>Methods</h3>
18481829
mcad=mcad,
18491830
instance_types=instance_types,
18501831
env=env,
1851-
local_interactive=local_interactive,
18521832
image_pull_secrets=image_pull_secrets,
18531833
dispatch_priority=dispatch_priority,
18541834
priority_val=priority_val,
@@ -1953,13 +1933,6 @@ <h3>Methods</h3>
19531933
verify_tls=True,
19541934
):
19551935
config_check()
1956-
if (
1957-
rc[&#34;metadata&#34;][&#34;annotations&#34;][&#34;sdk.codeflare.dev/local_interactive&#34;]
1958-
== &#34;True&#34;
1959-
):
1960-
local_interactive = True
1961-
else:
1962-
local_interactive = False
19631936
machine_types = (
19641937
rc[&#34;metadata&#34;][&#34;labels&#34;][&#34;orderedinstance&#34;].split(&#34;_&#34;)
19651938
if &#34;orderedinstance&#34; in rc[&#34;metadata&#34;][&#34;labels&#34;]
@@ -2000,7 +1973,6 @@ <h3>Methods</h3>
20001973
image=rc[&#34;spec&#34;][&#34;workerGroupSpecs&#34;][0][&#34;template&#34;][&#34;spec&#34;][&#34;containers&#34;][
20011974
0
20021975
][&#34;image&#34;],
2003-
local_interactive=local_interactive,
20041976
mcad=mcad,
20051977
write_to_file=write_to_file,
20061978
verify_tls=verify_tls,
@@ -2092,11 +2064,8 @@ <h3>Methods</h3>
20922064
<span>Expand source code</span>
20932065
</summary>
20942066
<pre><code class="python">def local_client_url(self):
2095-
if self.config.local_interactive == True:
2096-
ingress_domain = _get_ingress_domain(self)
2097-
return f&#34;ray://{ingress_domain}&#34;
2098-
else:
2099-
return &#34;None&#34;</code></pre>
2067+
ingress_domain = _get_ingress_domain(self)
2068+
return f&#34;ray://{ingress_domain}&#34;</code></pre>
21002069
</details>
21012070
</dd>
21022071
<dt id="codeflare_sdk.cluster.cluster.Cluster.status"><code class="name flex">

docs/detailed-documentation/cluster/config.html

+1-8
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.config</code></h1>
8181
mcad: bool = False
8282
envs: dict = field(default_factory=dict)
8383
image: str = &#34;&#34;
84-
local_interactive: bool = False
8584
image_pull_secrets: list = field(default_factory=list)
8685
dispatch_priority: str = None
8786
write_to_file: bool = False
@@ -107,7 +106,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
107106
<dl>
108107
<dt id="codeflare_sdk.cluster.config.ClusterConfiguration"><code class="flex name class">
109108
<span>class <span class="ident">ClusterConfiguration</span></span>
110-
<span>(</span><span>name: str, namespace: str = None, head_info: list = &lt;factory&gt;, head_cpus: int = 2, head_memory: int = 8, head_gpus: int = 0, machine_types: list = &lt;factory&gt;, min_cpus: int = 1, max_cpus: int = 1, num_workers: int = 1, min_memory: int = 2, max_memory: int = 2, num_gpus: int = 0, template: str = '/home/runner/work/codeflare-sdk/codeflare-sdk/src/codeflare_sdk/templates/base-template.yaml', instascale: bool = False, mcad: bool = False, envs: dict = &lt;factory&gt;, image: str = '', local_interactive: bool = False, image_pull_secrets: list = &lt;factory&gt;, dispatch_priority: str = None, write_to_file: bool = False, verify_tls: bool = True, local_queue: str = None)</span>
109+
<span>(</span><span>name: str, namespace: str = None, head_info: list = &lt;factory&gt;, head_cpus: int = 2, head_memory: int = 8, head_gpus: int = 0, machine_types: list = &lt;factory&gt;, min_cpus: int = 1, max_cpus: int = 1, num_workers: int = 1, min_memory: int = 2, max_memory: int = 2, num_gpus: int = 0, template: str = '/home/runner/work/codeflare-sdk/codeflare-sdk/src/codeflare_sdk/templates/base-template.yaml', instascale: bool = False, mcad: bool = False, envs: dict = &lt;factory&gt;, image: str = '', image_pull_secrets: list = &lt;factory&gt;, dispatch_priority: str = None, write_to_file: bool = False, verify_tls: bool = True, local_queue: str = None)</span>
111110
</code></dt>
112111
<dd>
113112
<div class="desc"><p>This dataclass is used to specify resource requirements and other details, and
@@ -140,7 +139,6 @@ <h2 class="section-title" id="header-classes">Classes</h2>
140139
mcad: bool = False
141140
envs: dict = field(default_factory=dict)
142141
image: str = &#34;&#34;
143-
local_interactive: bool = False
144142
image_pull_secrets: list = field(default_factory=list)
145143
dispatch_priority: str = None
146144
write_to_file: bool = False
@@ -192,10 +190,6 @@ <h3>Class variables</h3>
192190
<dd>
193191
<div class="desc"></div>
194192
</dd>
195-
<dt id="codeflare_sdk.cluster.config.ClusterConfiguration.local_interactive"><code class="name">var <span class="ident">local_interactive</span> : bool</code></dt>
196-
<dd>
197-
<div class="desc"></div>
198-
</dd>
199193
<dt id="codeflare_sdk.cluster.config.ClusterConfiguration.local_queue"><code class="name">var <span class="ident">local_queue</span> : str</code></dt>
200194
<dd>
201195
<div class="desc"></div>
@@ -282,7 +276,6 @@ <h4><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration" href="#co
282276
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.image" href="#codeflare_sdk.cluster.config.ClusterConfiguration.image">image</a></code></li>
283277
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.image_pull_secrets" href="#codeflare_sdk.cluster.config.ClusterConfiguration.image_pull_secrets">image_pull_secrets</a></code></li>
284278
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.instascale" href="#codeflare_sdk.cluster.config.ClusterConfiguration.instascale">instascale</a></code></li>
285-
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.local_interactive" href="#codeflare_sdk.cluster.config.ClusterConfiguration.local_interactive">local_interactive</a></code></li>
286279
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.local_queue" href="#codeflare_sdk.cluster.config.ClusterConfiguration.local_queue">local_queue</a></code></li>
287280
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.machine_types" href="#codeflare_sdk.cluster.config.ClusterConfiguration.machine_types">machine_types</a></code></li>
288281
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.max_cpus" href="#codeflare_sdk.cluster.config.ClusterConfiguration.max_cpus">max_cpus</a></code></li>

0 commit comments

Comments
 (0)