Add new heading to ClearML Session example (#46)

This commit is contained in:
pollfly 2021-08-23 11:03:34 +03:00 committed by GitHub
parent 0048cea0d8
commit 0767ffdd85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,10 @@ where a `clearml-agent` will run and spin an instance of the remote session.
## Steps ## Steps
1. Execute the `clearml-session` command with the following command line options:
### Step 1: Launch `clearml-session`
Execute the `clearml-session` command with the following command line options:
```bash ```bash
clearml-session --docker nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04 --packages "clearml" "tensorflow>=2.2" "keras" --queue default clearml-session --docker nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04 --packages "clearml" "tensorflow>=2.2" "keras" --queue default
@ -28,15 +31,13 @@ where a `clearml-agent` will run and spin an instance of the remote session.
* Specify the resource queue `--queue default`. * Specify the resource queue `--queue default`.
<br/>
:::note :::note
There is an option to enter a project name using `--project <name>`. If no project is inputted, the default project There is an option to enter a project name using `--project <name>`. If no project is input, the default project
name is "DevOps" name is "DevOps"
::: :::
1. After launching the command, the `clearml-agent` listening to the `default` queue spins a remote Jupyter environment After launching the command, the `clearml-agent` listening to the `default` queue spins a remote Jupyter environment with
with the specifications. It will automatically connect to the docker on the remote machine. the specifications. It will automatically connect to the docker on the remote machine.
The terminal should return output with the session's configuration details, which should look something like this: The terminal should return output with the session's configuration details, which should look something like this:
@ -52,7 +53,9 @@ where a `clearml-agent` will run and spin an instance of the remote session.
} }
``` ```
1. Press `Y` when the CLI will ask whether to `Launch interactive session [Y]/n?`. Press 'Y' or 'Enter'. ### Step 2: Launch interactive session
When the CLI asks whether to `Launch interactive session [Y]/n?`, press 'Y' or 'Enter'.
The terminal should output information regarding the status of the environment-building process, which should look The terminal should output information regarding the status of the environment-building process, which should look
something like this: something like this:
@ -69,7 +72,10 @@ where a `clearml-agent` will run and spin an instance of the remote session.
Waiting for environment setup to complete [usually about 20-30 seconds] Waiting for environment setup to complete [usually about 20-30 seconds]
``` ```
### Step 3: Connect to remote notebook
Then the CLI will output a link to the ready environment: Then the CLI will output a link to the ready environment:
```console ```console
Interactive session is running: Interactive session is running:
SSH: ssh root@localhost -p 8022 [password: c5d19b3c0fa9784ba4f6aeb568c1e036a4fc2a4bc7f9bfc54a2c198d64ceb9c8] SSH: ssh root@localhost -p 8022 [password: c5d19b3c0fa9784ba4f6aeb568c1e036a4fc2a4bc7f9bfc54a2c198d64ceb9c8]
@ -77,16 +83,18 @@ where a `clearml-agent` will run and spin an instance of the remote session.
VSCode server available at http://localhost:8898/ VSCode server available at http://localhost:8898/
``` ```
1. Click on the JupyterLab link, which will open the remote session Click on the JupyterLab link, which will open the remote session
1. Now, let's execute some code in the remote session! Open up a new Notebook. Now, let's execute some code in the remote session!
### Step 4: Execute code
1. In the first cell of the notebook, clone the [ClearML Repo](https://github.com/allegroai/events). 1. Open up a new Notebook.
1. In the first cell of the notebook, clone the [ClearML Repo](https://github.com/allegroai/clearml).
!git clone https://github.com/allegroai/clearml.git !git clone https://github.com/allegroai/clearml.git
1. In the second cell of the notebook, we are going to run this [script](https://github.com/allegroai/clearml/blob/master/examples/frameworks/keras/keras_tensorboard.py) 1. In the second cell of the notebook, we are going to run this [script](https://github.com/allegroai/clearml/blob/master/examples/frameworks/keras/keras_tensorboard.py)
from the repository that we cloned. from the repository that we cloned.
@ -95,7 +103,9 @@ where a `clearml-agent` will run and spin an instance of the remote session.
Look in the script, and notice that it makes use of ClearML, Keras, and TensorFlow, but we don't need to install these Look in the script, and notice that it makes use of ClearML, Keras, and TensorFlow, but we don't need to install these
packages in Jupyter, because we specified them in the `--packages` flag of `clearml-session`. packages in Jupyter, because we specified them in the `--packages` flag of `clearml-session`.
1. To shut down the remote session, which will free the `clearml-agent` and close the CLI. Enter "Shutdown". ### Step 5: Shut down remote session
To shut down the remote session, which will free the `clearml-agent` and close the CLI, enter "Shutdown".
```console ```console
Connection is up and running Connection is up and running