#[non_exhaustive]pub struct DeploymentSpec {
pub env: Vec<EnvVar>,
pub secret_env: Vec<SecretEnvVar>,
pub psc_interface_config: Option<PscInterfaceConfig>,
pub min_instances: Option<i32>,
pub max_instances: Option<i32>,
pub resource_limits: HashMap<String, String>,
pub container_concurrency: Option<i32>,
/* private fields */
}reasoning-engine-service only.Expand description
The specification of a Reasoning Engine deployment.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.env: Vec<EnvVar>Optional. Environment variables to be set with the Reasoning Engine deployment. The environment variables can be updated through the UpdateReasoningEngine API.
secret_env: Vec<SecretEnvVar>Optional. Environment variables where the value is a secret in Cloud Secret Manager. To use this feature, add ‘Secret Manager Secret Accessor’ role (roles/secretmanager.secretAccessor) to AI Platform Reasoning Engine Service Agent.
psc_interface_config: Option<PscInterfaceConfig>Optional. Configuration for PSC-I.
min_instances: Option<i32>Optional. The minimum number of application instances that will be kept running at all times. Defaults to 1. Range: [0, 10].
max_instances: Option<i32>Optional. The maximum number of application instances that can be launched to handle increased traffic. Defaults to 100. Range: [1, 1000].
If VPC-SC or PSC-I is enabled, the acceptable range is [1, 100].
resource_limits: HashMap<String, String>Optional. Resource limits for each container. Only ‘cpu’ and ‘memory’ keys are supported. Defaults to {“cpu”: “4”, “memory”: “4Gi”}.
- The only supported values for CPU are ‘1’, ‘2’, ‘4’, ‘6’ and ‘8’. For more information, go to https://cloud.google.com/run/docs/configuring/cpu.
- The only supported values for memory are ‘1Gi’, ‘2Gi’, … ‘32 Gi’.
- For required cpu on different memory values, go to https://cloud.google.com/run/docs/configuring/memory-limits
container_concurrency: Option<i32>Optional. Concurrency for each container and agent server. Recommended value: 2 * cpu + 1. Defaults to 9.
Implementations§
Source§impl DeploymentSpec
impl DeploymentSpec
pub fn new() -> Self
Sourcepub fn set_secret_env<T, V>(self, v: T) -> Self
pub fn set_secret_env<T, V>(self, v: T) -> Self
Sets the value of secret_env.
§Example
use google_cloud_aiplatform_v1::model::SecretEnvVar;
let x = DeploymentSpec::new()
.set_secret_env([
SecretEnvVar::default()/* use setters */,
SecretEnvVar::default()/* use (different) setters */,
]);Sourcepub fn set_psc_interface_config<T>(self, v: T) -> Selfwhere
T: Into<PscInterfaceConfig>,
pub fn set_psc_interface_config<T>(self, v: T) -> Selfwhere
T: Into<PscInterfaceConfig>,
Sets the value of psc_interface_config.
§Example
use google_cloud_aiplatform_v1::model::PscInterfaceConfig;
let x = DeploymentSpec::new().set_psc_interface_config(PscInterfaceConfig::default()/* use setters */);Sourcepub fn set_or_clear_psc_interface_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<PscInterfaceConfig>,
pub fn set_or_clear_psc_interface_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<PscInterfaceConfig>,
Sets or clears the value of psc_interface_config.
§Example
use google_cloud_aiplatform_v1::model::PscInterfaceConfig;
let x = DeploymentSpec::new().set_or_clear_psc_interface_config(Some(PscInterfaceConfig::default()/* use setters */));
let x = DeploymentSpec::new().set_or_clear_psc_interface_config(None::<PscInterfaceConfig>);Sourcepub fn set_min_instances<T>(self, v: T) -> Self
pub fn set_min_instances<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_min_instances<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_min_instances<T>(self, v: Option<T>) -> Self
Sets or clears the value of min_instances.
§Example
let x = DeploymentSpec::new().set_or_clear_min_instances(Some(42));
let x = DeploymentSpec::new().set_or_clear_min_instances(None::<i32>);Sourcepub fn set_max_instances<T>(self, v: T) -> Self
pub fn set_max_instances<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_max_instances<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_instances<T>(self, v: Option<T>) -> Self
Sets or clears the value of max_instances.
§Example
let x = DeploymentSpec::new().set_or_clear_max_instances(Some(42));
let x = DeploymentSpec::new().set_or_clear_max_instances(None::<i32>);Sourcepub fn set_resource_limits<T, K, V>(self, v: T) -> Self
pub fn set_resource_limits<T, K, V>(self, v: T) -> Self
Sets the value of resource_limits.
§Example
let x = DeploymentSpec::new().set_resource_limits([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_container_concurrency<T>(self, v: T) -> Self
pub fn set_container_concurrency<T>(self, v: T) -> Self
Sets the value of container_concurrency.
§Example
let x = DeploymentSpec::new().set_container_concurrency(42);Sourcepub fn set_or_clear_container_concurrency<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_container_concurrency<T>(self, v: Option<T>) -> Self
Sets or clears the value of container_concurrency.
§Example
let x = DeploymentSpec::new().set_or_clear_container_concurrency(Some(42));
let x = DeploymentSpec::new().set_or_clear_container_concurrency(None::<i32>);Trait Implementations§
Source§impl Clone for DeploymentSpec
impl Clone for DeploymentSpec
Source§fn clone(&self) -> DeploymentSpec
fn clone(&self) -> DeploymentSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more