Skip to content

Latest commit

 

History

History
115 lines (79 loc) · 2.57 KB

File metadata and controls

115 lines (79 loc) · 2.57 KB

Development Guide

Prerequisites

Before you get started, make sure you have the following installed:

  • Python 3.11+
  • Docker (required for building functions)
  • vastde CLI — see install steps below

Install the CLI

Download the latest binary for your platform from the DataEngine CLI releases page, then:

# macOS / Linux
chmod +x vastde
mv vastde /usr/local/bin/vastde

# Verify
vastde --version

Then initialise your credentials:

vastde config init

This creates ~/.vast/config.toml with your VMS endpoint and credentials. Never commit this file.

Scaffold a new function

vastde functions init python-pip <lang>-<trigger>-<use-case>

This generates:

<lang>-<trigger>-<use-case>/
├── main.py          # Handler entry point (init and handler)
├── requirements.txt # Python dependencies
├── Aptfile          # System packages
├── customDeps       # Custom/private shared libraries
└── README.md        # Generated development guide

Build

vastde functions build <function-name>

Docker must be running. The build will:

  • Install system packages from Aptfile
  • Install Python dependencies from requirements.txt
  • Install custom dependencies from customDeps
  • Create a container image ready for deployment

Test locally

# Basic local run
vastde functions localrun <function-name>

# Run with custom port
vastde functions localrun <function-name> --port 9090

# Run with config
vastde functions localrun <function-name> -c config.yaml

Invoke your function with an auto-generated event:

vastde functions invoke --generate-event --url http://localhost:8080/  # change port if specified via --port

Alternatively, create a cloudevent.yaml in your function folder to send a custom event specific to your function, then invoke with:

vastde functions invoke <function-name> -f cloudevent.yaml

Configuration

Create a config.yaml to pass environment variables and secrets to your function:

envs:
  MY_VARIABLE: "hello-world"

secrets:
  username: "myuser"
  password: "mypassword"

Never commit real credentials. config.yaml is in .gitignore — use placeholder values and document what each variable does in your function's README.md.

Deploy

Deploy via the DataEngine UI or CLI. See the per-function README.md for function-specific steps.

Logs

vastde logs tail <pipeline> --function <lang>-<trigger>-<use-case>

Run unit tests (optional)

pytest tests/