or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.md
tile.json

tessl/pypi-vdk-control-cli

VDK Control CLI allows user to create, delete, manage and their Data Jobs in Kubernetes runtime.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/vdk-control-cli@1.3.x

To install, run

npx @tessl/cli install tessl/pypi-vdk-control-cli@1.3.0

index.mddocs/

VDK Control CLI

VDK Control CLI is a command-line interface tool designed for Data Engineers to manage the complete lifecycle of Data Jobs in Kubernetes runtime environments. It provides comprehensive functionality for creating, deleting, deploying, and configuring Data Jobs through a unified console application.

Package Information

  • Package Name: vdk-control-cli
  • Package Type: pypi
  • Language: Python
  • Installation: pip install vdk-control-cli
  • Console Command: vdkcli

Core Imports

For plugin development:

from vdk.api.control.plugin.markers import hookimpl, hookspec, PROJECT_NAME
from vdk.api.control.plugin.specs import CliHookSpecs

For accessing internal functionality (advanced usage):

from vdk.internal.control.main import run, cli
from vdk.internal.control.plugin.control_plugin_manager import Plugins

Basic Usage

Command-Line Interface

After installation, use the vdkcli command to interact with Data Jobs:

# Show help and available commands
vdkcli --help

# Authenticate with Control Service
vdkcli login

# Create a new Data Job
vdkcli create my-job --team my-team --cloud --local

# Deploy a Data Job
vdkcli deploy my-job --team my-team

# List Data Jobs
vdkcli list --team my-team

# Show Data Job details
vdkcli show my-job --team my-team

# Delete a Data Job
vdkcli delete my-job --team my-team

# Logout
vdkcli logout

Environment Configuration

Configure CLI behavior using environment variables:

# Override configuration folder location
export VDK_BASE_CONFIG_FOLDER=/custom/config/path

# Set default Control Service URL
export VDK_CONTROL_SERVICE_REST_API_URL=https://control-service.example.com

# Set API token for authentication
export VDK_API_TOKEN=your-api-token
export VDK_API_TOKEN_AUTHORIZATION_URL=https://auth.example.com

# Override OAuth port for credential flow
export OAUTH_PORT=8080

Capabilities

Console Commands

Complete set of CLI commands for Data Job lifecycle management.

Authentication Commands

# CLI commands (available via vdkcli):
# vdkcli login [OPTIONS]
# vdkcli logout [OPTIONS]

The login command authenticates with the Control Service using various methods:

  • OAuth2 credentials flow (default)
  • API token authentication
  • Environment variable authentication

The logout command clears stored authentication credentials.

Job Management Commands

# CLI commands (available via vdkcli):
# vdkcli create [OPTIONS] NAME
# vdkcli delete [OPTIONS] NAME
# vdkcli deploy [OPTIONS] NAME
# vdkcli list [OPTIONS]
# vdkcli show [OPTIONS] NAME
# vdkcli execute [OPTIONS] NAME
# vdkcli download-job [OPTIONS] NAME
# vdkcli download-key [OPTIONS] NAME
  • create: Creates new Data Jobs locally and/or in the cloud
  • delete: Removes Data Jobs from the cloud runtime
  • deploy: Deploys Data Job source code to cloud runtime
  • list: Lists Data Jobs for a team
  • show: Displays detailed information about a specific Data Job
  • execute: Runs Data Job locally or remotely
  • download-job: Downloads Data Job source code
  • download-key: Downloads Data Job deployment key

Configuration Commands

# CLI commands (available via vdkcli):
# vdkcli properties [OPTIONS] NAME
# vdkcli secrets [OPTIONS] NAME
# vdkcli set-default [OPTIONS]
# vdkcli reset-default [OPTIONS]
  • properties: Manages Data Job properties and configuration
  • secrets: Manages Data Job secrets
  • set-default: Sets default values for CLI options
  • reset-default: Resets default values

Utility Commands

# CLI commands (available via vdkcli):
# vdkcli info [OPTIONS]
# vdkcli version [OPTIONS]
  • info: Displays system and environment information
  • version: Shows version information

Plugin System

Extensible plugin architecture for customizing CLI behavior.

Plugin Development Interface

PROJECT_NAME = "vdk_control_cli.plugin"

# Decorator for marking hook specifications
hookspec: pluggy.HookspecMarker

# Decorator for marking hook implementations  
hookimpl: pluggy.HookimplMarker

class CliHookSpecs:
    """Hook specifications for CLI plugins."""
    
    @hookspec(firstresult=True)
    def get_default_commands_options(self):
        """
        Hook for setting default CLI command options.
        
        Returns:
            dict: Default options matching click default_map format.
                  Example: {"login": {"oauth2_authorize_uri": "https://auth.example.com"}}
        """

Plugin Management

class Plugins:
    """Plugin management system for VDK Control CLI."""
    
    def __init__(self, project_name=PROJECT_NAME, load_registered=True):
        """
        Initialize plugin manager.
        
        Args:
            project_name: Plugin project name for entry point discovery
            load_registered: Whether to load registered plugins (True by default)
        """
    
    def load_builtin_plugin(self, builtin_plugin_module):
        """
        Register a built-in plugin module.
        
        Args:
            builtin_plugin_module: Module containing plugin implementations
        """
    
    def hook(self) -> PluginHookRelay:
        """
        Get hook relay for executing plugin hooks.
        
        Returns:
            PluginHookRelay: Interface for executing plugin hooks
        """

class PluginHookRelay:
    """Helper for executing plugin hooks with type safety."""
    
    def __init__(self, pm: pluggy.PluginManager):
        """Initialize with plugin manager."""
    
    def get_default_commands_options(self):
        """Execute default options hook, returns array of results from all plugins."""

Creating Custom Plugins

To create a VDK Control CLI plugin:

  1. Implement Hook Functions:
from vdk.api.control.plugin.markers import hookimpl

@hookimpl
def get_default_commands_options():
    """Set default CLI options."""
    return {
        "login": {
            "auth_type": "api-token",
            "api_token_authorization_url": "https://custom-auth.example.com"
        }
    }
  1. Register Plugin Entry Point in setup.py:
setup(
    name="vdk-control-cli-custom",
    entry_points={
        'vdk_control_cli.plugin': [
            'custom_plugin = my_package.plugin_module'
        ]
    }
)
  1. Install Plugin:
pip install vdk-control-cli-custom

Main Entry Points

Core application entry points for advanced usage.

def run():
    """
    Main entry point for the CLI application.
    Sets up all CLI commands and executes the click interface.
    """

@click.group(help="Command line tool for Data Jobs lifecycle management.")
@click.option("-d", "--dev", is_flag=True, help="Run in developer mode")
@click_log.simple_verbosity_option(logging.getLogger())
@click.version_option()
@click.pass_context
def cli(ctx: click.Context, dev: bool):
    """
    Main CLI group function that initializes the application.
    
    Args:
        ctx: Click context object
        dev: Enable developer mode for extra logging
    """

Environment Variables

The CLI recognizes these environment variables for configuration:

# Configuration environment variables:
VDK_BASE_CONFIG_FOLDER: str
    # Override local base configuration folder (default: $HOME/.vdk.internal)
    
VDK_CONTROL_SERVICE_REST_API_URL: str
    # Default Control Service URL if not specified as command line argument
    
VDK_API_TOKEN: str
    # Default API Token for authentication
    
VDK_API_TOKEN_AUTHORIZATION_URL: str
    # Default API token authorization URL
    
OAUTH_PORT: str
    # Port for OAuth2 credential flow (default: 31113)

Types

# Plugin system types
PluginManager = pluggy.PluginManager
HookspecMarker = pluggy.HookspecMarker
HookimplMarker = pluggy.HookimplMarker

# Click context for CLI commands
Context = click.Context