Skip to content

Commit

Permalink
Update comments in demo notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianZaccaria committed Nov 12, 2024
1 parent 70d453d commit 27b4c21
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion demo-notebooks/guided-demos/0_basic_ray.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"id": "12eef53c",
"metadata": {},
"source": [
"Next, we want to bring our cluster up, so we call the `up()` function below to submit our Ray Cluster onto the queue, and begin the process of obtaining our resource cluster."
"You can now choose to click the `Cluster Up` button to submit our Ray Cluster onto the queue, and begin the process of obtaining our resource cluster. Or, you can run the code cell below to do the same."
]
},
{
Expand Down
7 changes: 7 additions & 0 deletions demo-notebooks/guided-demos/1_cluster_job_client.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@
"))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can now choose to tick the `Wait for cluster?` checkbox and click the `Cluster Up` button to submit our Ray Cluster onto the queue, and begin the process of obtaining our resource cluster while waiting for the Ray Dashboard to be available. Or, you can run the code cell below to do the same."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
8 changes: 8 additions & 0 deletions demo-notebooks/guided-demos/2_basic_interactive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@
"))"
]
},
{
"cell_type": "markdown",
"id": "67684d63",
"metadata": {},
"source": [
"You can now choose to tick the `Wait for cluster?` checkbox and click the `Cluster Up` button to submit our Ray Cluster onto the queue, and begin the process of obtaining our resource cluster while waiting for the Ray Dashboard to be available. Or, you can run the code cell below to do the same."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
2 changes: 1 addition & 1 deletion demo-notebooks/guided-demos/3_widget_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"# Create and configure our cluster object\n",
"# The SDK will try to find the name of your default local queue based on the annotation \"kueue.x-k8s.io/default-queue\": \"true\" unless you specify the local queue manually below\n",
"cluster = Cluster(ClusterConfiguration(\n",
" name='raytest',\n",
" name='widgettest',\n",
" head_cpu_requests='500m',\n",
" head_cpu_limits='500m',\n",
" head_memory_requests=2,\n",
Expand Down
16 changes: 8 additions & 8 deletions ui-tests/tests/widget_notebook_example.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ test.describe("Visual Regression", () => {
await interactWithWidget(page, upDownWidgetCellIndex, 'button:has-text("Cluster Up")', async (button) => {
await button.click();

const successMessage = await page.waitForSelector('text=Ray Cluster: \'raytest\' has successfully been created', { timeout: 10000 });
const successMessage = await page.waitForSelector('text=Ray Cluster: \'widgettest\' has successfully been created', { timeout: 10000 });
expect(successMessage).not.toBeNull();

const resourcesMessage = await page.waitForSelector('text=Waiting for requested resources to be set up...');
Expand All @@ -105,20 +105,20 @@ test.describe("Visual Regression", () => {

await interactWithWidget(page, upDownWidgetCellIndex, 'button:has-text("Cluster Down")', async (button) => {
await button.click();
const clusterDownMessage = await page.waitForSelector('text=Ray Cluster: \'raytest\' has successfully been deleted', { timeout: 5000 });
const clusterDownMessage = await page.waitForSelector('text=Ray Cluster: \'widgettest\' has successfully been deleted', { timeout: 5000 });
expect(clusterDownMessage).not.toBeNull();
});

await runPreviousCell(page, cellCount, '(<CodeFlareClusterStatus.UNKNOWN: 6>, False)');

// Replace text in ClusterConfiguration to run a new RayCluster
const cell = page.getByText('raytest').first();
await cell.fill('"raytest-1"');
const cell = page.getByText('widgettest').first();
await cell.fill('"widgettest-1"');
await page.notebook.runCell(cellCount - 3, true); // Run ClusterConfiguration cell

await interactWithWidget(page, upDownWidgetCellIndex, 'button:has-text("Cluster Up")', async (button) => {
await button.click();
const successMessage = await page.waitForSelector('text=Ray Cluster: \'raytest-1\' has successfully been created', { timeout: 10000 });
const successMessage = await page.waitForSelector('text=Ray Cluster: \'widgettest-1\' has successfully been created', { timeout: 10000 });
expect(successMessage).not.toBeNull();
});

Expand Down Expand Up @@ -146,13 +146,13 @@ test.describe("Visual Regression", () => {

await interactWithWidget(page, viewClustersCellIndex, 'button:has-text("Open Ray Dashboard")', async (button) => {
await button.click();
const successMessage = await page.waitForSelector('text=Opening Ray Dashboard for raytest-1 cluster', { timeout: 5000 });
const successMessage = await page.waitForSelector('text=Opening Ray Dashboard for widgettest-1 cluster', { timeout: 5000 });
expect(successMessage).not.toBeNull();
});

await interactWithWidget(page, viewClustersCellIndex, 'button:has-text("View Jobs")', async (button) => {
await button.click();
const successMessage = await page.waitForSelector('text=Opening Ray Jobs Dashboard for raytest-1 cluster', { timeout: 5000 });
const successMessage = await page.waitForSelector('text=Opening Ray Jobs Dashboard for widgettest-1 cluster', { timeout: 5000 });
expect(successMessage).not.toBeNull();
});

Expand All @@ -161,7 +161,7 @@ test.describe("Visual Regression", () => {

const noClustersMessage = await page.waitForSelector(`text=No clusters found in the ${namespace} namespace.`, { timeout: 5000 });
expect(noClustersMessage).not.toBeNull();
const successMessage = await page.waitForSelector(`text=Cluster raytest-1 in the ${namespace} namespace was deleted successfully.`, { timeout: 5000 });
const successMessage = await page.waitForSelector(`text=Cluster widgettest-1 in the ${namespace} namespace was deleted successfully.`, { timeout: 5000 });
expect(successMessage).not.toBeNull();
});

Expand Down

0 comments on commit 27b4c21

Please sign in to comment.