Skip to content

Commit

Permalink
update: Demo notebooks to use simplified import statements for the co…
Browse files Browse the repository at this point in the history
…deflare-sdk
  • Loading branch information
VanillaSpoon authored and openshift-merge-bot[bot] committed Feb 26, 2024
1 parent c6e2b79 commit 8298e9e
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 44 deletions.
3 changes: 1 addition & 2 deletions demo-notebooks/additional-demos/hf_interactive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down
5 changes: 2 additions & 3 deletions demo-notebooks/additional-demos/local_interactive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down Expand Up @@ -116,7 +115,7 @@
"metadata": {},
"outputs": [],
"source": [
"from codeflare_sdk.utils import generate_cert\n",
"from codeflare_sdk import generate_cert\n",
"\n",
"if local_interactive:\n",
" generate_cert.generate_tls_cert(cluster_name, namespace)\n",
Expand Down
3 changes: 1 addition & 2 deletions demo-notebooks/guided-demos/0_basic_ray.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions demo-notebooks/guided-demos/1_basic_instascale.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down
5 changes: 2 additions & 3 deletions demo-notebooks/guided-demos/2_basic_jobs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down Expand Up @@ -108,7 +107,7 @@
"metadata": {},
"outputs": [],
"source": [
"from codeflare_sdk.job.jobs import DDPJobDefinition"
"from codeflare_sdk import DDPJobDefinition"
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions demo-notebooks/guided-demos/3_basic_interactive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down
5 changes: 2 additions & 3 deletions demo-notebooks/guided-demos/4_gpt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down Expand Up @@ -98,7 +97,7 @@
"metadata": {},
"outputs": [],
"source": [
"from codeflare_sdk.job.jobs import DDPJobDefinition"
"from codeflare_sdk import DDPJobDefinition"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down Expand Up @@ -183,7 +182,7 @@
"metadata": {},
"outputs": [],
"source": [
"from codeflare_sdk.job.jobs import DDPJobDefinition"
"from codeflare_sdk import DDPJobDefinition"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down
5 changes: 2 additions & 3 deletions demo-notebooks/guided-demos/notebook-ex-outputs/4_gpt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down Expand Up @@ -174,7 +173,7 @@
"metadata": {},
"outputs": [],
"source": [
"from codeflare_sdk.job.jobs import DDPJobDefinition"
"from codeflare_sdk import DDPJobDefinition"
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions demo-notebooks/guided-demos/preview_nbs/0_basic_ray.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down
5 changes: 2 additions & 3 deletions demo-notebooks/guided-demos/preview_nbs/2_basic_jobs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down Expand Up @@ -108,7 +107,7 @@
"metadata": {},
"outputs": [],
"source": [
"from codeflare_sdk.job.jobs import DDPJobDefinition"
"from codeflare_sdk import DDPJobDefinition"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down
5 changes: 2 additions & 3 deletions demo-notebooks/guided-demos/preview_nbs/4_gpt.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration\n",
"from codeflare_sdk.cluster.auth import TokenAuthentication"
"from codeflare_sdk import Cluster, ClusterConfiguration, TokenAuthentication"
]
},
{
Expand Down Expand Up @@ -98,7 +97,7 @@
"metadata": {},
"outputs": [],
"source": [
"from codeflare_sdk.job.jobs import DDPJobDefinition"
"from codeflare_sdk import DDPJobDefinition"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Authenticating with your cluster allows you to perform actions such as creating
## Method 1 Token Authentication
This is how a typical user would authenticate to their cluster using `TokenAuthentication`.
```
from codeflare_sdk.cluster.auth import TokenAuthentication
from codeflare_sdk import TokenAuthentication
auth = TokenAuthentication(
token = "XXXXX",
Expand All @@ -27,7 +27,7 @@ If the user has not specifically authenticated through the SDK by other means su
A user can specify a config file via a different authentication class `KubeConfigFileAuthentication` for authenticating with the SDK.<br>
This is what loading a custom config file would typically look like.
```
from codeflare_sdk.cluster.auth import KubeConfigFileAuthentication
from codeflare_sdk import KubeConfigFileAuthentication
auth = KubeConfigFileAuthentication(
kube_config_path="/path/to/config",
Expand Down
2 changes: 1 addition & 1 deletion docs/cluster-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ To create Ray Clusters using the CodeFlare SDK a cluster configuration needs to
This is what a typical cluster configuration would look like; Note: The values for CPU and Memory are at the minimum requirements for creating the Ray Cluster.

```
from codeflare_sdk.cluster.cluster import Cluster, ClusterConfiguration
from codeflare_sdk import Cluster, ClusterConfiguration
cluster = Cluster(ClusterConfiguration(
name='ray-example', # Mandatory Field
Expand Down

0 comments on commit 8298e9e

Please sign in to comment.