Kuscia (Kubernetes-based Secure Collaborative InfrA)

repository·main·Indexed 40 days ago

https://github.com/secretflow/kuscia

A lightweight, K3s-based orchestration framework for privacy-preserving computing tasks. Kuscia provides a unified HTTP/GRPC API layer to manage secure, cross-domain collaborative computing across heterogeneous infrastructures, featuring capabilities like DataMesh for data source management and integration with Prometheus and Grafana for performance monitoring.

Tokens
178.8K
Snippets
392
Records
570
Agent score
47%

What's inside Kuscia

  1. Overview of Data Mesh API

    main

    The Data Mesh API is designed for privacy computing applications (such as SecretFlow and TrustedFlow) to provide capabilities for retrieving DomainData and DomainDataSource information. Privacy computing platforms (like SecretPad) can leverage the Kuscia API to implement broader functionalities.

    Unlike the standard Kuscia API which resides on the master, the Data Mesh API is located on the Domain side.

  2. Overview of Kuscia

    main

    Kuscia (Kubernetes-based Secure Collaborative InfrA) is a lightweight privacy-preserving computation task orchestration framework based on K3s. It is designed to abstract away heterogeneous infrastructure and protocols, providing a unified foundation for privacy-preserving computation.

    Key capabilities include:

    • Lightweight Deployment: Capable of performing 1 million-scale Private Set Intersection (PSI) tasks with as little as 1 CPU and 2GB of RAM.
    • Secure Cross-Domain Communication: Supports port reuse (requiring only a single public port) and secure communication during concurrent privacy-preserving computation tasks.
    • Unified API Interface: Integration of privacy-preserving computation capabilities via HTTP and gRPC APIs.
    • Interoperability: Designed to interconnect with various privacy-preserving computation systems in the industry.
  3. What is Kuscia?

    main

    Kuscia (Kubernetes-based Secure Collaborative InfrA) is a lightweight privacy-preserving computing task orchestration framework built on K3s. It is designed to abstract away heterogeneous infrastructure and protocols, providing a unified foundation for privacy-preserving computing tasks.

    Key capabilities include:

    • Lightweight Deployment: Capable of performing tasks like Privacy Set Intersection (PSI) on datasets with 1 million records using as little as 1 CPU and 2 GB RAM.
    • Cross-domain Network Security: Supports secure communication and port reuse (requiring only one public network port) during concurrent execution of multiple tasks.
    • Unified API Interface: Integration is achieved through HTTP and GRPC API interfaces.
    • Interconnection: Designed to interconnect with various industry-standard privacy-preserving computing systems.
  4. Overview of DomainData APIs

    main

    The DomainData API allows for the management of data objects within a Kuscia Domain. These APIs are part of the Data Mesh functionality, enabling Domain-side management of data.

    Available operations include creating, updating, deleting, querying, and listing data objects. There is also a specialized method for deleting both the data object and its underlying physical data.

  5. What is Kuscia and its core value propositions

    main

    Kuscia is a cross-domain privacy computing task orchestration framework designed to solve common industrialization challenges. It acts as a framework layer that sits between product interfaces (like SecretPad) and privacy computing engines (like SecretFlow, TrustedFlow, or SCQL).

    Key Capabilities

    • Lightweight Deployment: Supports one-click deployment on Linux, Mac, or Windows (WSL) using minimal resources (e.g., 1C2G) across physical machines, VMs, or Kubernetes.
    • Flexible Network Adaptation: Enables multi-task concurrency using a single public port and uses HTTP for data forwarding to bypass restrictive institutional gateways.
    • Multi-Engine Integration: Integrates engines like SecretFlow, TrustedFlow (TEE), and SecretFlow Serving. Engines can be added or upgraded dynamically without redeploying the entire infrastructure.
    • Simplified API: Provides a unified API to launch arbitrary algorithm tasks, reducing integration complexity.
    • Task Orchestration: Supports DAG (Directed Acyclic Graph) mode for complex task pipelines and multi-engine coordination.
    • Heterogeneous Data Support: Connects to various data sources including Local paths, OSS, and MySQL, with support for custom extensions.
  6. Overview of the Kuscia Serving API

    main

    The Kuscia Serving API allows you to manage persistent, general-purpose services (such as Secretflow Serving) within the Kuscia ecosystem. The API is defined via protobuf and supports lifecycle management including creation, querying, updating, and deletion of services.

    Available methods include:

    • CreateServing: Creates a new serving instance.
    • QueryServing: Retrieves details of a specific serving instance.
    • UpdateServing: Modifies an existing serving instance.
    • DeleteServing: Removes a serving instance.
    • BatchQueryServingStatus: Performs a bulk query of the statuses of multiple serving instances.
  7. Understand Kuscia Architecture and Components

    main

    Kuscia (Kubernetes-based Secure Collaborative InfrA) is a lightweight privacy computing task orchestration framework based on K3s. It abstracts heterogeneous infrastructure and protocols to provide a unified foundation for resource management, application scheduling, container loading, service discovery, and data security.

    Core Architecture

    The cluster consists of two main parts:

    1. Control Plane (Master): Responsible for scheduling and resource management.
    2. Nodes: Responsible for computation.

    Key Components

    Control Plane Components

    • K3s: A lightweight Kubernetes distribution for managing built-in resources.
    • Kuscia Controllers: A set of custom controllers:
      • Job Controller: Parses Job DAGs, orchestrates multi-task scheduling, and collects task status.
      • Task Controller: Parses task descriptions and implements multi-party Co-Scheduling (corresponds to vertices in a Job DAG).
      • Kuscia Scheduler: Handles Co-Scheduling of multi-party Pods with an 'All-or-Nothing' effect.
      • Domain Controller: Manages node resources and assigns Namespaces.
      • DomainRoute Controller: Manages routing rules, identity authentication, and authorization policies between nodes and the Master.
      • InterConn Controllers: Enables connectivity between different control planes for multi-party task scheduling.
      • Data Controller (Not Open Source): Manages data authorization.
      • Serving Controller (Not Open Source): Orchestrates and schedules resident task flows.
    • Kuscia Storage (Not Open Source): Supplements K3s storage for large-value resources like job configurations.
    • Envoy: Acts as a traffic proxy between nodes and the Master, or between Masters. It receives routing and security policies from the DomainRoute Controller.

    Node Components

    Nodes are privacy computing nodes composed of working machines (VMs or physical) hosting privacy computing application Pods. They are categorized by networking mode:

    • Lite Nodes: Used in centralized networks; they do not contain a control plane.
    • Autonomy Nodes: Used in P2P networks; each contains its own independent control plane.

    Lite Node Sub-components:

    • Agent: Handles node registration and container management (lifecycle of Pods and node instances).
    • NetworkMesh: Provides networking infrastructure, including CoreDNS (service discovery), DomainRoute (routing/auth), Envoy (traffic proxy), and Transport (message queue communication).
    • DataMesh (Incomplete): Manages data source/dataset registration. Warning: Do not use in production as it lacks permission control.
  8. Core capabilities of Kuscia

    main

    Kuscia is a lightweight, cross-domain privacy computing task orchestration framework designed to serve as the runtime foundation for privacy computing engines. It addresses common challenges in the lifecycle of privacy computing tasks, including deployment, execution, and maintenance.

    Key capabilities include:

    • Lightweight Deployment: Supports low-resource environments (as low as 1C2G) and offers one-click deployment scripts. It supports Server and K8s deployment modes across Linux, MacOS, and Windows (WSL).
    • Secure Cross-Domain Communication: Establishes secure network links using MTLS or HTTPS. It supports port reuse for concurrent tasks and uses HTTP forwarding to ensure compatibility with most institutional gateways. It also supports proxy forwarding via third-party Kuscia nodes for scenarios where direct connection is impossible.
    • Cross-Domain Task Scheduling: Orchestrates task pipelines based on dependencies, priorities, and resource quotas. It supports multiple runtimes: RunP (lightweight process), RunC (containerized), and RunK (Kubernetes).
    • Multi-Engine & Multi-Data Source Support: Supports engines like SecretFlow, TrustedFlow, and Easy PSI, and allows for custom extensions. It supports data sources like local disks and OSS via the DataMesh interface.
    • Interoperability: Enables communication between different privacy computing vendors through the Kuscia InterOp protocol.
  9. What is a Domain in Kuscia?

    main

    In Kuscia, a Domain represents a privacy computing node. A single Domain can contain multiple K3s worker nodes (Nodes).

    Kuscia leverages the K3s Namespace mechanism to manage node permissions and resource isolation; every Domain corresponds to a specific K3s Namespace. This allows users to manage and maintain privacy computing nodes through Kubernetes-native resources.

  10. What is a KusciaJob?

    main

    A KusciaJob represents a task workflow in Kuscia. It is structured as a Directed Acyclic Graph (DAG) of KusciaTask objects. For any edge a -> b in the graph, task a is considered a dependency of task b.

    The KusciaJob Controller automatically manages the lifecycle and creation of these tasks based on a specified scheduleMode until all tasks have either completed or failed. Each KusciaTask within the job executes a collaborative computing operator across multiple parties.

    # Conceptual DAG Example:
    # Privacy Intersection (PSI) -> Random Split -> Model Training -> Prediction
  11. What is KusciaDeployment and how does it work?

    main

    KusciaDeployment (KD) is the resource used to manage resident services (常驻服务) in Kuscia, such as federated prediction services.

    When you create a KusciaDeployment, the KusciaDeployment Controller automatically creates associated K3s resources (like Service, Deployment, ConfigMap, and Pod) on the participating nodes based on the KD specification. This allows you to manage application configurations, replica counts, resource sizes, images, and update strategies across multiple parties easily.