Installing VSCode in Your Project Environment | Dadosfera Documentation

Tutorial on how to spin up VS Code in your project within the Intelligence Module, so you can edit it using the VSCode IDE.

Although Dadosfera has a standard VSCode image ready to use, you may need to use it within a custom Environment, with its own Steps and Data Apps dependencies.

Below you'll learn the step-by-step process for using the template provided by our team to set up VS Code in the Intelligence Module, in your own Custom Environment.

Prerequisites

  • Have a Dadosfera user account;
  • Access to the Intelligence Module;
  • Have a project created in the Intelligence Module.

Preparing the environment in the module for VSCode

  1. In the ENVIRONMENTS tab, select the base image and name your environment as you prefer; in this tutorial we'll use the sample Python base image:
  1. In the Setup script field, paste the following code:
#!/bin/bash

sudo apt-get update
sudo apt-get install curl -y

curl -fsSL https://code-server.dev/install.sh | sh -s --
pip3 install pandas # install your dependecies

These are the base requirements for setting up VS Code; if any additional resource is needed to run your project, it should be added to this code.

  1. Next, click the build button so your environment is built. The button is located in the top right corner of the interface.
  2. To check whether the build ran successfully, you should see a result similar to this:

  1. Once done, the environment is ready to run VSCode.

Creating a SERVICE for the project in: Data Apps -> Edit Data Apps

  1. Click on "DATA APPS".
  1. Add a new VSCode service in 'Add Service'
  1. Select Create Custom Service and expand the row created with the service name: VSCode
  1. Select the Image field and select the image of the environment configured earlier
  1. Configure the service with the following values:
  • Command: bash
  • Args: -c 'umask 002 && code-server --auth none --bind-addr 0.0.0.0:8080 /project-dir'
  • Project directory: /project-dir
  • Data directory: /data
  • Port: 8080
  • Exposed: True (enabled)
  1. Save the changes.
  2. Once done, just go back to the pipelines page and restart the session, as can be seen in the bottom left corner, under pipeline sessions (main.ddf):


Accessing the service

  1. In the DATA APPS tab, select the vscode you just configured:
  1. Done — you'll be redirected to the access link for your VS Code with the same previously configured ENVIRONMENT.

Remember to enable the "Trust Authors" setting as soon as VS Code opens for the first time:



Installing Extensions in this environment


In this VSCode you'll be able to install any extension you normally use — just go to the "Extensions" menu, choose the extension you want, and install it.


Did this page help you?