Skip to content

Files

112 lines (76 loc) · 5.21 KB

how-to-access-terminal.md

File metadata and controls

112 lines (76 loc) · 5.21 KB
title titleSuffix description services author ms.author ms.reviewer ms.service ms.subservice ms.custom ms.topic ms.date
How to access a compute instance terminal in your workspace
Azure Machine Learning
Use the terminal on a compute instance for Git operations, to install packages, and add kernels.
machine-learning
abeomor
osomorog
sgilley
machine-learning
core
event-tier1-build-2022
how-to
02/05/2021

Access a compute instance terminal in your workspace

Access the terminal of a compute instance in your workspace to:

  • Use files from Git and version files. These files are stored in your workspace file system, not restricted to a single compute instance.
  • Install packages on the compute instance.
  • Create extra kernels on the compute instance.

Prerequisites

Access a terminal

To access the terminal:

  1. Open your workspace in Azure Machine Learning studio.

  2. On the left side, select Notebooks.

  3. Select the Open terminal image.

    :::image type="content" source="media/how-to-use-terminal/open-terminal-window.png" alt-text="Open terminal window":::

  4. When a compute instance is running, the terminal window for that compute instance appears.

  5. When no compute instance is running, use the Compute section on the right to start or create a compute instance. :::image type="content" source="media/how-to-use-terminal/start-or-create-compute.png" alt-text="Start or create a compute instance":::

In addition to the steps above, you can also access the terminal from:

  • RStudio (See [Add RStudio]([Create and manage an Azure Machine Learning compute instance]): Select the Terminal tab on top left.
  • Jupyter Lab: Select the Terminal tile under the Other heading in the Launcher tab.
  • Jupyter: Select New>Terminal on top right in the Files tab.
  • SSH to the machine, if you enabled SSH access when the compute instance was created.

Copy and paste in the terminal

  • Windows: Ctrl-Insert to copy and use Ctrl-Shift-v or Shift-Insert to paste.
  • Mac OS: Cmd-c to copy and Cmd-v to paste.
  • FireFox/IE may not support clipboard permissions properly.

Use files from Git and version files

Access all Git operations from the terminal. All Git files and folders will be stored in your workspace file system. This storage allows you to use these files from any compute instance in your workspace.

Note

Add your files and folders anywhere under the ~/cloudfiles/code/Users folder so they will be visible in all your Jupyter environments.

Learn more about cloning Git repositories into your workspace file system.

Install packages

Install packages from a terminal window. Install Python packages into the Python 3.8 - AzureML environment. Install R packages into the R environment.

Or you can install packages directly in Jupyter Notebook or RStudio:

  • RStudio [Add RStudio]([Create and manage an Azure Machine Learning compute instance]: Use the Packages tab on the bottom right, or the Console tab on the top left.
  • Python: Add install code and execute in a Jupyter Notebook cell.

Note

For package management within a notebook, use %pip or %conda magic functions to automatically install packages into the currently-running kernel, rather than !pip or !conda which refers to all packages (including packages outside the currently-running kernel)

Add new kernels

Warning

While customizing the compute instance, make sure you do not delete the azureml_py36 or azureml_py38 conda environments. Also do not delete Python 3.6 - AzureML or Python 3.8 - AzureML kernels. These are needed for Jupyter/JupyterLab functionality.

To add a new Jupyter kernel to the compute instance:

  1. Use the terminal window to create a new environment. For example, the code below creates newenv:

    conda create --name newenv
  2. Activate the environment. For example, after creating newenv:

    conda activate newenv
  3. Install pip and ipykernel package to the new environment and create a kernel for that conda env

    conda install pip
    conda install ipykernel
    python -m ipykernel install --user --name newenv --display-name "Python (newenv)"

Any of the available Jupyter Kernels can be installed.

Manage terminal sessions

Select View active sessions in the terminal toolbar to see a list of all active terminal sessions. When there are no active sessions, this tab will be disabled.

Warning

Make sure you close any unused sessions to preserve your compute instance's resources. Idle terminals may impact performance of compute instances.