Class: Google::Apis::RunV2::GoogleCloudRunV2ResourceRequirements
- Inherits:
-
Object
- Object
- Google::Apis::RunV2::GoogleCloudRunV2ResourceRequirements
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/run_v2/classes.rb,
lib/google/apis/run_v2/representations.rb,
lib/google/apis/run_v2/representations.rb
Overview
ResourceRequirements describes the compute resource requirements.
Instance Attribute Summary collapse
-
#cpu_idle ⇒ Boolean
(also: #cpu_idle?)
Determines whether CPU is only allocated during requests (true by default).
-
#limits ⇒ Hash<String,String>
Only
memory,cpuandnvidia.com/gpukeys in the map are supported. -
#startup_cpu_boost ⇒ Boolean
(also: #startup_cpu_boost?)
Determines whether CPU should be boosted on startup of a new container instance above the requested CPU threshold, this can help reduce cold-start latency.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudRunV2ResourceRequirements
constructor
A new instance of GoogleCloudRunV2ResourceRequirements.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudRunV2ResourceRequirements
Returns a new instance of GoogleCloudRunV2ResourceRequirements.
2350 2351 2352 |
# File 'lib/google/apis/run_v2/classes.rb', line 2350 def initialize(**args) update!(**args) end |
Instance Attribute Details
#cpu_idle ⇒ Boolean Also known as: cpu_idle?
Determines whether CPU is only allocated during requests (true by default).
However, if ResourceRequirements is set, the caller must explicitly set this
field to true to preserve the default behavior.
Corresponds to the JSON property cpuIdle
2329 2330 2331 |
# File 'lib/google/apis/run_v2/classes.rb', line 2329 def cpu_idle @cpu_idle end |
#limits ⇒ Hash<String,String>
Only memory, cpu and nvidia.com/gpu keys in the map are supported. Notes:
- The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU
requires at least 2Gi of memory. For more information, go to https://cloud.
google.com/run/docs/configuring/cpu. * For supported 'memory' values and
syntax, go to https://cloud.google.com/run/docs/configuring/memory-limits *
The only supported 'nvidia.com/gpu' value is '1'.
Corresponds to the JSON property
limits
2340 2341 2342 |
# File 'lib/google/apis/run_v2/classes.rb', line 2340 def limits @limits end |
#startup_cpu_boost ⇒ Boolean Also known as: startup_cpu_boost?
Determines whether CPU should be boosted on startup of a new container
instance above the requested CPU threshold, this can help reduce cold-start
latency.
Corresponds to the JSON property startupCpuBoost
2347 2348 2349 |
# File 'lib/google/apis/run_v2/classes.rb', line 2347 def startup_cpu_boost @startup_cpu_boost end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2355 2356 2357 2358 2359 |
# File 'lib/google/apis/run_v2/classes.rb', line 2355 def update!(**args) @cpu_idle = args[:cpu_idle] if args.key?(:cpu_idle) @limits = args[:limits] if args.key?(:limits) @startup_cpu_boost = args[:startup_cpu_boost] if args.key?(:startup_cpu_boost) end |