Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(deployments): add replicas support to creation and updates #160

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cli/src/command/deployments/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct CreateArgs {
#[arg(help = "Deployment tier.")]
pub tier: Tier,

#[arg(short, long)]
#[arg(long)]
#[arg(help = "The list of regions to deploy to.")]
#[arg(value_name = "regions")]
#[arg(value_delimiter = ',')]
Expand Down Expand Up @@ -64,6 +64,7 @@ impl CreateArgs {
network: config.network.clone(),
saya: Some(config.saya),
}),
torii: None,
}
}
CreateServiceCommands::Torii(config) => {
Expand All @@ -81,6 +82,9 @@ impl CreateArgs {
version: config.version.clone(),
config: slot::read::base64_encode_string(&service_config),
katana: None,
torii: Some(ToriiCreateInput {
replicas: config.replicas,
}),
}
}
};
Expand Down
8 changes: 8 additions & 0 deletions cli/src/command/deployments/services/torii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ pub struct ToriiCreateArgs {
#[arg(help = "Service version to use.")]
pub version: Option<String>,

#[arg(long, default_value = "1")]
#[arg(help = "The number of replicas to deploy.")]
pub replicas: Option<i64>,

#[command(flatten)]
pub torii_args: ToriiArgs,
}
Expand All @@ -20,6 +24,10 @@ pub struct ToriiUpdateArgs {
#[arg(help = "Service version to use.")]
pub version: Option<String>,

#[arg(long)]
#[arg(help = "The number of replicas to deploy.")]
pub replicas: Option<i64>,

#[command(flatten)]
pub torii_args: ToriiArgs,
}
8 changes: 8 additions & 0 deletions cli/src/command/deployments/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ pub struct UpdateArgs {
#[arg(help = "Deployment tier.")]
pub tier: Option<Tier>,

#[arg(short, long, default_value = "1")]
#[arg(help = "The number of replicas to deploy.")]
pub replicas: Option<i64>,

#[command(subcommand)]
update_commands: UpdateServiceCommands,
}
Expand All @@ -38,6 +42,7 @@ impl UpdateArgs {
type_: DeploymentService::katana,
version: config.version.clone(),
config: Some(slot::read::base64_encode_string(&service_config)),
torii: None,
}
}
UpdateServiceCommands::Torii(config) => {
Expand All @@ -62,6 +67,9 @@ impl UpdateArgs {
type_: DeploymentService::torii,
version: config.version.clone(),
config: Some(slot::read::base64_encode_string(&service_config)),
torii: Some(ToriiUpdateInput {
replicas: config.replicas,
}),
}
}
};
Expand Down
174 changes: 174 additions & 0 deletions slot/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6294,6 +6294,16 @@
"name": "KatanaCreateInput",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "torii",
"type": {
"kind": "INPUT_OBJECT",
"name": "ToriiCreateInput",
"ofType": null
}
}
],
"interfaces": [],
Expand Down Expand Up @@ -7573,6 +7583,22 @@
}
}
},
{
"args": [],
"deprecationReason": null,
"description": null,
"isDeprecated": false,
"name": "replicas",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
}
},
{
"args": [],
"deprecationReason": null,
Expand Down Expand Up @@ -9712,6 +9738,102 @@
}
}
},
{
"defaultValue": null,
"description": "replicas field predicates",
"name": "replicas",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "replicasNEQ",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "replicasIn",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
}
}
},
{
"defaultValue": null,
"description": null,
"name": "replicasNotIn",
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
}
}
},
{
"defaultValue": null,
"description": null,
"name": "replicasGT",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "replicasGTE",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "replicasLT",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "replicasLTE",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
},
{
"defaultValue": null,
"description": "auto_upgrade field predicates",
Expand Down Expand Up @@ -19569,6 +19691,48 @@
"name": "TokenPair",
"possibleTypes": []
},
{
"description": null,
"enumValues": [],
"fields": [],
"inputFields": [
{
"defaultValue": null,
"description": null,
"name": "replicas",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
}
],
"interfaces": [],
"kind": "INPUT_OBJECT",
"name": "ToriiCreateInput",
"possibleTypes": []
},
{
"description": null,
"enumValues": [],
"fields": [],
"inputFields": [
{
"defaultValue": null,
"description": null,
"name": "replicas",
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
}
],
"interfaces": [],
"kind": "INPUT_OBJECT",
"name": "ToriiUpdateInput",
"possibleTypes": []
},
{
"description": null,
"enumValues": [],
Expand Down Expand Up @@ -19638,6 +19802,16 @@
"name": "String",
"ofType": null
}
},
{
"defaultValue": null,
"description": null,
"name": "torii",
"type": {
"kind": "INPUT_OBJECT",
"name": "ToriiUpdateInput",
"ofType": null
}
}
],
"interfaces": [],
Expand Down