Skip to content

Commit

Permalink
Changes in docs for release: v0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
codeflare-machine-account authored and openshift-merge-bot[bot] committed Jan 19, 2024
1 parent 65ed743 commit 097fb6a
Show file tree
Hide file tree
Showing 8 changed files with 320 additions and 126 deletions.
213 changes: 204 additions & 9 deletions docs/detailed-documentation/cluster/cluster.html

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions docs/detailed-documentation/cluster/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,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;, 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/src/codeflare_sdk/templates/base-template.yaml', instascale: bool = False, mcad: bool = True, envs: dict = &lt;factory&gt;, image: str = '', local_interactive: bool = False, image_pull_secrets: list = &lt;factory&gt;, dispatch_priority: str = None, openshift_oauth: bool = False, ingress_options: dict = &lt;factory&gt;, ingress_domain: 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, mcad: bool = True, envs: dict = &lt;factory&gt;, image: str = '', local_interactive: bool = False, image_pull_secrets: list = &lt;factory&gt;, dispatch_priority: str = None, openshift_oauth: bool = False, ingress_options: dict = &lt;factory&gt;, ingress_domain: str = None)</span>
</code></dt>
<dd>
<div class="desc"><p>This dataclass is used to specify resource requirements and other details, and
Expand All @@ -109,8 +109,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">@dataclass
class ClusterConfiguration:
<pre><code class="python">class ClusterConfiguration:
&#34;&#34;&#34;
This dataclass is used to specify resource requirements and other details, and
is passed in as an argument when creating a Cluster object.
Expand Down
6 changes: 2 additions & 4 deletions docs/detailed-documentation/cluster/model.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">@dataclass
class AppWrapper:
<pre><code class="python">class AppWrapper:
&#34;&#34;&#34;
For storing information about an AppWrapper.
&#34;&#34;&#34;
Expand Down Expand Up @@ -299,8 +298,7 @@ <h3>Class variables</h3>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">@dataclass
class RayCluster:
<pre><code class="python">class RayCluster:
&#34;&#34;&#34;
For storing information about a Ray cluster.
&#34;&#34;&#34;
Expand Down
2 changes: 1 addition & 1 deletion docs/detailed-documentation/job/jobs.html
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ <h3>Methods</h3>
</dd>
<dt id="codeflare_sdk.job.jobs.DDPJobDefinition"><code class="flex name class">
<span>class <span class="ident">DDPJobDefinition</span></span>
<span>(</span><span>script: Optional[str] = None, m: Optional[str] = None, script_args: Optional[List[str]] = None, name: Optional[str] = None, cpu: Optional[int] = None, gpu: Optional[int] = None, memMB: Optional[int] = None, h: Optional[str] = None, j: Optional[str] = None, env: Optional[Dict[str, str]] = None, max_retries: int = 0, mounts: Optional[List[str]] = None, rdzv_port: int = 29500, rdzv_backend: str = None, scheduler_args: Optional[Dict[str, str]] = None, image: Optional[str] = None, workspace: Optional[str] = 'file:///home/runner/work/codeflare-sdk')</span>
<span>(</span><span>script: Optional[str] = None, m: Optional[str] = None, script_args: Optional[List[str]] = None, name: Optional[str] = None, cpu: Optional[int] = None, gpu: Optional[int] = None, memMB: Optional[int] = None, h: Optional[str] = None, j: Optional[str] = None, env: Optional[Dict[str, str]] = None, max_retries: int = 0, mounts: Optional[List[str]] = None, rdzv_port: int = 29500, rdzv_backend: str = None, scheduler_args: Optional[Dict[str, str]] = None, image: Optional[str] = None, workspace: Optional[str] = 'file:///home/runner/work/codeflare-sdk/codeflare-sdk')</span>
</code></dt>
<dd>
<div class="desc"></div>
Expand Down
4 changes: 2 additions & 2 deletions docs/detailed-documentation/job/ray_jobs.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="codeflare_sdk.job.ray_jobs.RayJobClient"><code class="flex name class">
<span>class <span class="ident">RayJobClient</span></span>
<span>(</span><span>address: Optional[str] = None, create_cluster_if_needed: bool = False, cookies: Optional[Dict[str, Any]] = None, metadata: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, Any]] = None, verify: Union[str, bool, ForwardRef(None)] = True)</span>
<span>(</span><span>address: Optional[str] = None, create_cluster_if_needed: bool = False, cookies: Optional[Dict[str, Any]] = None, metadata: Optional[Dict[str, Any]] = None, headers: Optional[Dict[str, Any]] = None, verify: Union[str, bool, None] = True)</span>
</code></dt>
<dd>
<div class="desc"><p>A class that functions as a wrapper for the Ray Job Submission Client.</p>
Expand Down Expand Up @@ -461,7 +461,7 @@ <h3>Methods</h3>
</details>
</dd>
<dt id="codeflare_sdk.job.ray_jobs.RayJobClient.submit_job"><code class="name flex">
<span>def <span class="ident">submit_job</span></span>(<span>self, entrypoint: str, job_id: Optional[str] = None, runtime_env: Optional[Dict[str, Any]] = None, metadata: Optional[Dict[str, str]] = None, submission_id: Optional[str] = None, entrypoint_num_cpus: Union[int, float, ForwardRef(None)] = None, entrypoint_num_gpus: Union[int, float, ForwardRef(None)] = None, entrypoint_resources: Optional[Dict[str, float]] = None) ‑> str</span>
<span>def <span class="ident">submit_job</span></span>(<span>self, entrypoint: str, job_id: Optional[str] = None, runtime_env: Optional[Dict[str, Any]] = None, metadata: Optional[Dict[str, str]] = None, submission_id: Optional[str] = None, entrypoint_num_cpus: Union[int, float, None] = None, entrypoint_num_gpus: Union[int, float, None] = None, entrypoint_resources: Optional[Dict[str, float]] = None) ‑> str</span>
</code></dt>
<dd>
<div class="desc"><p>Method for submitting jobs to a Ray Cluster and returning the job id with entrypoint being a mandatory field.</p>
Expand Down
80 changes: 52 additions & 28 deletions docs/detailed-documentation/utils/generate_yaml.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ <h1 class="title">Module <code>codeflare_sdk.utils.generate_yaml</code></h1>
from base64 import b64encode
from urllib3.util import parse_url

from .kube_api_helpers import _get_api_host


def read_template(template):
with open(template, &#34;r&#34;) as stream:
Expand Down Expand Up @@ -95,9 +93,8 @@ <h1 class="title">Module <code>codeflare_sdk.utils.generate_yaml</code></h1>
return True
else:
return False
except client.ApiException as e: # pragma: no cover
print(f&#34;Error detecting cluster type defaulting to Kubernetes: {e}&#34;)
return False
except Exception as e: # pragma: no cover
return _kube_api_error_handling(e)


def update_dashboard_route(route_item, cluster_name, namespace):
Expand Down Expand Up @@ -160,28 +157,45 @@ <h1 class="title">Module <code>codeflare_sdk.utils.generate_yaml</code></h1>
raise ValueError(
f&#34;Error: &#39;port&#39; is not of type int for ingress item at index {index}&#34;
)
if ingress_option[&#34;port&#34;] == 8265:
if ingress_option is not None:
metadata[&#34;name&#34;] = ingress_option[&#34;ingressName&#34;]
metadata[&#34;namespace&#34;] = namespace
if &#34;annotations&#34; not in ingress_option.keys():
metadata[&#34;labels&#34;][&#34;ingress-owner&#34;] = cluster_name
metadata[&#34;labels&#34;][&#34;ingress-options&#34;] = &#34;true&#34;
if (
&#34;annotations&#34; not in ingress_option.keys()
or ingress_option[&#34;annotations&#34;] is None
):
del metadata[&#34;annotations&#34;]
else:
metadata[&#34;annotations&#34;] = ingress_option[&#34;annotations&#34;]
if &#34;path&#34; not in ingress_option.keys():
if (
&#34;path&#34; not in ingress_option.keys()
or ingress_option[&#34;path&#34;] is None
):
del spec[&#34;rules&#34;][0][&#34;http&#34;][&#34;paths&#34;][0][&#34;path&#34;]
else:
spec[&#34;rules&#34;][0][&#34;http&#34;][&#34;paths&#34;][0][&#34;path&#34;] = ingress_option[
&#34;path&#34;
]
if &#34;pathType&#34; not in ingress_option.keys():
if (
&#34;pathType&#34; not in ingress_option.keys()
or ingress_option[&#34;pathType&#34;] is None
):
spec[&#34;rules&#34;][0][&#34;http&#34;][&#34;paths&#34;][0][
&#34;pathType&#34;
] = &#34;ImplementationSpecific&#34;
if &#34;host&#34; not in ingress_option.keys():
if (
&#34;host&#34; not in ingress_option.keys()
or ingress_option[&#34;host&#34;] is None
):
del spec[&#34;rules&#34;][0][&#34;host&#34;]
else:
spec[&#34;rules&#34;][0][&#34;host&#34;] = ingress_option[&#34;host&#34;]
if &#34;ingressClassName&#34; not in ingress_option.keys():
if (
&#34;ingressClassName&#34; not in ingress_option.keys()
or ingress_option[&#34;ingressClassName&#34;] is None
):
del spec[&#34;ingressClassName&#34;]
else:
spec[&#34;ingressClassName&#34;] = ingress_option[&#34;ingressClassName&#34;]
Expand All @@ -192,6 +206,7 @@ <h1 class="title">Module <code>codeflare_sdk.utils.generate_yaml</code></h1>
else:
spec[&#34;ingressClassName&#34;] = &#34;nginx&#34;
metadata[&#34;name&#34;] = gen_dashboard_ingress_name(cluster_name)
metadata[&#34;labels&#34;][&#34;ingress-owner&#34;] = cluster_name
metadata[&#34;namespace&#34;] = namespace
spec[&#34;rules&#34;][0][&#34;http&#34;][&#34;paths&#34;][0][&#34;backend&#34;][&#34;service&#34;][
&#34;name&#34;
Expand Down Expand Up @@ -570,10 +585,6 @@ <h1 class="title">Module <code>codeflare_sdk.utils.generate_yaml</code></h1>
tls_secret_name = f&#34;{cluster_name}-proxy-tls-secret&#34;
tls_volume_name = &#34;proxy-tls-secret&#34;
port_name = &#34;oauth-proxy&#34;
host = _get_api_host(k8_client)
host = host.replace(
&#34;api.&#34;, f&#34;{gen_dashboard_ingress_name(cluster_name)}-{namespace}.apps.&#34;
)
oauth_sidecar = _create_oauth_sidecar_object(
namespace,
tls_mount_location,
Expand Down Expand Up @@ -909,10 +920,6 @@ <h2 class="section-title" id="header-functions">Functions</h2>
tls_secret_name = f&#34;{cluster_name}-proxy-tls-secret&#34;
tls_volume_name = &#34;proxy-tls-secret&#34;
port_name = &#34;oauth-proxy&#34;
host = _get_api_host(k8_client)
host = host.replace(
&#34;api.&#34;, f&#34;{gen_dashboard_ingress_name(cluster_name)}-{namespace}.apps.&#34;
)
oauth_sidecar = _create_oauth_sidecar_object(
namespace,
tls_mount_location,
Expand Down Expand Up @@ -1096,9 +1103,8 @@ <h2 class="section-title" id="header-functions">Functions</h2>
return True
else:
return False
except client.ApiException as e: # pragma: no cover
print(f&#34;Error detecting cluster type defaulting to Kubernetes: {e}&#34;)
return False</code></pre>
except Exception as e: # pragma: no cover
return _kube_api_error_handling(e)</code></pre>
</details>
</dd>
<dt id="codeflare_sdk.utils.generate_yaml.read_template"><code class="name flex">
Expand Down Expand Up @@ -1268,28 +1274,45 @@ <h2 class="section-title" id="header-functions">Functions</h2>
raise ValueError(
f&#34;Error: &#39;port&#39; is not of type int for ingress item at index {index}&#34;
)
if ingress_option[&#34;port&#34;] == 8265:
if ingress_option is not None:
metadata[&#34;name&#34;] = ingress_option[&#34;ingressName&#34;]
metadata[&#34;namespace&#34;] = namespace
if &#34;annotations&#34; not in ingress_option.keys():
metadata[&#34;labels&#34;][&#34;ingress-owner&#34;] = cluster_name
metadata[&#34;labels&#34;][&#34;ingress-options&#34;] = &#34;true&#34;
if (
&#34;annotations&#34; not in ingress_option.keys()
or ingress_option[&#34;annotations&#34;] is None
):
del metadata[&#34;annotations&#34;]
else:
metadata[&#34;annotations&#34;] = ingress_option[&#34;annotations&#34;]
if &#34;path&#34; not in ingress_option.keys():
if (
&#34;path&#34; not in ingress_option.keys()
or ingress_option[&#34;path&#34;] is None
):
del spec[&#34;rules&#34;][0][&#34;http&#34;][&#34;paths&#34;][0][&#34;path&#34;]
else:
spec[&#34;rules&#34;][0][&#34;http&#34;][&#34;paths&#34;][0][&#34;path&#34;] = ingress_option[
&#34;path&#34;
]
if &#34;pathType&#34; not in ingress_option.keys():
if (
&#34;pathType&#34; not in ingress_option.keys()
or ingress_option[&#34;pathType&#34;] is None
):
spec[&#34;rules&#34;][0][&#34;http&#34;][&#34;paths&#34;][0][
&#34;pathType&#34;
] = &#34;ImplementationSpecific&#34;
if &#34;host&#34; not in ingress_option.keys():
if (
&#34;host&#34; not in ingress_option.keys()
or ingress_option[&#34;host&#34;] is None
):
del spec[&#34;rules&#34;][0][&#34;host&#34;]
else:
spec[&#34;rules&#34;][0][&#34;host&#34;] = ingress_option[&#34;host&#34;]
if &#34;ingressClassName&#34; not in ingress_option.keys():
if (
&#34;ingressClassName&#34; not in ingress_option.keys()
or ingress_option[&#34;ingressClassName&#34;] is None
):
del spec[&#34;ingressClassName&#34;]
else:
spec[&#34;ingressClassName&#34;] = ingress_option[&#34;ingressClassName&#34;]
Expand All @@ -1300,6 +1323,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
else:
spec[&#34;ingressClassName&#34;] = &#34;nginx&#34;
metadata[&#34;name&#34;] = gen_dashboard_ingress_name(cluster_name)
metadata[&#34;labels&#34;][&#34;ingress-owner&#34;] = cluster_name
metadata[&#34;namespace&#34;] = namespace
spec[&#34;rules&#34;][0][&#34;http&#34;][&#34;paths&#34;][0][&#34;backend&#34;][&#34;service&#34;][
&#34;name&#34;
Expand Down
6 changes: 1 addition & 5 deletions docs/detailed-documentation/utils/kube_api_helpers.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@ <h1 class="title">Module <code>codeflare_sdk.utils.kube_api_helpers</code></h1>
raise PermissionError(perm_msg)
elif e.reason == &#34;Conflict&#34;:
raise FileExistsError(exists_msg)
raise e


def _get_api_host(api_client: client.ApiClient): # pragma: no cover
return parse_url(api_client.configuration.host).host</code></pre>
raise e</code></pre>
</details>
</section>
<section>
Expand Down
Loading

0 comments on commit 097fb6a

Please sign in to comment.