Kurtosis Documentation

repository·main·Indexed 19 days ago

https://github.com/kurtosis-tech/kurtosis

Kurtosis is a platform for managing ephemeral development and testing stacks, providing a high-level abstraction over Docker and Kubernetes for reproducible, parameterized, and composable infrastructure. It includes SDKs for Go, Rust, and TypeScript to programmatically manage enclaves and services, a CLI for engine control and observability (Loki and Grafana), and a container-engine-lib for abstracting interactions with container backends.

Tokens
195.1K
Snippets
701
Records
960
Agent score
67%

What's inside Kurtosis

  1. Overview of the Kurtosis Metrics Library

    main

    The Metrics Library is a specialized tool used to collect Kurtosis-related metrics—such as when users are loading Kurtosis modules—and transmit them to an analytics service provider.

    Currently, the library only supports Segment as the analytics service provider.

  2. What is Kurtosis?

    main

    Kurtosis is a platform designed to handle the complexity of spinning up ephemeral development or test stacks. It provides a high-level abstraction over container engines like Docker or Kubernetes, allowing developers to focus on application logic rather than infrastructure configuration.

    Key components include:

    • Packaging System: Distributes backend stack definitions that can run on Docker or Kubernetes.
    • Runtime: Manages per-stack file systems for reproducible state initialization.
    • Tooling: Enables interaction with stacks similarly to how one interacts with Docker or Kubernetes.
  3. What is Kurtosis?

    main
    Kurtosis is a framework built on top of Docker designed for writing test suites for networked systems, such as blockchains or distributed datastores. It automates the lifecycle of setup, test execution, and teardown, managing the underlying Docker resources required for the test environment.
  4. Use the GRPC file streaming library for large payloads

    main
    GRPC has a hard limit on request size of 4MB. When you need to send large payloads (like files) between two GRPC services, you should use this library to implement GRPC streaming. It handles the logic of splitting files into small chunks and streaming them using either ServerStream or ClientStream objects, ensuring file integrity and early error detection.
  5. View and manage port mappings with the port-forward skill

    main
    The port-forward skill allows you to view and manage port mappings for Kurtosis services. It is used to identify which local ports map to specific service ports, which is essential when services are unreachable or you need to find the correct local address for a service.
  6. Manage Kurtosis cluster settings with cluster-manage

    main

    The cluster-manage skill allows you to manage where Kurtosis runs enclaves by switching between Docker and Kubernetes backends. You can list available clusters, check the current active backend, and switch between them.

    Compatibility Requirements:

    • Requires the kurtosis CLI.
    • For Kubernetes mode, you must have kubectl configured with valid cluster access.
  7. What is Kurtosis Portal and when to use it

    main

    Kurtosis Portal is a lightweight local daemon that enables communication with Kurtosis enclaves running on a remote Kurtosis server.

    Usage Decision Guide:

    • Local Docker: Do not use Portal.
    • Direct Kubernetes: Use kurtosis gateway instead of Portal.
    • Remote Kurtosis server: You must use Portal in conjunction with a remote context.
  8. What is a Plan in Kurtosis

    main

    A Plan is a representation of the actions Kurtosis will perform inside an enclave. It is the central component of Kurtosis's multi-phase run design. Plans are constructed using Starlark by calling methods on a Plan object, such as add_service, remove_service, or upload_files.

    Key Mental Model: Injection vs. Construction You do not instantiate a Plan object yourself. Instead, Kurtosis injects the Plan object into the run function of your main.star file. You can then pass this object to other functions or modules to define your infrastructure and orchestration logic.

    # ------ main.star ---------
    some_library = import_module("github.com/some-org/some-library/lib.star")
    
    def run(plan):
        plan.print("Hello, world!")
    
        some_library.do_something(plan)