Class: Daytona::Resources
- Inherits:
-
Object
- Object
- Daytona::Resources
- Defined in:
- lib/daytona/common/resources.rb
Instance Attribute Summary collapse
-
#cpu ⇒ Integer?
readonly
Number of CPU cores to allocate.
-
#disk ⇒ Integer?
readonly
Amount of disk space in GiB to allocate.
-
#gpu ⇒ Integer?
readonly
Number of GPUs to allocate.
-
#gpu_type ⇒ String, ...
readonly
Preferred GPU type for the Sandbox.
-
#memory ⇒ Integer?
readonly
Amount of memory in GiB to allocate.
Instance Method Summary collapse
-
#initialize(cpu: nil, memory: nil, disk: nil, gpu: nil, gpu_type: nil) ⇒ Resources
constructor
A new instance of Resources.
-
#to_h ⇒ Hash
Hash representation of the resources.
Constructor Details
#initialize(cpu: nil, memory: nil, disk: nil, gpu: nil, gpu_type: nil) ⇒ Resources
Returns a new instance of Resources.
28 29 30 31 32 33 34 |
# File 'lib/daytona/common/resources.rb', line 28 def initialize(cpu: nil, memory: nil, disk: nil, gpu: nil, gpu_type: nil) @cpu = cpu @memory = memory @disk = disk @gpu = gpu @gpu_type = gpu_type end |
Instance Attribute Details
#cpu ⇒ Integer? (readonly)
Returns Number of CPU cores to allocate.
9 10 11 |
# File 'lib/daytona/common/resources.rb', line 9 def cpu @cpu end |
#disk ⇒ Integer? (readonly)
Returns Amount of disk space in GiB to allocate.
15 16 17 |
# File 'lib/daytona/common/resources.rb', line 15 def disk @disk end |
#gpu ⇒ Integer? (readonly)
Returns Number of GPUs to allocate.
18 19 20 |
# File 'lib/daytona/common/resources.rb', line 18 def gpu @gpu end |
#gpu_type ⇒ String, ... (readonly)
Returns Preferred GPU type for the Sandbox.
21 22 23 |
# File 'lib/daytona/common/resources.rb', line 21 def gpu_type @gpu_type end |
#memory ⇒ Integer? (readonly)
Returns Amount of memory in GiB to allocate.
12 13 14 |
# File 'lib/daytona/common/resources.rb', line 12 def memory @memory end |
Instance Method Details
#to_h ⇒ Hash
Returns Hash representation of the resources.
37 |
# File 'lib/daytona/common/resources.rb', line 37 def to_h = { cpu:, memory:, disk:, gpu:, gpu_type: }.compact |