Skip to content

Changes in docs for release: v0.9.0 #381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 88 additions & 19 deletions docs/cluster/cluster.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>

name = self.config.name
namespace = self.config.namespace
head_cpus = self.config.head_cpus
head_memory = self.config.head_memory
head_gpus = self.config.head_gpus
min_cpu = self.config.min_cpus
max_cpu = self.config.max_cpus
min_memory = self.config.min_memory
Expand All @@ -158,6 +161,9 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
return generate_appwrapper(
name=name,
namespace=namespace,
head_cpus=head_cpus,
head_memory=head_memory,
head_gpus=head_gpus,
min_cpu=min_cpu,
max_cpu=max_cpu,
min_memory=min_memory,
Expand Down Expand Up @@ -290,7 +296,7 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
else:
return False

def wait_ready(self, timeout: Optional[int] = None):
def wait_ready(self, timeout: Optional[int] = None, dashboard_check: bool = True):
&#34;&#34;&#34;
Waits for requested cluster to be ready, up to an optional timeout (s).
Checks every five seconds.
Expand All @@ -300,19 +306,32 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
dashboard_ready = False
status = None
time = 0
while not ready or not dashboard_ready:
while not ready:
status, ready = self.status(print_to_console=False)
dashboard_ready = self.is_dashboard_ready()
if status == CodeFlareClusterStatus.UNKNOWN:
print(
&#34;WARNING: Current cluster status is unknown, have you run cluster.up yet?&#34;
)
if not ready or not dashboard_ready:
if not ready:
if timeout and time &gt;= timeout:
raise TimeoutError(
f&#34;wait() timed out after waiting {timeout}s for cluster to be ready&#34;
)
sleep(5)
time += 5
print(&#34;Requested cluster is up and running!&#34;)

while dashboard_check and not dashboard_ready:
dashboard_ready = self.is_dashboard_ready()
if not dashboard_ready:
if timeout and time &gt;= timeout:
raise TimeoutError(f&#34;wait() timed out after waiting {timeout}s&#34;)
raise TimeoutError(
f&#34;wait() timed out after waiting {timeout}s for dashboard to be ready&#34;
)
sleep(5)
time += 5
print(&#34;Requested cluster and dashboard are up and running!&#34;)
if dashboard_ready:
print(&#34;Dashboard is ready!&#34;)

def details(self, print_to_console: bool = True) -&gt; RayCluster:
cluster = _copy_to_ray(self)
Expand Down Expand Up @@ -640,6 +659,15 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
worker_gpu=0, # hard to detect currently how many gpus, can override it with what the user asked for
namespace=rc[&#34;metadata&#34;][&#34;namespace&#34;],
dashboard=ray_route,
head_cpus=rc[&#34;spec&#34;][&#34;headGroupSpec&#34;][&#34;template&#34;][&#34;spec&#34;][&#34;containers&#34;][0][
&#34;resources&#34;
][&#34;limits&#34;][&#34;cpu&#34;],
head_mem=rc[&#34;spec&#34;][&#34;headGroupSpec&#34;][&#34;template&#34;][&#34;spec&#34;][&#34;containers&#34;][0][
&#34;resources&#34;
][&#34;limits&#34;][&#34;memory&#34;],
head_gpu=rc[&#34;spec&#34;][&#34;headGroupSpec&#34;][&#34;template&#34;][&#34;spec&#34;][&#34;containers&#34;][0][
&#34;resources&#34;
][&#34;limits&#34;][&#34;nvidia.com/gpu&#34;],
)


Expand Down Expand Up @@ -670,6 +698,9 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.cluster</code></h1>
worker_gpu=cluster.config.num_gpus,
namespace=cluster.config.namespace,
dashboard=cluster.cluster_dashboard_uri(),
head_cpus=cluster.config.head_cpus,
head_mem=cluster.config.head_memory,
head_gpu=cluster.config.head_gpus,
)
if ray.status == CodeFlareClusterStatus.READY:
ray.status = RayClusterStatus.READY
Expand Down Expand Up @@ -879,6 +910,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>

name = self.config.name
namespace = self.config.namespace
head_cpus = self.config.head_cpus
head_memory = self.config.head_memory
head_gpus = self.config.head_gpus
min_cpu = self.config.min_cpus
max_cpu = self.config.max_cpus
min_memory = self.config.min_memory
Expand All @@ -896,6 +930,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>
return generate_appwrapper(
name=name,
namespace=namespace,
head_cpus=head_cpus,
head_memory=head_memory,
head_gpus=head_gpus,
min_cpu=min_cpu,
max_cpu=max_cpu,
min_memory=min_memory,
Expand Down Expand Up @@ -1028,7 +1065,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
else:
return False

def wait_ready(self, timeout: Optional[int] = None):
def wait_ready(self, timeout: Optional[int] = None, dashboard_check: bool = True):
&#34;&#34;&#34;
Waits for requested cluster to be ready, up to an optional timeout (s).
Checks every five seconds.
Expand All @@ -1038,19 +1075,32 @@ <h2 class="section-title" id="header-classes">Classes</h2>
dashboard_ready = False
status = None
time = 0
while not ready or not dashboard_ready:
while not ready:
status, ready = self.status(print_to_console=False)
dashboard_ready = self.is_dashboard_ready()
if status == CodeFlareClusterStatus.UNKNOWN:
print(
&#34;WARNING: Current cluster status is unknown, have you run cluster.up yet?&#34;
)
if not ready or not dashboard_ready:
if not ready:
if timeout and time &gt;= timeout:
raise TimeoutError(
f&#34;wait() timed out after waiting {timeout}s for cluster to be ready&#34;
)
sleep(5)
time += 5
print(&#34;Requested cluster is up and running!&#34;)

while dashboard_check and not dashboard_ready:
dashboard_ready = self.is_dashboard_ready()
if not dashboard_ready:
if timeout and time &gt;= timeout:
raise TimeoutError(f&#34;wait() timed out after waiting {timeout}s&#34;)
raise TimeoutError(
f&#34;wait() timed out after waiting {timeout}s for dashboard to be ready&#34;
)
sleep(5)
time += 5
print(&#34;Requested cluster and dashboard are up and running!&#34;)
if dashboard_ready:
print(&#34;Dashboard is ready!&#34;)

def details(self, print_to_console: bool = True) -&gt; RayCluster:
cluster = _copy_to_ray(self)
Expand Down Expand Up @@ -1267,6 +1317,9 @@ <h3>Methods</h3>

name = self.config.name
namespace = self.config.namespace
head_cpus = self.config.head_cpus
head_memory = self.config.head_memory
head_gpus = self.config.head_gpus
min_cpu = self.config.min_cpus
max_cpu = self.config.max_cpus
min_memory = self.config.min_memory
Expand All @@ -1284,6 +1337,9 @@ <h3>Methods</h3>
return generate_appwrapper(
name=name,
namespace=namespace,
head_cpus=head_cpus,
head_memory=head_memory,
head_gpus=head_gpus,
min_cpu=min_cpu,
max_cpu=max_cpu,
min_memory=min_memory,
Expand Down Expand Up @@ -1653,7 +1709,7 @@ <h3>Methods</h3>
</details>
</dd>
<dt id="codeflare_sdk.cluster.cluster.Cluster.wait_ready"><code class="name flex">
<span>def <span class="ident">wait_ready</span></span>(<span>self, timeout: Optional[int] = None)</span>
<span>def <span class="ident">wait_ready</span></span>(<span>self, timeout: Optional[int] = None, dashboard_check: bool = True)</span>
</code></dt>
<dd>
<div class="desc"><p>Waits for requested cluster to be ready, up to an optional timeout (s).
Expand All @@ -1662,7 +1718,7 @@ <h3>Methods</h3>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def wait_ready(self, timeout: Optional[int] = None):
<pre><code class="python">def wait_ready(self, timeout: Optional[int] = None, dashboard_check: bool = True):
&#34;&#34;&#34;
Waits for requested cluster to be ready, up to an optional timeout (s).
Checks every five seconds.
Expand All @@ -1672,19 +1728,32 @@ <h3>Methods</h3>
dashboard_ready = False
status = None
time = 0
while not ready or not dashboard_ready:
while not ready:
status, ready = self.status(print_to_console=False)
dashboard_ready = self.is_dashboard_ready()
if status == CodeFlareClusterStatus.UNKNOWN:
print(
&#34;WARNING: Current cluster status is unknown, have you run cluster.up yet?&#34;
)
if not ready or not dashboard_ready:
if not ready:
if timeout and time &gt;= timeout:
raise TimeoutError(
f&#34;wait() timed out after waiting {timeout}s for cluster to be ready&#34;
)
sleep(5)
time += 5
print(&#34;Requested cluster is up and running!&#34;)

while dashboard_check and not dashboard_ready:
dashboard_ready = self.is_dashboard_ready()
if not dashboard_ready:
if timeout and time &gt;= timeout:
raise TimeoutError(f&#34;wait() timed out after waiting {timeout}s&#34;)
raise TimeoutError(
f&#34;wait() timed out after waiting {timeout}s for dashboard to be ready&#34;
)
sleep(5)
time += 5
print(&#34;Requested cluster and dashboard are up and running!&#34;)</code></pre>
if dashboard_ready:
print(&#34;Dashboard is ready!&#34;)</code></pre>
</details>
</dd>
</dl>
Expand Down
27 changes: 24 additions & 3 deletions docs/cluster/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.config</code></h1>
name: str
namespace: str = None
head_info: list = field(default_factory=list)
head_cpus: int = 2
head_memory: int = 8
head_gpus: int = 0
machine_types: list = field(default_factory=list) # [&#34;m4.xlarge&#34;, &#34;g4dn.xlarge&#34;]
min_cpus: int = 1
max_cpus: int = 1
Expand All @@ -76,7 +79,7 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.config</code></h1>
template: str = f&#34;{dir}/templates/base-template.yaml&#34;
instascale: bool = False
envs: dict = field(default_factory=dict)
image: str = &#34;quay.io/project-codeflare/ray:2.5.0-py38-cu116&#34;
image: str = &#34;quay.io/project-codeflare/ray:latest-py39-cu118&#34;
local_interactive: bool = False
image_pull_secrets: list = field(default_factory=list)
dispatch_priority: str = None</code></pre>
Expand All @@ -93,7 +96,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="codeflare_sdk.cluster.config.ClusterConfiguration"><code class="flex name class">
<span>class <span class="ident">ClusterConfiguration</span></span>
<span>(</span><span>name: str, namespace: str = None, head_info: list = &lt;factory&gt;, 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, envs: dict = &lt;factory&gt;, image: str = 'quay.io/project-codeflare/ray:2.5.0-py38-cu116', local_interactive: bool = False, image_pull_secrets: list = &lt;factory&gt;, dispatch_priority: str = None)</span>
<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, envs: dict = &lt;factory&gt;, image: str = 'quay.io/project-codeflare/ray:latest-py39-cu118', local_interactive: bool = False, image_pull_secrets: list = &lt;factory&gt;, dispatch_priority: str = None)</span>
</code></dt>
<dd>
<div class="desc"><p>This dataclass is used to specify resource requirements and other details, and
Expand All @@ -111,6 +114,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>
name: str
namespace: str = None
head_info: list = field(default_factory=list)
head_cpus: int = 2
head_memory: int = 8
head_gpus: int = 0
machine_types: list = field(default_factory=list) # [&#34;m4.xlarge&#34;, &#34;g4dn.xlarge&#34;]
min_cpus: int = 1
max_cpus: int = 1
Expand All @@ -121,7 +127,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
template: str = f&#34;{dir}/templates/base-template.yaml&#34;
instascale: bool = False
envs: dict = field(default_factory=dict)
image: str = &#34;quay.io/project-codeflare/ray:2.5.0-py38-cu116&#34;
image: str = &#34;quay.io/project-codeflare/ray:latest-py39-cu118&#34;
local_interactive: bool = False
image_pull_secrets: list = field(default_factory=list)
dispatch_priority: str = None</code></pre>
Expand All @@ -136,10 +142,22 @@ <h3>Class variables</h3>
<dd>
<div class="desc"></div>
</dd>
<dt id="codeflare_sdk.cluster.config.ClusterConfiguration.head_cpus"><code class="name">var <span class="ident">head_cpus</span> : int</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="codeflare_sdk.cluster.config.ClusterConfiguration.head_gpus"><code class="name">var <span class="ident">head_gpus</span> : int</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="codeflare_sdk.cluster.config.ClusterConfiguration.head_info"><code class="name">var <span class="ident">head_info</span> : list</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="codeflare_sdk.cluster.config.ClusterConfiguration.head_memory"><code class="name">var <span class="ident">head_memory</span> : int</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="codeflare_sdk.cluster.config.ClusterConfiguration.image"><code class="name">var <span class="ident">image</span> : str</code></dt>
<dd>
<div class="desc"></div>
Expand Down Expand Up @@ -219,7 +237,10 @@ <h4><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration" href="#co
<ul class="two-column">
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.dispatch_priority" href="#codeflare_sdk.cluster.config.ClusterConfiguration.dispatch_priority">dispatch_priority</a></code></li>
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.envs" href="#codeflare_sdk.cluster.config.ClusterConfiguration.envs">envs</a></code></li>
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.head_cpus" href="#codeflare_sdk.cluster.config.ClusterConfiguration.head_cpus">head_cpus</a></code></li>
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.head_gpus" href="#codeflare_sdk.cluster.config.ClusterConfiguration.head_gpus">head_gpus</a></code></li>
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.head_info" href="#codeflare_sdk.cluster.config.ClusterConfiguration.head_info">head_info</a></code></li>
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.head_memory" href="#codeflare_sdk.cluster.config.ClusterConfiguration.head_memory">head_memory</a></code></li>
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.image" href="#codeflare_sdk.cluster.config.ClusterConfiguration.image">image</a></code></li>
<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>
<li><code><a title="codeflare_sdk.cluster.config.ClusterConfiguration.instascale" href="#codeflare_sdk.cluster.config.ClusterConfiguration.instascale">instascale</a></code></li>
Expand Down
23 changes: 22 additions & 1 deletion docs/cluster/model.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ <h1 class="title">Module <code>codeflare_sdk.cluster.model</code></h1>

name: str
status: RayClusterStatus
head_cpus: int
head_mem: str
head_gpu: int
workers: int
worker_mem_min: str
worker_mem_max: str
Expand Down Expand Up @@ -287,7 +290,7 @@ <h3>Class variables</h3>
</dd>
<dt id="codeflare_sdk.cluster.model.RayCluster"><code class="flex name class">
<span>class <span class="ident">RayCluster</span></span>
<span>(</span><span>name: str, status: <a title="codeflare_sdk.cluster.model.RayClusterStatus" href="#codeflare_sdk.cluster.model.RayClusterStatus">RayClusterStatus</a>, workers: int, worker_mem_min: str, worker_mem_max: str, worker_cpu: int, worker_gpu: int, namespace: str, dashboard: str)</span>
<span>(</span><span>name: str, status: <a title="codeflare_sdk.cluster.model.RayClusterStatus" href="#codeflare_sdk.cluster.model.RayClusterStatus">RayClusterStatus</a>, head_cpus: int, head_mem: str, head_gpu: int, workers: int, worker_mem_min: str, worker_mem_max: str, worker_cpu: int, worker_gpu: int, namespace: str, dashboard: str)</span>
</code></dt>
<dd>
<div class="desc"><p>For storing information about a Ray cluster.</p></div>
Expand All @@ -302,6 +305,9 @@ <h3>Class variables</h3>

name: str
status: RayClusterStatus
head_cpus: int
head_mem: str
head_gpu: int
workers: int
worker_mem_min: str
worker_mem_max: str
Expand All @@ -316,6 +322,18 @@ <h3>Class variables</h3>
<dd>
<div class="desc"></div>
</dd>
<dt id="codeflare_sdk.cluster.model.RayCluster.head_cpus"><code class="name">var <span class="ident">head_cpus</span> : int</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="codeflare_sdk.cluster.model.RayCluster.head_gpu"><code class="name">var <span class="ident">head_gpu</span> : int</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="codeflare_sdk.cluster.model.RayCluster.head_mem"><code class="name">var <span class="ident">head_mem</span> : str</code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="codeflare_sdk.cluster.model.RayCluster.name"><code class="name">var <span class="ident">name</span> : str</code></dt>
<dd>
<div class="desc"></div>
Expand Down Expand Up @@ -447,6 +465,9 @@ <h4><code><a title="codeflare_sdk.cluster.model.CodeFlareClusterStatus" href="#c
<h4><code><a title="codeflare_sdk.cluster.model.RayCluster" href="#codeflare_sdk.cluster.model.RayCluster">RayCluster</a></code></h4>
<ul class="two-column">
<li><code><a title="codeflare_sdk.cluster.model.RayCluster.dashboard" href="#codeflare_sdk.cluster.model.RayCluster.dashboard">dashboard</a></code></li>
<li><code><a title="codeflare_sdk.cluster.model.RayCluster.head_cpus" href="#codeflare_sdk.cluster.model.RayCluster.head_cpus">head_cpus</a></code></li>
<li><code><a title="codeflare_sdk.cluster.model.RayCluster.head_gpu" href="#codeflare_sdk.cluster.model.RayCluster.head_gpu">head_gpu</a></code></li>
<li><code><a title="codeflare_sdk.cluster.model.RayCluster.head_mem" href="#codeflare_sdk.cluster.model.RayCluster.head_mem">head_mem</a></code></li>
<li><code><a title="codeflare_sdk.cluster.model.RayCluster.name" href="#codeflare_sdk.cluster.model.RayCluster.name">name</a></code></li>
<li><code><a title="codeflare_sdk.cluster.model.RayCluster.namespace" href="#codeflare_sdk.cluster.model.RayCluster.namespace">namespace</a></code></li>
<li><code><a title="codeflare_sdk.cluster.model.RayCluster.status" href="#codeflare_sdk.cluster.model.RayCluster.status">status</a></code></li>
Expand Down
Loading