singlefabric
AI DevelopmentContainer Instances

VSCode Usage

A guide on how to use VSCode on both the cloud and locally for development with container instances.

Introduction

This document provides a guide on how to use VSCode on both the cloud and locally for development with container instances.

Prerequisites

Using VSCode on the cloud

  1. Log in to the management console.
  2. In the top navigation bar, click Products and Services > AI Computing Platform > AI Computing Platform to go to its overview page.
  3. In the left navigation bar, select Development & Training > Container Instances. The container instance list page is displayed by default.
  4. In the row where the specified container instance is located, click vscode in the Quick Access column to enter the vscode UI page.
  5. On the vscode UI page, click Toggle Panel in the upper right corner to open the Terminal panel at the bottom of VSCode for entering and executing Terminal commands.
  6. In the blank area of the EXPLORER area on the left, right-click to load the file management related menu bar, where you can perform operations such as creating a new file.
  7. In the left navigation bar, click Extension to enter the extension list. Users can install corresponding extension components according to actual needs.

Install extensions online

a. Users can click the filter button in the extension list to select and filter the extension types on the VSCode platform. b. In the extension list, select the component to be installed (using the Python extension as an example), open its introduction page, click Install, and wait for the component to be installed.

Install extensions offline

a. Click the Install button of the corresponding component. If an error message appears due to network connection problems, click Try Downloading Manually in the prompt window in the lower right corner to perform offline installation. b. Enter the browser and download the VSIX package to the user's local host ms-python.python-2024.4.1.vsix. c. After downloading the offline package, use JupyterLab to upload the installation package or establish SSH public key access between the local host and the container instance, and then use scp to upload the installation package.

Local VSCode Use

If VSCode is installed on your local host, you can use SSH to connect to the container instance directly on VSCode.

  1. The container instance has completed the SSH public key access configuration. On the container instance list page, click More Actions on the right side of the row where the corresponding container instance is located and select Copy SSH Command.
  2. Open the local VSCode and on the welcome page, select Connect to.
  3. If VSCode does not have the SSH access component installed, you need to click SSH in the top pop-up window to install it. After the installation is complete, click Add New SSH Host.
  4. Enter the SSH command copied in the first step, select the public key of the local host configured in the container instance, and select Connect in the pop-up window in the lower right corner.

On this page