Layotto Documentation

repository·main·Indexed 21 days ago

https://github.com/mosn/layotto

An application runtime built on MOSN that provides distributed capabilities—such as state, configuration, and pub/sub—to applications via a lightweight SDK. Layotto integrates with Service Meshes like Istio for multi-runtime capabilities in a single sidecar and can serve as a WASM-based FaaS runtime supporting AssemblyScript and Rust.

Tokens
98.9K
Snippets
329
Records
453
Agent score
74%

What's inside Layotto

  1. Overview of Layotto (L8)

    main

    Layotto is an application runtime developed in Golang designed to help developers build cloud-native applications by decoupling them from the underlying infrastructure. It provides distributed capabilities such as state management, configuration management, and event pub/sub.

    Built on top of the open-source MOSN, Layotto combines Multi-Runtime capabilities with Service Mesh features. It can act as a data plane for Istio while simultaneously providing Runtime APIs (e.g., Configuration, Pub/Sub) without requiring additional sidecars. It also supports using WebAssembly (WASM) to function as a FaaS (Function as a Service) runtime container.

  2. Overview of Layotto API Programming

    main

    Layotto provides a set of APIs designed to allow application developers to leverage distributed capabilities directly within their code. Instead of managing complex distributed systems logic manually, developers can call Layotto APIs to access services such as:

    • Distributed Databases: Accessing managed data stores.
    • Distributed Locks: Managing concurrency across multiple instances.
    • Other Distributed Capabilities: Various other primitives provided by the Layotto runtime.

    Programming against the Layotto API allows you to offload the complexity of distributed systems to the Layotto layer.

  3. Use the Layotto Actuator HTTP API for monitoring and health checks

    main

    The Layotto Actuator API provides HTTP endpoints for health checks and retrieving runtime metadata. It is designed for integration with operational infrastructure like Kubernetes (e.g., for liveness and readiness probes) or SRE dashboards to monitor the status of Layotto and the application.

    By default, these APIs return metadata for Layotto. To include application-specific metadata or health status, you must develop a plugin that calls back to the application. The API follows a RESTful pattern: /actuator/{endpoint_name}/{params}.

  4. Access Layotto gRPC Runtime and Extension APIs

    main

    Layotto's runtime capabilities are exposed via gRPC APIs defined in proto files. These APIs are categorized into two main types:

    1. Runtime APIs:

      • App-facing APIs: APIs that Layotto provides to your application to facilitate orchestration and service mesh features.
      • Callback APIs: APIs that your application must implement so that Layotto can call back into your app (e.g., to retrieve pubsub subscription messages).
    2. Extension APIs: Specialized APIs for specific functionalities such as storage, communication, and messaging.

    Detailed documentation for the runtime and extension interfaces can be found at the official Layotto API portal.

    <!-- Detailed API documentation is available at: -->
    https://mosn.io/layotto/api/v1/runtime.html
  5. Understand Layotto GitHub Workflows

    main

    Layotto uses four primary GitHub Workflows to maintain code quality, security, and automate the development, build, and release processes. These workflows ensure compliance with project standards and simplify repetitive tasks.

    The four pipelines are:

    1. Layotto Env Pipeline: Focuses on project and environment standardization (e.g., PR title validation, license checks, and documentation link validation).
    2. Layotto Dev Pipeline (Before Merged): Validates code quality and integration via Pull Requests (e.g., Go linting, unit tests, and WASM/Runtime integration tests).
    3. Layotto Dev Pipeline (After Merged): Handles post-merge validation and continuous deployment of the latest images (e.g., publishing :latest Docker images).
    4. Layotto Release Pipeline: Manages the formal release process, including building artifacts and publishing versioned Docker images based on Git tags.
  6. What is Layotto Actuator

    main
    Layotto Actuator is a built-in monitoring feature designed to monitor and manage Layotto and its services in production environments. It provides HTTP APIs to perform health checks and query runtime metadata, allowing you to observe the status of various components within the Layotto ecosystem.
  7. What is the SmsService API?

    main

    The SmsService is a Layotto API used to send SMS messages.

    Developers can interact with this service in two ways:

    1. Using SDKs: Layotto provides multi-language SDKs (e.g., Go SDK located in the sdk directory, and a Java SDK available at https://github.com/layotto/java-sdk).
    2. Direct gRPC: You can use any programming language to interact with Layotto directly via gRPC.
  8. What is the State API

    main

    The State API is a set of Key/Value CRUD (Create, Read, Update, Delete) operations that allows your application to interact with different databases or storage systems using a unified interface.

    By using the State API, you can:

    • Decouple from Cloud/Storage Providers: Deploy the same business logic across different environments without changing code.
    • Reuse Middleware Across Languages: Instead of maintaining language-specific SDKs (e.g., for Java and Python), different applications can interact with the same database and middleware using a single set of gRPC APIs via Layotto.