Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Altered demo notebooks for Kueue default & mTLS default #486

Merged
merged 12 commits into from
Apr 25, 2024
13 changes: 8 additions & 5 deletions demo-notebooks/additional-demos/hf_interactive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"id": "bc27f84c",
"metadata": {},
"source": [
"Here, we want to define our cluster by specifying the resources we require for our batch workload. Below, we define our cluster object (which generates a corresponding AppWrapper).\n",
"Here, we want to define our cluster by specifying the resources we require for our batch workload. Below, we define our cluster object (which generates a corresponding Ray Cluster).\n",
"\n",
"NOTE: We must specify the `image` which will be used in our RayCluster, we recommend you bring your own image which suits your purposes. \n",
"The example here is a community image."
Expand All @@ -89,25 +89,28 @@
}
],
"source": [
"# Create our cluster and submit appwrapper\n",
"# Create our cluster and submit\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(name='hfgputest', \n",
" namespace=\"default\",\n",
" namespace=\"default\", # Update to your namespace\n",
" num_workers=1,\n",
" min_cpus=8, \n",
" max_cpus=8, \n",
" min_memory=16, \n",
" max_memory=16, \n",
" num_gpus=4,\n",
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
" instascale=True, machine_types=[\"m5.xlarge\", \"p3.8xlarge\"]))"
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",
" ))"
]
},
{
"cell_type": "markdown",
"id": "12eef53c",
"metadata": {},
"source": [
"Next, we want to bring our cluster up, so we call the `up()` function below to submit our cluster AppWrapper yaml onto the MCAD queue, and begin the process of obtaining our resource cluster."
"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."
]
},
{
Expand Down
17 changes: 8 additions & 9 deletions demo-notebooks/additional-demos/local_interactive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@
},
"outputs": [],
"source": [
"# Create our cluster and submit appwrapper\n",
"namespace = \"default\"\n",
"# Create and submit our cluster\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",
"namespace = \"default\" # Update to your namespace\n",
Bobbins228 marked this conversation as resolved.
Show resolved Hide resolved
"cluster_name = \"hfgputest-1\"\n",
"local_interactive = True\n",
"\n",
"cluster = Cluster(ClusterConfiguration(local_interactive=local_interactive,\n",
" namespace=namespace,\n",
Bobbins228 marked this conversation as resolved.
Show resolved Hide resolved
"cluster = Cluster(ClusterConfiguration(namespace=namespace,\n",
" name=cluster_name,\n",
" num_workers=1,\n",
" min_cpus=1,\n",
Expand All @@ -63,6 +62,7 @@
" max_memory=4,\n",
" num_gpus=0,\n",
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
" instascale=False,\n",
ChughShilpa marked this conversation as resolved.
Show resolved Hide resolved
" machine_types=[\"m5.xlarge\", \"p3.8xlarge\"]))"
]
Bobbins228 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -117,9 +117,8 @@
"source": [
"from codeflare_sdk import generate_cert\n",
"\n",
"if local_interactive:\n",
" generate_cert.generate_tls_cert(cluster_name, namespace)\n",
" generate_cert.export_env(cluster_name, namespace)"
"generate_cert.generate_tls_cert(cluster_name, namespace)\n",
"generate_cert.export_env(cluster_name, namespace)"
]
},
{
Expand Down Expand Up @@ -339,7 +338,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.17"
"version": "3.9.18"
},
"vscode": {
"interpreter": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In this third demo we will go over the basics of the Ray Job Submission Client in the SDK"
"In this demo we will go over the basics of the RayJobClient in the SDK"
]
},
{
Expand All @@ -26,7 +26,6 @@
"# Create authentication object for user permissions\n",
"# IF unused, SDK will automatically check for default kubeconfig, then in-cluster config\n",
"# KubeConfigFileAuthentication can also be used to specify kubeconfig path manually\n",
"\n",
"auth_token = \"XXXXX\" # The auth_token is used later for the RayJobClient\n",
"auth = TokenAuthentication(\n",
" token = auth_token,\n",
Expand All @@ -43,16 +42,18 @@
"outputs": [],
"source": [
"# 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='jobtest',\n",
" namespace='default',\n",
" namespace='default', # Update to your namespace\n",
" num_workers=2,\n",
" min_cpus=1,\n",
" max_cpus=1,\n",
" min_memory=4,\n",
" max_memory=4,\n",
" num_gpus=0,\n",
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\"\n",
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
" write_to_file=False # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
"))"
Bobbins228 marked this conversation as resolved.
Show resolved Hide resolved
]
},
Expand Down
14 changes: 8 additions & 6 deletions demo-notebooks/guided-demos/0_basic_ray.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "8d4a42f6",
"metadata": {},
"source": [
"In this first notebook, we will go through the basics of using the SDK to:\n",
"In first notebook, we will go through the basics of using the SDK to:\n",
Bobbins228 marked this conversation as resolved.
Show resolved Hide resolved
" - 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"
Expand Down Expand Up @@ -45,7 +45,7 @@
"id": "bc27f84c",
"metadata": {},
"source": [
"Here, we want to define our cluster by specifying the resources we require for our batch workload. Below, we define our cluster object (which generates a corresponding AppWrapper).\n",
"Here, we want to define our cluster by specifying the resources we require for our batch workload. Below, we define our cluster object (which generates a corresponding RayCluster).\n",
"\n",
"NOTE: We must specify the `image` which will be used in our RayCluster, we recommend you bring your own image which suits your purposes. \n",
"The example here is a community image."
Expand All @@ -58,18 +58,20 @@
"metadata": {},
"outputs": [],
"source": [
"# Create and configure our cluster object (and appwrapper)\n",
"# 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",
" namespace='default',\n",
" namespace='default', # Update to your namespace\n",
" num_workers=2,\n",
" min_cpus=1,\n",
" max_cpus=1,\n",
" min_memory=4,\n",
" max_memory=4,\n",
" num_gpus=0,\n",
" image=\"quay.io/project-codeflare/ray:latest-py39-cu118\",\n",
" instascale=False\n",
" write_to_file=False, # When enabled Ray Cluster yaml files are written to /HOME/.codeflare/resources \n",
" # local_queue=\"local-queue-name\" # Specify the local queue manually\n",
"))"
]
},
Expand All @@ -78,7 +80,7 @@
"id": "12eef53c",
"metadata": {},
"source": [
"Next, we want to bring our cluster up, so we call the `up()` function below to submit our cluster AppWrapper yaml onto the MCAD queue, and begin the process of obtaining our resource cluster."
"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."
]
},
{
Expand Down
177 changes: 0 additions & 177 deletions demo-notebooks/guided-demos/1_basic_instascale.ipynb

This file was deleted.

Loading
Loading