domino logo
4.1
  • Tech Ecosystem
  • Deployment-wide Search
  • Get Started
  • Security and Credentials
  • Collaborate
  • Organizations
  • Projects
  • Domino Datasets
  • External Data
  • Workspaces
  • Environments
  • Executions
  • Model APIs
  • Publish
  • Notifications
  • Domino Command Line Interface (CLI)
  • Troubleshooting
  • Get Help
domino logo
About Domino
Domino Data LabKnowledge BaseData Science BlogTraining
User Guide
>
Workspaces
>
Create a Workspace
>
Open a VS Code Workspace

Open a VS Code Workspace

The Domino Standard Environments support opening Visual Studio Code (VS Code) in Workspaces. VS Code is an open-source multi-language editor maintained by Microsoft. Domino can serve the VS Code application to your browser with the power of code-server from Coder.com.

Prerequisites

VS Code support is available in the latest versions of the Domino standard environments:

Domino Analytics Distribution for Python 2.7
  • quay.io/domino/base:Ubuntu18_DAD_Py2.7_R3.5-20190501

Domino Analytics Distribution for Python 3.7
  • quay.io/domino/base:Ubuntu18_DAD_Py3.7_R3.5-20190501

Domino Analytics Distribution for Python 3.6
  • quay.io/domino/base:Ubuntu18_DAD_Py3.6_R3.5-20190501

Launch a VS Code workspace

If you are using a Domino environment that has VS Code, you can launch VS Code when you create a Workspace just as you would launch any other IDE.

vscode workspace launch

Option 1: Launch VS Code directly

You can launch VS Code when you create a Workspace or Quick Action menu, the same way you would launch other IDEs.

If launched this way, your Workspace will open with the Domino controls around a VS Code editor. You can work with your project files in VS Code, and commit and sync with the Domino Workspace as normal.

Screen Shot 2019 05 16 at 9.49.29 AM

Option 2: Launch VS Code from JupyterLab

In VS Code-equipped environments, you will also find VS Code IDE as a notebook option in JupyterLab.

If launched this way, JupyterLab opens a new tab that serves the VS Code application. This editor is running in the same Domino Run container as your JupyterLab application. However, the VS Code tab will not show the Domino Workspace controls. If you want to sync, commit, or stop your Workspace after working in VS Code, you must do so from the JupyterLab tab.

Install VS Code extensions

You can install VS Code extensions in the following ways:

  1. Use the pre-run script.

  2. Use VS Code’s Extensions Manager.

Use the pre-run script
  1. Go to the environment.

  2. Click Edit Environment.

  3. In Pre Run Script, paste the following:

    code-server --install-extension <extension-name> --extensions-dir ${HOME}/.local/share/code-server/extensions
  4. Click Build.

Use VS Code’s Extensions Manager

Use the VS Code’s Extensions Manager to install extensions from the marketplace. You must build the extensions in your environment to make them available in every new VS Code workspace.

Screen Shot 2019 05 16 at 10.01.25 AM

  1. Find the extension you want to install in the Visual Studio Marketplace. For example, install the scala-lang extension.

  2. Microsoft obscures the download URL for the extension by default. Open your browser’s development tools, then click Download extension.

    Screen Shot 2019 05 16 at 10.11.24 AM

  3. Get the download URL for the extension from the request details in your browser’s development tools. It ends with /vspackage. Copy this URL.

    Screen Shot 2019 05 16 at 10.14.00 AM

  4. In Domino, create a new environment. As the base image, use one of the VS Code-equipped Domino Standard Environments, listed in the prerequisites.

    Screen Shot 2019 05 16 at 10.17.42 AM

  5. Add the following instructions to your environment’s Dockerfile. Replace the folder names and example /vspackage URL with the extension URL you retrieved previously. These commands download the extension, extract the required files, and add them to the appropriate folder.

RUN apt-get update
RUN apt-get install -y bsdtar
RUN mkdir -p /home/ubuntu/.local/share/code-server/extensions/ms-python.python-2019.3.6558
RUN cd /home/ubuntu/.local/share/code-server/extensions/ms-python.python-2019.3.6558
RUN curl -JL https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-python/vsextensions/python/2019.3.6558/vspackage | bsdtar -xvf - extension

RUN cd /home/ubuntu/.local/share/code-server/extensions/ms-python.python-2019.3.6558/extension/ && mv * ../
RUN chown ubuntu:ubuntu /home/ubuntu/.local/share/code-server/
  1. Click Build. After a successful build, you can use this new environment to launch VS Code workspace sessions with the extensions already installed.

Install VS Code to older environments

Note
  1. Add the following to your compute environment Docker file instructions:

    #note: Make sure you are using the latest release if you'd like the latest version of the workspaces
    #https://github.com/dominodatalab/workspace-configs/releases
    
    RUN cd /tmp && wget https://github.com/dominodatalab/workspace-configs/archive/2019q2-v1.3.zip && \
    unzip 2019q2-v1.3.zip && cp -Rf workspace-configs-2019q2-v1.3/vscode /var/opt/workspaces/vscode && \
    rm -rf /var/opt/workspaces/workspace-logos && \
    rm -rf /tmp/workspace-configs-2019q2-v1.3
    
    RUN \
    chmod +x /var/opt/workspaces/vscode/install && sleep 2 && \
    /var/opt/workspaces/vscode/install
  2. Add the following to your compute environment’s Pluggable Workspace Tools:

vscode:
 title: "vscode"
 iconUrl: "https://raw.github.com/dominodatalab/workspace-configs/develop/workspace-logos/vscode.svg?sanitize=true"
 start: [ "/var/opt/workspaces/vscode/start" ]
 httpProxy:
    port: 8888
Domino Data LabKnowledge BaseData Science BlogTraining
Copyright © 2022 Domino Data Lab. All rights reserved.