Skip to main content

Installing VS Code in Your Project Environment

Although Dadosfera already provides a default VS Code image ready to use, you may need to run it inside a custom environment with your own Step and Data App dependencies.

Below you will find the step-by-step process to use the template provided by our team and run VS Code inside the Intelligence module with your own custom environment.

Prerequisites

  • Have a Dadosfera user account.
  • Have access to the Intelligence module.
  • Have a project created in the Intelligence module.

Preparing the environment for VS Code

  1. In the ENVIRONMENTS tab, select a base image and name your environment as you prefer. In this tutorial, we 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 dependencies

These are the minimum requirements to run VS Code. If your project needs any additional dependencies, add them to this script.

  1. Click the build button to build the environment. The button is located in the upper-right corner of the interface.
  2. To confirm that the build finished successfully, you should see a result similar to the one below:


  1. After that, the environment is ready to run VS Code.

Creating a service for the project: Data Apps -> Edit Data Apps

  1. Click DATA APPS.
Data Apps menu
  1. Add a new VS Code service in Add Service.
Add Service for VS Code
  1. Select Create Custom Service and expand the newly created row named VSCode.
Create Custom Service for VS Code
  1. In the Image field, select the image built in the previous steps.

  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. Go back to the pipeline page and restart the session. You can find it in the lower-left corner under pipeline sessions (main.ddf):

Restarting the pipeline session

Accessing the service

  1. In the DATA APPS tab, select the VS Code service you just configured.

  1. You will be redirected to the access link for VS Code running with the same environment configured previously.


Remember to enable the Trust Authors setting when VS Code opens for the first time:



Installing extensions in this environment


Inside this VS Code instance, you can install any extension you normally use. Open the Extensions area, choose the extension you want, and install it:

Installing extensions inside VS Code