Skip to content

Commit 73cdb54

Browse files
authored
v0.4.0 Release Prep (#80)
1 parent 35b1abd commit 73cdb54

File tree

9 files changed

+725
-17
lines changed

9 files changed

+725
-17
lines changed

custom-nb-image/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ RUN pip install -r requirements.txt
2323
RUN pip uninstall pickle5 -y
2424

2525
# Install codeflare-sdk and other libraries
26-
RUN pip install codeflare-sdk==0.3.1 \
26+
RUN pip install codeflare-sdk==0.4.0 \
2727
datasets==2.6.1 \
2828
transformers==4.23.1 \
2929
evaluate==0.3.0 \

custom-nb-image/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sdk0.3.1-v1
1+
sdk0.4.0-v1

docs/cluster/auth.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.auth</code></h1>
103103
args.append(&#34;--insecure-skip-tls-verify&#34;)
104104
try:
105105
response = oc.invoke(&#34;login&#34;, args)
106-
except OpenShiftPythonException as osp:
106+
except OpenShiftPythonException as osp: # pragma: no cover
107107
error_msg = osp.result.err()
108108
if &#34;The server uses a certificate signed by unknown authority&#34; in error_msg:
109109
return &#34;Error: certificate auth failure, please set `skip_tls=True` in TokenAuthentication&#34;
@@ -360,7 +360,7 @@ <h3>Methods</h3>
360360
args.append(&#34;--insecure-skip-tls-verify&#34;)
361361
try:
362362
response = oc.invoke(&#34;login&#34;, args)
363-
except OpenShiftPythonException as osp:
363+
except OpenShiftPythonException as osp: # pragma: no cover
364364
error_msg = osp.result.err()
365365
if &#34;The server uses a certificate signed by unknown authority&#34; in error_msg:
366366
return &#34;Error: certificate auth failure, please set `skip_tls=True` in TokenAuthentication&#34;
@@ -406,7 +406,7 @@ <h3>Methods</h3>
406406
args.append(&#34;--insecure-skip-tls-verify&#34;)
407407
try:
408408
response = oc.invoke(&#34;login&#34;, args)
409-
except OpenShiftPythonException as osp:
409+
except OpenShiftPythonException as osp: # pragma: no cover
410410
error_msg = osp.result.err()
411411
if &#34;The server uses a certificate signed by unknown authority&#34; in error_msg:
412412
return &#34;Error: certificate auth failure, please set `skip_tls=True` in TokenAuthentication&#34;

docs/cluster/cluster.html

+71-6
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
5252

5353
from os import stat
5454
from time import sleep
55-
from typing import List, Optional, Tuple
55+
from typing import List, Optional, Tuple, Dict
5656

5757
import openshift as oc
5858
from ray.job_submission import JobSubmissionClient
@@ -77,6 +77,8 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
7777
Note that currently, the underlying implementation is a Ray cluster.
7878
&#34;&#34;&#34;
7979

80+
torchx_scheduler = &#34;ray&#34;
81+
8082
def __init__(self, config: ClusterConfiguration):
8183
&#34;&#34;&#34;
8284
Create the resource cluster object by passing in a ClusterConfiguration
@@ -222,7 +224,7 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
222224
if status == CodeFlareClusterStatus.UNKNOWN:
223225
pretty_print.print_no_resources_found()
224226
else:
225-
pretty_print.print_app_wrappers_status([appwrapper])
227+
pretty_print.print_app_wrappers_status([appwrapper], starting=True)
226228

227229
return status, ready
228230

@@ -300,6 +302,20 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
300302
client = JobSubmissionClient(dashboard_route)
301303
return client.get_job_logs(job_id)
302304

305+
def torchx_config(
306+
self, working_dir: str = None, requirements: str = None
307+
) -&gt; Dict[str, str]:
308+
dashboard_address = f&#34;{self.cluster_dashboard_uri().lstrip(&#39;http://&#39;)}&#34;
309+
to_return = {
310+
&#34;cluster_name&#34;: self.config.name,
311+
&#34;dashboard_address&#34;: dashboard_address,
312+
}
313+
if working_dir:
314+
to_return[&#34;working_dir&#34;] = working_dir
315+
if requirements:
316+
to_return[&#34;requirements&#34;] = requirements
317+
return to_return
318+
303319

304320
def get_current_namespace() -&gt; str:
305321
&#34;&#34;&#34;
@@ -621,6 +637,8 @@ <h2 class="section-title" id="header-classes">Classes</h2>
621637
Note that currently, the underlying implementation is a Ray cluster.
622638
&#34;&#34;&#34;
623639

640+
torchx_scheduler = &#34;ray&#34;
641+
624642
def __init__(self, config: ClusterConfiguration):
625643
&#34;&#34;&#34;
626644
Create the resource cluster object by passing in a ClusterConfiguration
@@ -766,7 +784,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
766784
if status == CodeFlareClusterStatus.UNKNOWN:
767785
pretty_print.print_no_resources_found()
768786
else:
769-
pretty_print.print_app_wrappers_status([appwrapper])
787+
pretty_print.print_app_wrappers_status([appwrapper], starting=True)
770788

771789
return status, ready
772790

@@ -842,8 +860,29 @@ <h2 class="section-title" id="header-classes">Classes</h2>
842860
&#34;&#34;&#34;
843861
dashboard_route = self.cluster_dashboard_uri()
844862
client = JobSubmissionClient(dashboard_route)
845-
return client.get_job_logs(job_id)</code></pre>
863+
return client.get_job_logs(job_id)
864+
865+
def torchx_config(
866+
self, working_dir: str = None, requirements: str = None
867+
) -&gt; Dict[str, str]:
868+
dashboard_address = f&#34;{self.cluster_dashboard_uri().lstrip(&#39;http://&#39;)}&#34;
869+
to_return = {
870+
&#34;cluster_name&#34;: self.config.name,
871+
&#34;dashboard_address&#34;: dashboard_address,
872+
}
873+
if working_dir:
874+
to_return[&#34;working_dir&#34;] = working_dir
875+
if requirements:
876+
to_return[&#34;requirements&#34;] = requirements
877+
return to_return</code></pre>
846878
</details>
879+
<h3>Class variables</h3>
880+
<dl>
881+
<dt id="codeflare_sdk.cluster.cluster.Cluster.torchx_scheduler"><code class="name">var <span class="ident">torchx_scheduler</span></code></dt>
882+
<dd>
883+
<div class="desc"></div>
884+
</dd>
885+
</dl>
847886
<h3>Methods</h3>
848887
<dl>
849888
<dt id="codeflare_sdk.cluster.cluster.Cluster.cluster_dashboard_uri"><code class="name flex">
@@ -1022,7 +1061,7 @@ <h3>Methods</h3>
10221061
</details>
10231062
</dd>
10241063
<dt id="codeflare_sdk.cluster.cluster.Cluster.list_jobs"><code class="name flex">
1025-
<span>def <span class="ident">list_jobs</span></span>(<span>self) ‑> List</span>
1064+
<span>def <span class="ident">list_jobs</span></span>(<span>self) ‑> List[~T]</span>
10261065
</code></dt>
10271066
<dd>
10281067
<div class="desc"><p>This method accesses the head ray node in your cluster and lists the running jobs.</p></div>
@@ -1106,11 +1145,35 @@ <h3>Methods</h3>
11061145
if status == CodeFlareClusterStatus.UNKNOWN:
11071146
pretty_print.print_no_resources_found()
11081147
else:
1109-
pretty_print.print_app_wrappers_status([appwrapper])
1148+
pretty_print.print_app_wrappers_status([appwrapper], starting=True)
11101149

11111150
return status, ready</code></pre>
11121151
</details>
11131152
</dd>
1153+
<dt id="codeflare_sdk.cluster.cluster.Cluster.torchx_config"><code class="name flex">
1154+
<span>def <span class="ident">torchx_config</span></span>(<span>self, working_dir: str = None, requirements: str = None) ‑> Dict[str, str]</span>
1155+
</code></dt>
1156+
<dd>
1157+
<div class="desc"></div>
1158+
<details class="source">
1159+
<summary>
1160+
<span>Expand source code</span>
1161+
</summary>
1162+
<pre><code class="python">def torchx_config(
1163+
self, working_dir: str = None, requirements: str = None
1164+
) -&gt; Dict[str, str]:
1165+
dashboard_address = f&#34;{self.cluster_dashboard_uri().lstrip(&#39;http://&#39;)}&#34;
1166+
to_return = {
1167+
&#34;cluster_name&#34;: self.config.name,
1168+
&#34;dashboard_address&#34;: dashboard_address,
1169+
}
1170+
if working_dir:
1171+
to_return[&#34;working_dir&#34;] = working_dir
1172+
if requirements:
1173+
to_return[&#34;requirements&#34;] = requirements
1174+
return to_return</code></pre>
1175+
</details>
1176+
</dd>
11141177
<dt id="codeflare_sdk.cluster.cluster.Cluster.up"><code class="name flex">
11151178
<span>def <span class="ident">up</span></span>(<span>self)</span>
11161179
</code></dt>
@@ -1209,6 +1272,8 @@ <h4><code><a title="codeflare_sdk.cluster.cluster.Cluster" href="#codeflare_sdk.
12091272
<li><code><a title="codeflare_sdk.cluster.cluster.Cluster.job_status" href="#codeflare_sdk.cluster.cluster.Cluster.job_status">job_status</a></code></li>
12101273
<li><code><a title="codeflare_sdk.cluster.cluster.Cluster.list_jobs" href="#codeflare_sdk.cluster.cluster.Cluster.list_jobs">list_jobs</a></code></li>
12111274
<li><code><a title="codeflare_sdk.cluster.cluster.Cluster.status" href="#codeflare_sdk.cluster.cluster.Cluster.status">status</a></code></li>
1275+
<li><code><a title="codeflare_sdk.cluster.cluster.Cluster.torchx_config" href="#codeflare_sdk.cluster.cluster.Cluster.torchx_config">torchx_config</a></code></li>
1276+
<li><code><a title="codeflare_sdk.cluster.cluster.Cluster.torchx_scheduler" href="#codeflare_sdk.cluster.cluster.Cluster.torchx_scheduler">torchx_scheduler</a></code></li>
12121277
<li><code><a title="codeflare_sdk.cluster.cluster.Cluster.up" href="#codeflare_sdk.cluster.cluster.Cluster.up">up</a></code></li>
12131278
<li><code><a title="codeflare_sdk.cluster.cluster.Cluster.wait_ready" href="#codeflare_sdk.cluster.cluster.Cluster.wait_ready">wait_ready</a></code></li>
12141279
</ul>

docs/index.html

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ <h2 class="section-title" id="header-submodules">Sub-modules</h2>
3030
<dd>
3131
<div class="desc"></div>
3232
</dd>
33+
<dt><code class="name"><a title="codeflare_sdk.job" href="job/index.html">codeflare_sdk.job</a></code></dt>
34+
<dd>
35+
<div class="desc"></div>
36+
</dd>
3337
<dt><code class="name"><a title="codeflare_sdk.utils" href="utils/index.html">codeflare_sdk.utils</a></code></dt>
3438
<dd>
3539
<div class="desc"></div>
@@ -52,6 +56,7 @@ <h1>Index</h1>
5256
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
5357
<ul>
5458
<li><code><a title="codeflare_sdk.cluster" href="cluster/index.html">codeflare_sdk.cluster</a></code></li>
59+
<li><code><a title="codeflare_sdk.job" href="job/index.html">codeflare_sdk.job</a></code></li>
5560
<li><code><a title="codeflare_sdk.utils" href="utils/index.html">codeflare_sdk.utils</a></code></li>
5661
</ul>
5762
</li>

docs/job/index.html

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
6+
<meta name="generator" content="pdoc 0.10.0" />
7+
<title>codeflare_sdk.job API documentation</title>
8+
<meta name="description" content="" />
9+
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
10+
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
11+
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
12+
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
13+
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
14+
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
15+
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
16+
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
17+
</head>
18+
<body>
19+
<main>
20+
<article id="content">
21+
<header>
22+
<h1 class="title">Module <code>codeflare_sdk.job</code></h1>
23+
</header>
24+
<section id="section-intro">
25+
</section>
26+
<section>
27+
<h2 class="section-title" id="header-submodules">Sub-modules</h2>
28+
<dl>
29+
<dt><code class="name"><a title="codeflare_sdk.job.jobs" href="jobs.html">codeflare_sdk.job.jobs</a></code></dt>
30+
<dd>
31+
<div class="desc"></div>
32+
</dd>
33+
</dl>
34+
</section>
35+
<section>
36+
</section>
37+
<section>
38+
</section>
39+
<section>
40+
</section>
41+
</article>
42+
<nav id="sidebar">
43+
<h1>Index</h1>
44+
<div class="toc">
45+
<ul></ul>
46+
</div>
47+
<ul id="index">
48+
<li><h3>Super-module</h3>
49+
<ul>
50+
<li><code><a title="codeflare_sdk" href="../index.html">codeflare_sdk</a></code></li>
51+
</ul>
52+
</li>
53+
<li><h3><a href="#header-submodules">Sub-modules</a></h3>
54+
<ul>
55+
<li><code><a title="codeflare_sdk.job.jobs" href="jobs.html">codeflare_sdk.job.jobs</a></code></li>
56+
</ul>
57+
</li>
58+
</ul>
59+
</nav>
60+
</main>
61+
<footer id="footer">
62+
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
63+
</footer>
64+
</body>
65+
</html>

0 commit comments

Comments
 (0)