Skip to content

Commit 47122ee

Browse files
fix: update auth methods in rayjob notebooks
1 parent 416ba8d commit 47122ee

File tree

2 files changed

+13
-32
lines changed

2 files changed

+13
-32
lines changed

demo-notebooks/guided-demos/4_rayjob_existing_cluster.ipynb

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
"metadata": {},
3838
"outputs": [],
3939
"source": [
40-
"from codeflare_sdk import Cluster, ClusterConfiguration, RayJob, TokenAuthentication"
40+
"from codeflare_sdk import Cluster, ClusterConfiguration, RayJob"
4141
]
4242
},
4343
{
4444
"cell_type": "markdown",
4545
"id": "649c5911",
4646
"metadata": {},
4747
"source": [
48-
"Execute the below cell to authenticate the notebook via OpenShift."
48+
"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."
4949
]
5050
},
5151
{
@@ -55,12 +55,7 @@
5555
"metadata": {},
5656
"outputs": [],
5757
"source": [
58-
"auth = TokenAuthentication(\n",
59-
" token = \"XXXXX\",\n",
60-
" server = \"XXXXX\",\n",
61-
" skip_tls=False\n",
62-
")\n",
63-
"auth.login()"
58+
"!oc login --token=<your-token> --server=<your-server-url>"
6459
]
6560
},
6661
{
@@ -116,7 +111,7 @@
116111
"id": "a0e2a650",
117112
"metadata": {},
118113
"source": [
119-
"## Creating and Submitting the RayJob"
114+
"## Submitting the RayJob"
120115
]
121116
},
122117
{
@@ -144,7 +139,7 @@
144139
"rayjob = RayJob(\n",
145140
" job_name=\"sdk-test-job\",\n",
146141
" cluster_name=\"rayjob-cluster\",\n",
147-
" namespace=\"rhods-notebooks\",\n",
142+
" namespace=\"your-namespace\",\n",
148143
" entrypoint=\"python -c 'import time; time.sleep(20)'\",\n",
149144
")\n",
150145
"\n",
@@ -156,7 +151,7 @@
156151
"id": "30a8899a",
157152
"metadata": {},
158153
"source": [
159-
"We can observe the status of the RayJob in the same way as the RayCluster by invoking the `submit()` function via the below cell."
154+
"We can observe the status of the RayJob in the same way as the RayCluster by invoking the `status()` function via the below cell."
160155
]
161156
},
162157
{
@@ -166,7 +161,7 @@
166161
"metadata": {},
167162
"outputs": [],
168163
"source": [
169-
"rayjob.submit()"
164+
"rayjob.status()"
170165
]
171166
},
172167
{

demo-notebooks/guided-demos/5_rayjob_lifecycled_cluster.ipynb renamed to demo-notebooks/guided-demos/5_submit_rayjob_cr.ipynb

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"id": "9259e514",
66
"metadata": {},
77
"source": [
8-
"# Submitting a RayJob which lifecycles its own RayCluster\n",
8+
"# Submitting a RayJob CR\n",
99
"\n",
1010
"In this notebook, we will go through the basics of using the SDK to:\n",
1111
" * Define a RayCluster configuration\n",
@@ -18,14 +18,7 @@
1818
"id": "18136ea7",
1919
"metadata": {},
2020
"source": [
21-
"## Defining and Submitting the RayJob"
22-
]
23-
},
24-
{
25-
"cell_type": "markdown",
26-
"id": "a1c2545d",
27-
"metadata": {},
28-
"source": [
21+
"## Defining and Submitting the RayJob\n",
2922
"First, we'll need to import the relevant CodeFlare SDK packages. You can do this by executing the below cell."
3023
]
3124
},
@@ -36,17 +29,15 @@
3629
"metadata": {},
3730
"outputs": [],
3831
"source": [
39-
"from codeflare_sdk import RayJob, ManagedClusterConfig, TokenAuthentication"
32+
"from codeflare_sdk import RayJob, ManagedClusterConfig"
4033
]
4134
},
4235
{
4336
"cell_type": "markdown",
4437
"id": "649c5911",
4538
"metadata": {},
4639
"source": [
47-
"Execute the below cell to authenticate the notebook via OpenShift.\n",
48-
"\n",
49-
"**TODO: Add guide to authenticate locally.**"
40+
"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."
5041
]
5142
},
5243
{
@@ -56,12 +47,7 @@
5647
"metadata": {},
5748
"outputs": [],
5849
"source": [
59-
"auth = TokenAuthentication(\n",
60-
" token = \"XXXXX\",\n",
61-
" server = \"XXXXX\",\n",
62-
" skip_tls=False\n",
63-
")\n",
64-
"auth.login()"
50+
"!oc login --token=<your-token> --server=<your-server-url>"
6551
]
6652
},
6753
{
@@ -120,7 +106,7 @@
120106
"id": "f3612de2",
121107
"metadata": {},
122108
"source": [
123-
"We can check the status of our cluster by executing the below cell. If it's not up immediately, run the cell a few more times until you see that it's in a 'running' state."
109+
"We can check the status of our job by executing the below cell. The status may appear as `unknown` for a time while the RayCluster spins up."
124110
]
125111
},
126112
{

0 commit comments

Comments
 (0)