Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Ray project Ray Serve DeploymentInfo

From Leeroopedia
Knowledge Sources
Domains Model_Serving, Distributed_Computing
Last Updated 2026-02-13 16:00 GMT

Overview

DeploymentInfo is a data class that holds comprehensive metadata about a Ray Serve deployment including its name, configuration, replica settings, version, and lifecycle timestamps.

Description

DeploymentInfo is a plain POJO that aggregates deployment-level information: the deployment name, a DeploymentConfig for scaling and routing settings, a ReplicaConfig for replica resource requirements, an actor name, a version string, and start/end timestamps in milliseconds. It provides a fromProto() static factory method that deserializes from a generated protobuf DeploymentInfo message, delegating nested deserialization to DeploymentConfig.fromProto() and ReplicaConfig.fromProto().

Usage

Use DeploymentInfo when deserializing deployment information received from the controller, particularly when querying deployment details via the client API or processing deployment state updates through the long poll mechanism.

Code Reference

Source Location

  • Repository: Ray
  • File: java/serve/src/main/java/io/ray/serve/deployment/DeploymentInfo.java

Signature

public class DeploymentInfo {

    public static DeploymentInfo fromProto(
        io.ray.serve.generated.DeploymentInfo proto)
}

Import

import io.ray.serve.deployment.DeploymentInfo;

I/O Contract

Fields

Field Type Description
name String Name of the deployment
deploymentConfig DeploymentConfig Configuration for scaling, routing, and other deployment-level settings
replicaConfig ReplicaConfig Configuration for replica resource allocation and class instantiation
startTimeMs Long Deployment start timestamp in milliseconds (null if not set)
actorName String Name of the Ray actor backing the deployment
version String Version string of the deployment
endTimeMs Long Deployment end timestamp in milliseconds (null if not set)

Key Methods

Method Return Type Description
getName() / setName(String) String / void Gets or sets the deployment name
getDeploymentConfig() / setDeploymentConfig(DeploymentConfig) DeploymentConfig / void Gets or sets the deployment configuration
getReplicaConfig() / setReplicaConfig(ReplicaConfig) ReplicaConfig / void Gets or sets the replica configuration
getStartTimeMs() / setStartTimeMs(Long) Long / void Gets or sets the deployment start time
getActorName() / setActorName(String) String / void Gets or sets the actor name
getVersion() / setVersion(String) String / void Gets or sets the version string
getEndTimeMs() / setEndTimeMs(Long) Long / void Gets or sets the deployment end time
fromProto(proto) DeploymentInfo Static factory that deserializes from a protobuf message

Usage Examples

// Deserialize a DeploymentInfo from a protobuf message received from the controller
io.ray.serve.generated.DeploymentInfo proto = getDeploymentInfoProto();
DeploymentInfo info = DeploymentInfo.fromProto(proto);

// Access deployment metadata
String deploymentName = info.getName();
String version = info.getVersion();
DeploymentConfig deployConfig = info.getDeploymentConfig();
ReplicaConfig replicaConfig = info.getReplicaConfig();

// Check deployment timing
Long startTime = info.getStartTimeMs();
if (startTime != null) {
    System.out.println("Deployment started at: " + startTime);
}

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment