Skip to content
Open
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
905 changes: 453 additions & 452 deletions demo-notebooks/additional-demos/hf_interactive.ipynb

Large diffs are not rendered by default.

495 changes: 252 additions & 243 deletions demo-notebooks/additional-demos/local_interactive.ipynb

Large diffs are not rendered by default.

639 changes: 320 additions & 319 deletions demo-notebooks/additional-demos/ray_job_client.ipynb

Large diffs are not rendered by default.

457 changes: 229 additions & 228 deletions demo-notebooks/guided-demos/0_basic_ray.ipynb

Large diffs are not rendered by default.

535 changes: 268 additions & 267 deletions demo-notebooks/guided-demos/1_cluster_job_client.ipynb

Large diffs are not rendered by default.

733 changes: 367 additions & 366 deletions demo-notebooks/guided-demos/2_basic_interactive.ipynb

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions demo-notebooks/guided-demos/3_widget_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"In this notebook, we will go through the basics of using the SDK to:\n",
" - Spin up a Ray cluster with our desired resources\n",
" - View the status and specs of our Ray cluster\n",
" - Take down the Ray cluster when finished"
" - Take down the Ray cluster when finished\n",
"\n",
"First, we'll need to import the relevant CodeFlare SDK packages. You can do this by executing the below cell."
]
},
{
Expand All @@ -18,7 +20,6 @@
"metadata": {},
"outputs": [],
"source": [
"# Import pieces from codeflare-sdk\n",
"from codeflare_sdk import Cluster, ClusterConfiguration, view_clusters, set_api_client\n",
"from kube_authkit import AuthConfig, get_k8s_client"
]
Expand Down
37 changes: 27 additions & 10 deletions demo-notebooks/guided-demos/4_rayjob_existing_cluster.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,8 @@
"metadata": {},
"outputs": [],
"source": [
"from codeflare_sdk import Cluster, ClusterConfiguration, RayJob"
]
},
{
"cell_type": "markdown",
"id": "649c5911",
"metadata": {},
"source": [
"Run the below `oc login` command using your Token and Server URL. Ensure the command is prepended by `!` and not `%`. This will work when running both locally and within RHOAI."
"from codeflare_sdk import Cluster, ClusterConfiguration, RayJob, set_api_client\n",
"from kube_authkit import AuthConfig, get_k8s_client"
]
},
{
Expand All @@ -55,7 +48,31 @@
"metadata": {},
"outputs": [],
"source": [
"!oc login --token=<your-token> --server=<your-server-url>"
"# Option 1: Auto-detect credentials (kubeconfig or in-cluster service account)\n",
"# NOTE: In RHOAI Workbenches the workbench service account may not have Ray RBAC\n",
"# permissions. Use Option 2 (token) unless your admin has granted SA permissions\n",
"# (see RHOAIENG-46748). Auto-detect works if you have a local kubeconfig.\n",
"# auth_config = AuthConfig(method=\"auto\")\n",
"\n",
"# Option 2 (Recommended for RHOAI Workbenches): Token-based authentication\n",
"# Get your token with: oc whoami -t (or from the OpenShift console → Copy login command)\n",
"auth_config = AuthConfig(\n",
" method=\"openshift\",\n",
" k8s_api_host=\"https://api.example.com:6443\",\n",
" token=\"sha256~XXXXX\", # oc whoami -t\n",
")\n",
"\n",
"# Option 3: OIDC authentication (for BYOIDC-enabled clusters)\n",
"# auth_config = AuthConfig(\n",
"# method=\"oidc\",\n",
"# k8s_api_host=\"https://api.example.com:6443\",\n",
"# oidc_issuer=\"https://your-oidc-provider.com\",\n",
"# client_id=\"your-client-id\",\n",
"# use_device_flow=True, # Interactive device flow for notebook environments\n",
"# )\n",
"\n",
"api_client = get_k8s_client(config=auth_config)\n",
"set_api_client(api_client)"
]
},
{
Expand Down
39 changes: 29 additions & 10 deletions demo-notebooks/guided-demos/5_submit_rayjob_cr.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,8 @@
"metadata": {},
"outputs": [],
"source": [
"from codeflare_sdk import RayJob, ManagedClusterConfig"
]
},
{
"cell_type": "markdown",
"id": "649c5911",
"metadata": {},
"source": [
"Run the below `oc login` command using your Token and Server URL. Ensure the command is prepended by `!` and not `%`. This will work when running both locally and within RHOAI."
"from codeflare_sdk import RayJob, ManagedClusterConfig, set_api_client\n",
"from kube_authkit import AuthConfig, get_k8s_client"
]
},
{
Expand All @@ -47,7 +40,33 @@
"metadata": {},
"outputs": [],
"source": [
"!oc login --token=<your-token> --server=<your-server-url>"
"# Authenticate to your Kubernetes/OpenShift cluster using kube-authkit\n",
"\n",
"# Option 1: Auto-detect credentials (kubeconfig or in-cluster service account)\n",
"# NOTE: In RHOAI Workbenches the workbench service account may not have Ray RBAC\n",
"# permissions. Use Option 2 (token) unless your admin has granted SA permissions\n",
"# (see RHOAIENG-46748). Auto-detect works if you have a local kubeconfig.\n",
"# auth_config = AuthConfig(method=\"auto\")\n",
"\n",
"# Option 2 (Recommended for RHOAI Workbenches): Token-based authentication\n",
"# Get your token with: oc whoami -t (or from the OpenShift console → Copy login command)\n",
"auth_config = AuthConfig(\n",
" method=\"openshift\",\n",
" k8s_api_host=\"https://api.example.com:6443\",\n",
" token=\"sha256~XXXXX\", # oc whoami -t\n",
")\n",
"\n",
"# Option 3: OIDC authentication (for BYOIDC-enabled clusters)\n",
"# auth_config = AuthConfig(\n",
"# method=\"oidc\",\n",
"# k8s_api_host=\"https://api.example.com:6443\",\n",
"# oidc_issuer=\"https://your-oidc-provider.com\",\n",
"# client_id=\"your-client-id\",\n",
"# use_device_flow=True, # Interactive device flow for notebook environments\n",
"# )\n",
"\n",
"api_client = get_k8s_client(config=auth_config)\n",
"set_api_client(api_client)"
]
},
{
Expand Down
Loading
Loading