Setting up Visual Studio Code#

Visual Studio Code can automatically run the code that you are developing inside a preconfigured container. An OCI Data Science compatible container on your workstation can be used as a development environment. Visual Studio Code can automatically launch the container using the information from devcontainer.json, which is created in the code directory. Automatically generate this file and further customize it with plugins. For more details see

Prerequisites

  1. ADS CLI is configured

  2. Install Visual Studio Code

  3. Build Development Container Image

  4. Install Visual Studio Code extension for Remote Development

ads opctl init-vscode -s <source-folder>

source-folder is a directory on your workstation where the code will reside.

env-var - Use this option to setup the environment variables required when the container used for development is started.

If you have to setup a proxy, you can use the following command -

ads opctl init-vscode -s <source-folder> --env-var http_proxy=$http_proxy https_proxy=$https_proxy no_proxy=$no_proxy

The generated .devcontainer.json includes the python extension for Visual Studio Code by default.

Open the source_folder using Visual Studio Code. More details on running the workspace within the container can be found here