Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal static partial class CreateModelsByModelIdEnvironmentsCommandApiCommand
};
private static readonly UpdateAutoscalingSettingsV1OptionSet AutoscalingSettingsOptions = UpdateAutoscalingSettingsV1OptionSet.Create(@"autoscaling-settings");

private static readonly UpdatePromotionSettingsV1OptionSet PromotionSettingsOptions = UpdatePromotionSettingsV1OptionSet.Create(@"promotion-settings");
private static readonly UpdateModelPromotionSettingsV1OptionSet PromotionSettingsOptions = UpdateModelPromotionSettingsV1OptionSet.Create(@"promotion-settings");
private static Option<string?> Input { get; } = new(@"--input")
{
Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.",
Expand Down Expand Up @@ -145,7 +145,7 @@ await CliRuntime.RunAsync(async () =>
var __PromotionSettingsSpecified = CliRuntime.WasSpecified(parseResult, PromotionSettingsOptions.RedeployOnPromotion) || CliRuntime.WasSpecified(parseResult, PromotionSettingsOptions.RollingDeploy) || CliRuntime.WasSpecified(parseResult, PromotionSettingsOptions.RampUpWhilePromoting) || CliRuntime.WasSpecified(parseResult, PromotionSettingsOptions.RampUpDurationSeconds);
var promotionSettings =
__PromotionSettingsSpecified || __PromotionSettingsBase is not null
? new global::Baseten.UpdatePromotionSettingsV1
? new global::Baseten.UpdateModelPromotionSettingsV1
{
RedeployOnPromotion = promotionSettingsRedeployOnPromotion,
RollingDeploy = promotionSettingsRollingDeploy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ internal static partial class EditModelsByModelIdEnvironmentsByEnvNameCommandApi
};
private static readonly UpdateAutoscalingSettingsV1OptionSet AutoscalingSettingsOptions = UpdateAutoscalingSettingsV1OptionSet.Create(@"autoscaling-settings");

private static readonly UpdatePromotionSettingsV1OptionSet PromotionSettingsOptions = UpdatePromotionSettingsV1OptionSet.Create(@"promotion-settings");
private static readonly UpdateModelPromotionSettingsV1OptionSet PromotionSettingsOptions = UpdateModelPromotionSettingsV1OptionSet.Create(@"promotion-settings");
private static Option<string?> Input { get; } = new(@"--input")
{
Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.",
Expand Down Expand Up @@ -152,7 +152,7 @@ await CliRuntime.RunAsync(async () =>
var __PromotionSettingsSpecified = CliRuntime.WasSpecified(parseResult, PromotionSettingsOptions.RedeployOnPromotion) || CliRuntime.WasSpecified(parseResult, PromotionSettingsOptions.RollingDeploy) || CliRuntime.WasSpecified(parseResult, PromotionSettingsOptions.RampUpWhilePromoting) || CliRuntime.WasSpecified(parseResult, PromotionSettingsOptions.RampUpDurationSeconds);
var promotionSettings =
__PromotionSettingsSpecified || __PromotionSettingsBase is not null
? new global::Baseten.UpdatePromotionSettingsV1
? new global::Baseten.UpdateModelPromotionSettingsV1
{
RedeployOnPromotion = promotionSettingsRedeployOnPromotion,
RollingDeploy = promotionSettingsRollingDeploy,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#nullable enable

using System.CommandLine;

namespace Baseten.CLI.Commands;

internal sealed record UpdateModelPromotionSettingsV1OptionSet(
Option<bool?> RedeployOnPromotion,
Option<bool?> RollingDeploy,
Option<bool?> RampUpWhilePromoting,
Option<int?> RampUpDurationSeconds)
{
public static UpdateModelPromotionSettingsV1OptionSet Create(string? prefix = null)
{
var normalizedPrefix = string.IsNullOrWhiteSpace(prefix)
? string.Empty
: prefix.Trim().Trim('-') + "-";
return new UpdateModelPromotionSettingsV1OptionSet(
RedeployOnPromotion: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}redeploy-on-promotion", description: @"Whether to deploy on all promotions. Enabling this flag allows model code to safely handle environment-specific logic. When a deployment is promoted, a new deployment will be created with a copy of the image."),
RollingDeploy: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}rolling-deploy", description: @"Whether the environment should rely on rolling deploy orchestration."),
RampUpWhilePromoting: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}ramp-up-while-promoting", description: @"Deprecated: models don't support canary promotions, and `true` is rejected. Use `rolling_deploy`."),
RampUpDurationSeconds: new Option<int?>($"--{normalizedPrefix}ramp-up-duration-seconds")
{
Description = @"Deprecated: models don't support canary promotions.",
}
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ partial void ProcessCreateModelsByModelIdEnvironmentsResponseContent(
/// },<br/>
/// "promotion_settings": {<br/>
/// "promotion_cleanup_strategy": null,<br/>
/// "ramp_up_duration_seconds": 600,<br/>
/// "ramp_up_while_promoting": true,<br/>
/// "ramp_up_duration_seconds": null,<br/>
/// "ramp_up_while_promoting": null,<br/>
/// "redeploy_on_promotion": true,<br/>
/// "rolling_deploy": false,<br/>
/// "rolling_deploy_config": null<br/>
Expand Down Expand Up @@ -123,8 +123,8 @@ partial void ProcessCreateModelsByModelIdEnvironmentsResponseContent(
/// },<br/>
/// "promotion_settings": {<br/>
/// "promotion_cleanup_strategy": null,<br/>
/// "ramp_up_duration_seconds": 600,<br/>
/// "ramp_up_while_promoting": true,<br/>
/// "ramp_up_duration_seconds": null,<br/>
/// "ramp_up_while_promoting": null,<br/>
/// "redeploy_on_promotion": true,<br/>
/// "rolling_deploy": false,<br/>
/// "rolling_deploy_config": null<br/>
Expand Down Expand Up @@ -523,7 +523,7 @@ partial void ProcessCreateModelsByModelIdEnvironmentsResponseContent(
string modelId,
string name,
global::Baseten.UpdateAutoscalingSettingsV1? autoscalingSettings = default,
global::Baseten.UpdatePromotionSettingsV1? promotionSettings = default,
global::Baseten.UpdateModelPromotionSettingsV1? promotionSettings = default,
global::Baseten.UpdateRequestBackpressureSettingsV1? requestBackpressureSettings = default,
global::Baseten.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ partial void ProcessEditModelsByModelIdEnvironmentsByEnvNameResponseContent(
/// },<br/>
/// "promotion_settings": {<br/>
/// "promotion_cleanup_strategy": null,<br/>
/// "ramp_up_duration_seconds": 600,<br/>
/// "ramp_up_while_promoting": true,<br/>
/// "ramp_up_duration_seconds": null,<br/>
/// "ramp_up_while_promoting": null,<br/>
/// "redeploy_on_promotion": true,<br/>
/// "rolling_deploy": null,<br/>
/// "rolling_deploy": true,<br/>
/// "rolling_deploy_config": null<br/>
/// },<br/>
/// "autoscaling_schedule_settings": {<br/>
Expand Down Expand Up @@ -160,10 +160,10 @@ partial void ProcessEditModelsByModelIdEnvironmentsByEnvNameResponseContent(
/// },<br/>
/// "promotion_settings": {<br/>
/// "promotion_cleanup_strategy": null,<br/>
/// "ramp_up_duration_seconds": 600,<br/>
/// "ramp_up_while_promoting": true,<br/>
/// "ramp_up_duration_seconds": null,<br/>
/// "ramp_up_while_promoting": null,<br/>
/// "redeploy_on_promotion": true,<br/>
/// "rolling_deploy": null,<br/>
/// "rolling_deploy": true,<br/>
/// "rolling_deploy_config": null<br/>
/// },<br/>
/// "autoscaling_schedule_settings": {<br/>
Expand Down Expand Up @@ -598,7 +598,7 @@ partial void ProcessEditModelsByModelIdEnvironmentsByEnvNameResponseContent(
string modelId,
string envName,
global::Baseten.UpdateAutoscalingSettingsV1? autoscalingSettings = default,
global::Baseten.UpdatePromotionSettingsV1? promotionSettings = default,
global::Baseten.UpdateModelPromotionSettingsV1? promotionSettings = default,
global::Baseten.UpdateAutoscalingScheduleSettingsV1? autoscalingScheduleSettings = default,
global::Baseten.UpdateRequestBackpressureSettingsV1? requestBackpressureSettings = default,
global::Baseten.AutoSDKRequestOptions? requestOptions = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public partial interface IBasetenClient
/// },<br/>
/// "promotion_settings": {<br/>
/// "promotion_cleanup_strategy": null,<br/>
/// "ramp_up_duration_seconds": 600,<br/>
/// "ramp_up_while_promoting": true,<br/>
/// "ramp_up_duration_seconds": null,<br/>
/// "ramp_up_while_promoting": null,<br/>
/// "redeploy_on_promotion": true,<br/>
/// "rolling_deploy": false,<br/>
/// "rolling_deploy_config": null<br/>
Expand Down Expand Up @@ -73,8 +73,8 @@ public partial interface IBasetenClient
/// },<br/>
/// "promotion_settings": {<br/>
/// "promotion_cleanup_strategy": null,<br/>
/// "ramp_up_duration_seconds": 600,<br/>
/// "ramp_up_while_promoting": true,<br/>
/// "ramp_up_duration_seconds": null,<br/>
/// "ramp_up_while_promoting": null,<br/>
/// "redeploy_on_promotion": true,<br/>
/// "rolling_deploy": false,<br/>
/// "rolling_deploy_config": null<br/>
Expand Down Expand Up @@ -115,7 +115,7 @@ public partial interface IBasetenClient
string modelId,
string name,
global::Baseten.UpdateAutoscalingSettingsV1? autoscalingSettings = default,
global::Baseten.UpdatePromotionSettingsV1? promotionSettings = default,
global::Baseten.UpdateModelPromotionSettingsV1? promotionSettings = default,
global::Baseten.UpdateRequestBackpressureSettingsV1? requestBackpressureSettings = default,
global::Baseten.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public partial interface IBasetenClient
/// },<br/>
/// "promotion_settings": {<br/>
/// "promotion_cleanup_strategy": null,<br/>
/// "ramp_up_duration_seconds": 600,<br/>
/// "ramp_up_while_promoting": true,<br/>
/// "ramp_up_duration_seconds": null,<br/>
/// "ramp_up_while_promoting": null,<br/>
/// "redeploy_on_promotion": true,<br/>
/// "rolling_deploy": null,<br/>
/// "rolling_deploy": true,<br/>
/// "rolling_deploy_config": null<br/>
/// },<br/>
/// "autoscaling_schedule_settings": {<br/>
Expand Down Expand Up @@ -107,10 +107,10 @@ public partial interface IBasetenClient
/// },<br/>
/// "promotion_settings": {<br/>
/// "promotion_cleanup_strategy": null,<br/>
/// "ramp_up_duration_seconds": 600,<br/>
/// "ramp_up_while_promoting": true,<br/>
/// "ramp_up_duration_seconds": null,<br/>
/// "ramp_up_while_promoting": null,<br/>
/// "redeploy_on_promotion": true,<br/>
/// "rolling_deploy": null,<br/>
/// "rolling_deploy": true,<br/>
/// "rolling_deploy_config": null<br/>
/// },<br/>
/// "autoscaling_schedule_settings": {<br/>
Expand Down Expand Up @@ -185,7 +185,7 @@ public partial interface IBasetenClient
string modelId,
string envName,
global::Baseten.UpdateAutoscalingSettingsV1? autoscalingSettings = default,
global::Baseten.UpdatePromotionSettingsV1? promotionSettings = default,
global::Baseten.UpdateModelPromotionSettingsV1? promotionSettings = default,
global::Baseten.UpdateAutoscalingScheduleSettingsV1? autoscalingScheduleSettings = default,
global::Baseten.UpdateRequestBackpressureSettingsV1? requestBackpressureSettings = default,
global::Baseten.AutoSDKRequestOptions? requestOptions = default,
Expand Down
12 changes: 7 additions & 5 deletions src/libs/Baseten/Generated/Baseten.JsonSerializerContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,12 @@ namespace Baseten
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.EnvironmentAutoscalingSchedulesV1ScheduleDiscriminatorCadence), TypeInfoPropertyName = "EnvironmentAutoscalingSchedulesV1ScheduleDiscriminatorCadence2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.EnvironmentV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.InProgressPromotionV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.PromotionSettingsV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.ModelPromotionSettingsV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.InProgressPromotionStatusV1), TypeInfoPropertyName = "InProgressPromotionStatusV12")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.RollingDeployConfigV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.EnvironmentsV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Baseten.EnvironmentV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateModelPromotionSettingsV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.CreateEnvironmentRequestV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.EnvironmentTombstoneV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateEnvironmentRequestV1))]
Expand All @@ -341,6 +342,7 @@ namespace Baseten
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.CreateChainEnvironmentRequestV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Baseten.ChainletEnvironmentSettingsRequestV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.ChainletEnvironmentSettingsV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.PromotionSettingsV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.ChainEnvironmentV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Baseten.ChainletEnvironmentSettingsV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.UpdateChainEnvironmentRequestV1))]
Expand Down Expand Up @@ -507,8 +509,6 @@ namespace Baseten
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.GetLoopsDeploymentMetricsRequestV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.InferenceVolumeByStatusDatapointV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.LoopsDeploymentMetricsV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Baseten.ResponseTimeDatapointV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.ResponseTimeDatapointV1))]
internal sealed partial class SourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext
{
}
Expand All @@ -519,6 +519,8 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex
[global::System.Text.Json.Serialization.JsonSourceGenerationOptions(
DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull
)]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Baseten.ResponseTimeDatapointV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.ResponseTimeDatapointV1))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Baseten.InferenceVolumeByStatusDatapointV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Baseten.LoopsDeploymentNodeMetricsV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Baseten.LoopsDeploymentNodeMetricsV1))]
Expand Down Expand Up @@ -1017,8 +1019,6 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Baseten.AuthCodeV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Baseten.FileSummary>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Baseten.OrderByV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Baseten.SupportedModelV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Baseten.LoopsRunV1>))]
internal sealed partial class SourceGenerationContextChunk1 : global::System.Text.Json.Serialization.JsonSerializerContext
{
}
Expand All @@ -1029,6 +1029,8 @@ internal sealed partial class SourceGenerationContextChunk1 : global::System.Tex
[global::System.Text.Json.Serialization.JsonSourceGenerationOptions(
DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull
)]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Baseten.SupportedModelV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Baseten.LoopsRunV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Baseten.LoopsSamplerV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Baseten.LoopsCheckpointV1>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Baseten.LoopsDeploymentV1>))]
Expand Down
Loading
Loading