Skip to main content

DDE DevPod

Feature release status badge: PriPrev
PriPrev

danger

The DDE is in private preview. Therefore, the service may be unavailable for periods of time. There also may be occasions where service elements are rebuilt, and things like your stored credentials are removed, and you will need to re-add. This poses no risk to the rest of DataOps and is completely isolated.

As good development practice dictates, whether developing on local machines or in the cloud, never rely on these for safe storage of configuration/code. Always create a new branch before any changes, and regularly commit your changes to this branch.

What is DDE DevPod?

If your organization prefers to avoid allowing the DDE DevReady workspace container to connect to Snowflake, you can deploy the workspace container to your organization's environment.

DataOps.live enables you with two different options:

  1. Run both the VS Code frontend and the workspace container on your developer machine
  2. Run the VS Code frontend on your developer machine yet the workspace container on a shared Docker environment

Looking at the first option with everything on your developer machine:

DataOps Development Environment with local deployment diagram __shadow__

With just your computer, you can accelerate development using the DDE DevPod and keep your development credentials on your local machine. Please note the known issues for MAC Users.

The only additional prerequisite is to install Docker on your machine. However, if installing Docker locally is not an option, consider running the actual execution environment on a remote server (usually Linux):

DataOps Development Environment with remote deployment diagram __shadow__

The simplest way to do this is to use the Remote SSH extension in VS Code to connect to the remote computer and clone your repo that contains your devcontainer.json file or create a new one as described in setting up and configuration.

DevPod setup

General prerequisites

On your local machine, you must:

SSH automatically from your local to your remote machine

  1. Configure your SSH client. Find more help on using the SSH config file.

    ~/.ssh/config
      Host <dev_container_remote>
    HostName <remote_ip_address>
    User <user>
    IdentityFile <path_to_ssh_key_file>
  2. Confirm that you can connect to the remote machine from your local machine through VS Code.

    SSH Window

Prerequisites for the machine running the workspace container

  • Install Docker.

  • Authenticate to Docker Hub for DataOps images:

    On your command line, run the following command:

      docker login --username dataopsread --password dckr_pat_82FQ4O6N4yb6fXJc15kIvX4Qrtg
  • Confirm that you can successfully run:

      docker run -it dataopslive/dataops-development-workspace:5-stable bash -c "date"

    And see a result like:

      ubuntu@ip-172-31-7-62:~$ docker run -it dataopslive/dataops-development-workspace:5-stable bash -c "date"
    Mon 20 Feb 2023 12:26:48 PM UTC

Setting up and configuration

  1. Open or clone your desired repository.

  2. Create a folder called .devcontainer/ in your repository root

    This change is inside the repository, so if another user uses the DDE, you may already see this folder.

  3. Create a file called devcontainer.json inside the .devcontainer/ folder.

    This change is inside the repository, so if another user uses the DDE, you may already see this file. Here is a minimal example:

    .devcontainer/devcontainer.json
    {
    "name": "DataOpsDDE",
    "image": "dataopslive/dataops-development-workspace:5-stable"
    }

This enables your project to be opened as a dev container by VS Code. After you have opened the devcontainer you can continue on to the initial setup of credentials.

For more information on developing using dev containers and developing on a remote host see here: https://code.visualstudio.com/remote/advancedcontainers/develop-remote-host

Giving DevPod access to Snowflake

The DataOps.live extension provides a step-by-step guide to help you set up the Snowflake connection for DevPod, simplifying your experience in the development environment.

The setup walkthrough offers detailed instructions on how to give access to your Snowflake account. It also offers a more secure way of storing your credentials.

When you open the development environment for the first time without setting any credentials beforehand, a notification message prompts you to open the setup walkthrough.

DDE notification __shadow__

A two-step getting started displays on the VS Code. Following the on-screen guidance lets you:

  • Choose the dbt version for your workspace
  • Set your Snowflake credentials

The GIF below provides a visual walkthrough, followed by a step-by-step procedure.

DDE notification __shadow__

  1. Click Choose dbt VersionSet dbt Version.

    DDE configuration_page __shadow__

  2. On top of the VS Code, select from the dropdown the dbt version for the workspace.

    Available versions correspond to those in the MATE orchestrator used in pipelines. You can also enter a custom dbt version bundled with MATE.

  3. Click Setup Snowflake ConnectionRun Setup Wizard.

  1. Enter your Snowflake credentials following the on-screen instructions.

    These credentials are for tools like dbt in DDE to connect with your Snowflake. Once you enter them, the DDE setup will configure your environment. You only need to do this once for each workspace.

In DevPod, you can only store credentials in VS Code secrets. This means your credentials are only stored on your local machine and will not be stored in your DataOps.live account.

Configuring Git credentials

When trying to do your first commit, VS Code might prompt you to set your Git username and email. The commands it suggests need to be modified to remove the --global flag, as the change will not persist if the container is recreated.

Instead, your commands should look like this:

terminal
git config user.email "you@example.com"
git config user.name "Your Name"

Your Git config is set locally on the files mounted from the host computer and will persist.

Advanced configuration

You can extend your container environment to your needs, but you will always benefit from building on top of the built-in tooling provided by the DDE. Read the devcontainer.json reference for what you can configure through the file.