Deployment as swarm service

This commit is contained in:
mbecker20
2025-12-06 01:01:31 -08:00
committed by Maxwell Becker
parent 8c52232852
commit 5854a7de99
30 changed files with 439 additions and 166 deletions

View File

@@ -7,6 +7,7 @@ use crate::entities::{
SearchCombinator, U64,
docker::{
config::{SwarmConfig, SwarmConfigListItem},
network::NetworkListItem,
node::{SwarmNode, SwarmNodeListItem},
secret::{SwarmSecret, SwarmSecretListItem},
service::{SwarmService, SwarmServiceListItem},
@@ -485,3 +486,25 @@ pub struct InspectSwarmStack {
#[typeshare]
pub type InspectSwarmStackResponse = SwarmStack;
//
/// List the networks on the swarm. Response: [ListSwarmNetworksResponse].
///
/// This only includes the overlay networks.
/// They will be the same across all nodes in the swarm.
#[typeshare]
#[derive(
Serialize, Deserialize, Debug, Clone, Resolve, EmptyTraits,
)]
#[empty_traits(KomodoReadRequest)]
#[response(ListSwarmNetworksResponse)]
#[error(serror::Error)]
pub struct ListSwarmNetworks {
/// Id or name
#[serde(alias = "id", alias = "name")]
pub swarm: String,
}
#[typeshare]
pub type ListSwarmNetworksResponse = Vec<NetworkListItem>;

View File

@@ -44,7 +44,9 @@ pub struct DeploymentListItemInfo {
pub image: String,
/// Whether there is a newer image available at the same tag.
pub update_available: bool,
/// The server that deployment sits on.
/// The swarm that deployment is deployed on, when in Swarm mode.
pub swarm_id: String,
/// The server that deployment is deployed on, when in Server mode.
pub server_id: String,
/// An attached Komodo Build, if it exists.
pub build_id: Option<String>,

View File

@@ -43,6 +43,7 @@ export type ReadResponses = {
InspectSwarmService: Types.InspectSwarmServiceResponse;
GetSwarmServiceLog: Types.GetSwarmServiceLogResponse;
SearchSwarmServiceLog: Types.SearchSwarmServiceLogResponse;
ListSwarmNetworks: Types.ListSwarmNetworksResponse;
// ==== SERVER ====
GetServersSummary: Types.GetServersSummaryResponse;

View File

@@ -1366,7 +1366,9 @@ export interface DeploymentListItemInfo {
image: string;
/** Whether there is a newer image available at the same tag. */
update_available: boolean;
/** The server that deployment sits on. */
/** The swarm that deployment is deployed on, when in Swarm mode. */
swarm_id: string;
/** The server that deployment is deployed on, when in Server mode. */
server_id: string;
/** An attached Komodo Build, if it exists. */
build_id?: string;
@@ -5171,6 +5173,8 @@ export interface SwarmConfigListItem {
export type ListSwarmConfigsResponse = SwarmConfigListItem[];
export type ListSwarmNetworksResponse = NetworkListItem[];
/** Swarm node list item. */
export interface SwarmNodeListItem {
ID?: string;
@@ -8414,6 +8418,17 @@ export interface ListSwarmConfigs {
swarm: string;
}
/**
* List the networks on the swarm. Response: [ListSwarmNetworksResponse].
*
* This only includes the overlay networks.
* They will be the same across all nodes in the swarm.
*/
export interface ListSwarmNetworks {
/** Id or name */
swarm: string;
}
/**
* List nodes part of the target Swarm.
* Response: [ListSwarmNodesResponse].
@@ -10339,6 +10354,7 @@ export type ReadRequest =
| { type: "InspectSwarmService", params: InspectSwarmService }
| { type: "GetSwarmServiceLog", params: GetSwarmServiceLog }
| { type: "SearchSwarmServiceLog", params: SearchSwarmServiceLog }
| { type: "ListSwarmNetworks", params: ListSwarmNetworks }
| { type: "GetServersSummary", params: GetServersSummary }
| { type: "GetServer", params: GetServer }
| { type: "GetServerState", params: GetServerState }