talos/api/machine/lifecycle.proto
Mateusz Urbanek 15a5ec9985
feat: implement new install/upgrade API
Implement new minimal Install/Upgrade LifecycleService API with streaming
support for real-time progress reporting. Add protobuf definitions, gRPC
service implementation, and client bindings.

Signed-off-by: Mateusz Urbanek <mateusz.urbanek@siderolabs.com>
2026-03-06 12:16:35 +01:00

74 lines
2.9 KiB
Protocol Buffer

syntax = "proto3";
package machine;
import "common/common.proto";
option go_package = "github.com/siderolabs/talos/pkg/machinery/api/machine";
option java_package = "dev.talos.api.machine";
// The LifecycleService handles installation and upgrade operations.
service LifecycleService {
// Install Talos to disk.
// The RPC should fail if the Talos is already installed on the target disk.
rpc Install(LifecycleServiceInstallRequest) returns (stream LifecycleServiceInstallResponse);
// Upgrade Talos to a new version.
// The RPC should fail if Talos is not already installed on the target disk.
rpc Upgrade(LifecycleServiceUpgradeRequest) returns (stream LifecycleServiceUpgradeResponse);
}
// InstallArtifactsSource specifies the source of the installation artifacts.
message InstallArtifactsSource {
// The reference name of the image, as returned by `talosctl image pull`.
string image_name = 1;
}
// InstallDestination specifies the target for installation.
message InstallDestination {
// The disk to which Talos should be installed, e.g. "/dev/sda".
string disk = 1;
}
// LifecycleServiceInstallRequest contains the necessary information to perform an installation.
message LifecycleServiceInstallRequest {
// The containerd instance to use for pulling the installation artifacts.
common.ContainerdInstance containerd = 1;
// The source of the installation artifacts.
InstallArtifactsSource source = 2;
// The destination for the installation.
InstallDestination destination = 3;
}
// LifecycleServiceInstallProgress represents the progress of the installation or upgrade process.
message LifecycleServiceInstallProgress {
oneof response {
// A message indicating the current progress of the installation or upgrade.
string message = 1;
// An exit code indicating the result of the installation or upgrade process.
// A non-zero value indicates an error.
// Server SHOULD NOT respond with error, even if the value is non-zero.
// It's responsibility of the client to handle the exit code appropriately.
int32 exit_code = 2;
}
}
// LifecycleServiceInstallResponse is the response message for the Install RPC, containing progress updates.
message LifecycleServiceInstallResponse {
// The progress of the installation process.
LifecycleServiceInstallProgress progress = 1;
}
// LifecycleServiceUpgradeRequest contains the necessary information to perform an upgrade.
message LifecycleServiceUpgradeRequest {
// The containerd instance to use for pulling the installation artifacts.
common.ContainerdInstance containerd = 1;
// The source of the installation artifacts for the upgrade.
InstallArtifactsSource source = 2;
}
// LifecycleServiceUpgradeResponse is the response message for the Upgrade RPC, containing progress updates.
message LifecycleServiceUpgradeResponse {
// The progress of the upgrade process.
LifecycleServiceInstallProgress progress = 1;
}