Alaya NeW Cloud

DevPod remote dev environments

Use DevPod + devcontainer.json to spin up standardized containerized dev environments on VKS

Background

LLM-era workloads outgrow local machines fast. "Edit locally, build/run remotely" is becoming the default, and DevPod is one of the more interesting tools for that.

What is DevPod?

DevPod creates container-based dev environments via a devcontainer.json file. The same configuration can drive Docker locally, a remote server, or a cloud provider — uniform environments across teams.

DevPod core components

devcontainer.json

Drop .devcontainer/devcontainer.json into your project. Common fields:

FieldTypeDescription
imagestringBase image for the dev environment
customizationsobjectTool / service config — see the support matrix
portsAttributesobjectForwarded ports and their attributes
postCreateCommandstring | array | objectCommand(s) run after the container starts
featuresobjectExtra packages — see features list

Example:

{
  "name": "Python 3",
  "image": "registry.hd-01.alayanew.com:8443/public/mcr.microsoft.com/devcontainers/python:1-3.12",
  "customizations": {
    "vscode": {
      "settings": {},
      "extensions": [
        "streetsidesoftware.code-spell-checker"
      ]
    }
  },
  "portsAttributes": {
    "9000": {
      "label": "Hello Remote World",
      "onAutoForward": "notify"
    }
  },
  "postCreateCommand": "pip3 install -r requirements.txt"
}

Workspace

A containerized dev environment containing your source and dependencies.

Providers

CLI plugins that create / manage / run Workspaces on different platforms (Docker, Kubernetes, AWS, Azure, …). Configured via provider.yaml.

Use DevPod + VS Code remotely

DevPod has a CLI and a desktop client. This tutorial uses the CLI. Install per the official guide and verify with devpod version.

Preparation

Download the example archive:

FileDescription
provider.yamlKubernetes Provider config
pod-manifest-tmpl.yamlPod template for the Workspace
remote-container-envExtra environment variables

Create the Provider

devpod provider add --name kubernetes ./provider.yaml

Set its parameters:

# kubeconfig path
devpod provider set-options -o KUBERNETES_CONFIG=$(pwd)/kubeconfig

# StorageClass for the Workspace's source code
devpod provider set-options -o STORAGE_CLASS=<STORAGE_CLASS_NAME>

# Namespace for the Workspace
devpod provider set-options -o KUBERNETES_NAMESPACE=devpod

# Pod manifest template
devpod provider set-options -o POD_MANIFEST_TEMPLATE=$(pwd)/pod-manifest-tmpl.yaml

# Extra env vars
devpod provider set-options -o ENV_FILE=$(pwd)/remote-container-env

# Resource limits
devpod provider set-options -o RESOURCES="limits.cpu=18,limits.memory=200G,limits.nvidia.com/gpu-h800=1,requests.cpu=18,requests.memory=200G,requests.nvidia.com/gpu-h800=1"

Verify:

devpod provider options kubernetes

Start the Workspace

devpod up --provider kubernetes github.com/microsoft/vscode-remote-try-python \
  --workspace-env-file ./remote-container-env \
  --devcontainer-image registry.hd-01.alayanew.com:8443/public/mcr.microsoft.com/devcontainers/python:1-3.12 \
  --ide vscode \
  --debug

Flags:

  1. github.com/microsoft/vscode-remote-try-python — project to clone
  2. --workspace-env-file — extra env-var file
  3. --devcontainer-image — overrides the image in devcontainer.json
  4. --ide — pick the IDE (vscode here)
  5. --debug — verbose logs

VS Code opens automatically and attaches to the DevPod container. Add ports in the VS Code "PORTS" panel to expose services.

Tip: Workspace startup pulls source and bootstraps the DevPod agent — give it a moment.

Reopen the Workspace

devpod up <WORKSPACE_NAME> --ide vscode

Last updated on

Was this page helpful?

On this page