stack

package
v0.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackupCmd = &cobra.Command{
	Use:   "backup <collection> --output <file>",
	Short: "Backup a collection from the stack's vector database",
	Long: `Backup a collection from the weave stack's Milvus instance to a portable .weavebak file.

This command connects to the stack's Milvus instance via port-forwarding and exports
all documents from the specified collection.

The backup includes:
  • All document embeddings (vectors)
  • All document content and metadata
  • Images and external storage references

Use case: Create snapshots of your stack collections for disaster recovery or migration.`,
	Example: `  # Backup a stack collection
  weave stack backup Documents --output backups/docs.weavebak

  # Backup without compression
  weave stack backup Images --output backups/images.weavebak --no-compress

  # Backup all collections
  weave stack backup --all --output backups/

  # Backup with custom batch size
  weave stack backup Documents --output backup.weavebak --batch-size 500`,
	Args: func(cmd *cobra.Command, args []string) error {
		if backupAllCollections {
			return nil
		}
		return cobra.ExactArgs(1)(cmd, args)
	},
	RunE: runStackBackup,
}

BackupCmd represents the stack backup command

View Source
var CollectionsCmd = &cobra.Command{
	Use:   "collections",
	Short: "Manage stack collections",
	Long: `Manage collections in the deployed stack.

Commands:
  reset   Delete all collections without tearing down infrastructure`,
}

CollectionsCmd represents the collections command

View Source
var DashboardCmd = &cobra.Command{
	Use:   "dashboard",
	Short: "Manage stack dashboard",
	Long: `Start, stop, and manage the weave stack dashboard.

The dashboard provides a web interface for interacting with your RAG stack.
It can be managed using PM2 (local/VM) or Kubernetes (cloud).

Examples:
  weave stack dashboard start     # Start dashboard with PM2
  weave stack dashboard stop      # Stop dashboard
  weave stack dashboard status    # Show dashboard status
  weave stack dashboard logs      # Stream dashboard logs`,
}

DashboardCmd represents the dashboard command

View Source
var DownCmd = &cobra.Command{
	Use:   "down",
	Short: "Stop and remove the stack",
	Long: `Stop all stack services and remove the Kubernetes cluster.

This command:
1. Uninstalls Helm releases
2. Deletes the K8s cluster
3. Cleans up state files

Example:
  weave stack down`,
	RunE: runDown,
}

DownCmd represents the stack down command

View Source
var IngestCmd = &cobra.Command{
	Use:   "ingest [collection-name] [data-path]",
	Short: "Ingest data into stack collection(s)",
	Long: `Ingest data into a collection in the deployed stack.

This command automatically connects to the Milvus instance running in your
stack and ingests documents using the existing weave ingestion pipeline.

The command will:
  1. Detect active stack from .weave-state/
  2. Port-forward to Milvus (if needed)
  3. Create collection (if doesn't exist)
  4. Ingest documents with progress tracking
  5. Show ingestion summary

Examples:
  # Ingest PDFs into Documents collection
  weave stack ingest Documents data/pdfs/

  # Ingest images with custom embedding
  weave stack ingest Images data/images/ \
    --type image \
    --embedding text-embedding-3-small

  # Parallel ingestion with custom chunk size
  weave stack ingest Docs data/ \
    --chunk-size 1000 \
    --parallel-workers 4 \
    --batch-size 20

  # Ingest all collections from weave-stack.yaml
  weave stack ingest --all

  # Ingest all with restart protection
  weave stack ingest --all --restart-every 3`,
	Args: cobra.RangeArgs(0, 2),
	RunE: runIngest,
}

IngestCmd represents the ingest command

View Source
var InitCmd = &cobra.Command{
	Use:   "init",
	Short: "Initialize a new weave stack",
	Long: `Initialize a new weave stack by generating weave-stack.yaml.

This command creates a new stack configuration file with sensible defaults
for your chosen runtime environment (Kind, Minikube, EKS, GKE).

Templates:
  quickstart  - Minimal stack (1 collection, Milvus, local K8s)
  production  - Full stack (collections, evals, dashboard)
  multimodal  - Text + image collections
  oss         - Ollama + sentence-transformers (no API keys)

Examples:
  # Initialize with quickstart template for Kind
  weave stack init --template quickstart --runtime kind

  # Initialize for AWS EKS production
  weave stack init --template production --runtime eks

  # Initialize with defaults (quickstart + kind)
  weave stack init`,
	RunE: runInit,
}

InitCmd represents the stack init command

View Source
var KubectlCmd = &cobra.Command{
	Use:   "kubectl -- <kubectl-args>",
	Short: "Run kubectl commands with stack context",
	Long: `Run kubectl commands with the stack's Kubernetes context automatically set.

This command is a convenience wrapper that automatically adds the --context flag
pointing to your stack's Kubernetes cluster, so you don't have to specify it manually.

Examples:
  weave stack kubectl -- get pods
  weave stack kubectl -- describe pod weave-stack-milvus-xyz
  weave stack kubectl -- get services
  weave stack kubectl -- logs weave-stack-milvus-xyz --follow

Note: The "--" separator is required to separate stack flags from kubectl flags.`,
	RunE:                  runKubectl,
	DisableFlagParsing:    true,
	DisableFlagsInUseLine: true,
}

KubectlCmd represents the kubectl passthrough command

View Source
var LogsCmd = &cobra.Command{
	Use:   "logs [service]",
	Short: "Stream logs from stack services",
	Long: `Stream logs from services running in the stack.

For Kubernetes deployments, this streams logs from pods.
For PM2 dashboard, use 'weave stack dashboard logs'.

Examples:
  weave stack logs milvus              # Show last 100 lines from Milvus
  weave stack logs milvus --follow     # Follow Milvus logs in real-time
  weave stack logs milvus --tail 50    # Show last 50 lines
  weave stack logs vectordb -f         # Follow vectordb logs`,
	Args: cobra.MaximumNArgs(1),
	RunE: runLogs,
}

LogsCmd represents the logs command

View Source
var PortForwardCmd = &cobra.Command{
	Use:   "port-forward <service> <port-mapping>",
	Short: "Forward local port to service",
	Long: `Forward a local port to a service in the stack.

This command sets up port forwarding from your local machine to a Kubernetes
service in the stack, allowing you to access the service as if it were running locally.

The port mapping format is: LOCAL_PORT:REMOTE_PORT

Examples:
  weave stack port-forward milvus 19530:19530
  weave stack port-forward milvus 8080:19530
  weave stack port-forward vectordb 19530:19530

After running this command:
  - Access Milvus at: localhost:19530
  - Press Ctrl+C to stop port forwarding

Common Services:
  milvus:     19530 (gRPC), 9091 (metrics)
  dashboard:  3000 (HTTP)`,
	Args: cobra.ExactArgs(2),
	RunE: runPortForward,
}

PortForwardCmd represents the port-forward command

View Source
var StatusCmd = &cobra.Command{
	Use:   "status",
	Short: "Show stack status",
	Long: `Show the status of the stack and its components.

Example:
  weave stack status`,
	RunE: runStatus,
}

StatusCmd represents the stack status command

View Source
var UpCmd = &cobra.Command{
	Use:   "up",
	Short: "Deploy the stack to Kubernetes",
	Long: `Deploy the complete RAG stack to Kubernetes.

This command:
1. Creates a K8s cluster (if needed)
2. Generates Helm charts from weave-stack.yaml
3. Deploys infrastructure (VectorDB, etc.)
4. Waits for services to be ready

Example:
  weave stack up --runtime kind
  weave stack up --runtime minikube
  weave stack up --skip-cluster-creation  # Use existing cluster`,
	RunE: runUp,
}

UpCmd represents the stack up command

View Source
var ValidateCmd = &cobra.Command{
	Use:   "validate",
	Short: "Validate weave-stack.yaml configuration",
	Long: `Validate weave-stack.yaml for correctness.

This command checks:
- YAML syntax
- Required fields
- Valid values for runtime, vectordb type, etc.
- Resource specifications
- Collection schemas

Example:
  weave stack validate`,
	RunE: runValidate,
}

ValidateCmd represents the stack validate command

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL