Skip to content

Commit

Permalink
Schema improvements for Interactive Jobs (Azure#2109)
Browse files Browse the repository at this point in the history
* new schema changes

* black format
  • Loading branch information
srsaggam committed Mar 9, 2023
1 parent e49eb59 commit 23b1128
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 28 deletions.
14 changes: 6 additions & 8 deletions cli/jobs/basics/hello-interactive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ code: src
environment: azureml:AzureML-tensorflow-2.7-ubuntu20.04-py38-cuda11-gpu@latest
compute: azureml:cpu-cluster

services:
my_vscode:
services:
my_vscode:
job_service_type: vs_code
my_jupyter_lab:
my_jupyter_lab:
job_service_type: jupyter_lab
my_tensorboard:
job_service_type: tensor_board
properties:
logDir: "outputs/tblogs"
log_dir: "outputs/tblogs"
# my_ssh:
# job_service_type: tensor_board
# properties:
# sshPublicKeys: <paste the entire pub key content>
# nodes: all # Use the `nodes` property for a distributed job to run interactive services on all nodes. If `nodes` are not selected, by default, interactive applications are only enabled on the head node.
# ssh_public_keys: <paste the entire pub key content>
# nodes: all # Use the `nodes` property for a distributed job to run interactive services on all nodes. If `nodes` are not selected, by default, interactive applications are only enabled on the head node.
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,19 @@ jobs:
learning_rate_schedule: ${{parent.inputs.pipeline_job_learning_rate_schedule}}
outputs:
model_output: ${{parent.outputs.pipeline_job_trained_model}}
services:
my_vscode:
services:
my_vscode:
job_service_type: vs_code
my_jupyter_lab:
my_jupyter_lab:
job_service_type: jupyter_lab
my_tensorboard:
job_service_type: tensor_board
properties:
logDir: "outputs/tblogs"
log_dir: "outputs/tblogs"
# my_ssh:
# job_service_type: tensor_board
# properties:
# sshPublicKeys: <paste the entire pub key content>
# ssh_public_keys: <paste the entire pub key content>
# nodes: all # Use the `nodes` property to pick which node you want to enable interactive services on. If `nodes` are not selected, by default, interactive applications are only enabled on the head node.

score_job:
type: command
component: azureml:my_score@latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@
},
"outputs": [],
"source": [
"from azure.ai.ml.entities import (\n",
" JobService,\n",
" SshJobService,\n",
" VsCodeJobService,\n",
" TensorBoardJobService,\n",
" JupyterLabJobService,\n",
")\n",
"\n",
"# create the command\n",
"job = command(\n",
" code=\"./src\", # local path where the code is stored\n",
Expand All @@ -129,22 +137,16 @@
" compute=\"cpu-cluster\",\n",
" display_name=\"debug-and-monitor-example\",\n",
" services={\n",
" \"My_jupyterlab\": JobService(\n",
" job_service_type=\"jupyter_lab\",\n",
" ),\n",
" \"My_vscode\": JobService(\n",
" job_service_type=\"vs_code\",\n",
" ),\n",
" \"My_tensorboard\": JobService(\n",
" job_service_type=\"tensor_board\",\n",
" \"My_jupyterlab\": JupyterLabJobService(),\n",
" \"My_vscode\": VsCodeJobService(),\n",
" \"My_tensorboard\": TensorBoardJobService(\n",
" properties={\n",
" \"logDir\": \"outputs/tblogs\" # relative path of Tensorboard logs (same as in your training script)\n",
" },\n",
" ),\n",
" # \"My_ssh\": JobService(\n",
" # job_service_type=\"ssh\",\n",
" # \"My_ssh\": SshJobService(\n",
" # nodes=\"all\", # For distributed jobs, use the `nodes` property to pick which node you want to enable interactive services on. If `nodes` are not selected, by default, interactive applications are only enabled on the head node. Values are \"all\", or compute node index (for ex. \"0\", \"1\" etc.)\n",
" # properties={\"sshPublicKeys\": \"<add-public-key>\"},\n",
" # ssh_public_keys=\"<add-public-key>\",\n",
" # ),\n",
" }\n",
" # experiment_name: debug-and-monitor-example\n",
Expand Down Expand Up @@ -221,4 +223,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}

0 comments on commit 23b1128

Please sign in to comment.