daytona 0.183.0 → 0.184.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/daytona/common/resources.rb +7 -2
- data/lib/daytona/common/response.rb +1 -0
- data/lib/daytona/daytona.rb +4 -0
- data/lib/daytona/sandbox.rb +10 -4
- data/lib/daytona/sdk/version.rb +1 -1
- data/lib/daytona/snapshot_service.rb +4 -0
- data/project.json +5 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a915942565b3350f301af5bc17108ed23fd4c17ab2fabf794c55d061f7001b05
|
|
4
|
+
data.tar.gz: b7c4ae7fb09fd196a84b5b63fb06e66300ca16ef30d18f5b87c8026e0aa0366c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a849bfb163dbd2ec05b7fbc152877d702195526bf28c1c74e3da19b79d454d338deed08f4bc503998594ba65549f1b7960af64383bc6da67402751faebd09d45
|
|
7
|
+
data.tar.gz: 7769c3074cda40aad265165e41755e6e6de16144a36b1bbc1e739f8b3e5b9c20d0d57c4eec20dccaa97322b412068c663f3d86f2ecf1514c3cb18aceb39337c7
|
|
@@ -17,18 +17,23 @@ module Daytona
|
|
|
17
17
|
# @return [Integer, nil] Number of GPUs to allocate
|
|
18
18
|
attr_reader :gpu
|
|
19
19
|
|
|
20
|
+
# @return [String, Array<String>, nil] Preferred GPU type for the Sandbox
|
|
21
|
+
attr_reader :gpu_type
|
|
22
|
+
|
|
20
23
|
# @param cpu [Integer, nil] Number of CPU cores to allocate
|
|
21
24
|
# @param memory [Integer, nil] Amount of memory in GiB to allocate
|
|
22
25
|
# @param disk [Integer, nil] Amount of disk space in GiB to allocate
|
|
23
26
|
# @param gpu [Integer, nil] Number of GPUs to allocate
|
|
24
|
-
|
|
27
|
+
# @param gpu_type [String, Array<String>, nil] Preferred GPU type for the Sandbox
|
|
28
|
+
def initialize(cpu: nil, memory: nil, disk: nil, gpu: nil, gpu_type: nil)
|
|
25
29
|
@cpu = cpu
|
|
26
30
|
@memory = memory
|
|
27
31
|
@disk = disk
|
|
28
32
|
@gpu = gpu
|
|
33
|
+
@gpu_type = gpu_type
|
|
29
34
|
end
|
|
30
35
|
|
|
31
36
|
# @return [Hash] Hash representation of the resources
|
|
32
|
-
def to_h = { cpu:, memory:, disk:, gpu: }.compact
|
|
37
|
+
def to_h = { cpu:, memory:, disk:, gpu:, gpu_type: }.compact
|
|
33
38
|
end
|
|
34
39
|
end
|
|
@@ -9,6 +9,7 @@ module Daytona
|
|
|
9
9
|
SandboxState = DaytonaApiClient::SandboxState
|
|
10
10
|
SandboxListSortField = DaytonaApiClient::SandboxListSortField
|
|
11
11
|
SandboxListSortDirection = DaytonaApiClient::SandboxListSortDirection
|
|
12
|
+
GpuType = DaytonaApiClient::GpuType
|
|
12
13
|
|
|
13
14
|
class PaginatedResource
|
|
14
15
|
# @return [Array<Object>]
|
data/lib/daytona/daytona.rb
CHANGED
|
@@ -236,6 +236,10 @@ module Daytona
|
|
|
236
236
|
create_sandbox.memory = params.resources&.memory
|
|
237
237
|
create_sandbox.disk = params.resources&.disk
|
|
238
238
|
create_sandbox.gpu = params.resources&.gpu
|
|
239
|
+
if params.resources&.gpu_type
|
|
240
|
+
create_sandbox.gpu_type =
|
|
241
|
+
params.resources.gpu_type.is_a?(Array) ? params.resources.gpu_type : [params.resources.gpu_type]
|
|
242
|
+
end
|
|
239
243
|
end
|
|
240
244
|
|
|
241
245
|
response = sandbox_api.create_sandbox(create_sandbox)
|
data/lib/daytona/sandbox.rb
CHANGED
|
@@ -415,13 +415,14 @@ module Daytona
|
|
|
415
415
|
|
|
416
416
|
# Resizes the Sandbox resources.
|
|
417
417
|
#
|
|
418
|
-
# Changes the CPU, memory, or disk allocation
|
|
419
|
-
#
|
|
420
|
-
#
|
|
418
|
+
# Changes the CPU, memory, or disk allocation. Resizing a started sandbox accepts
|
|
419
|
+
# only CPU and memory increases. Disk resize requires a stopped sandbox; disk can
|
|
420
|
+
# only grow. GPU is not resizable — to change GPU, create a new sandbox.
|
|
421
421
|
#
|
|
422
|
-
# @param resources [Daytona::Resources] New resource configuration
|
|
422
|
+
# @param resources [Daytona::Resources] New resource configuration (cpu, memory, disk only)
|
|
423
423
|
# @param timeout [Numeric] Maximum wait time in seconds (defaults to 60 s)
|
|
424
424
|
# @return [void]
|
|
425
|
+
# @raise [Sdk::Error] If resources.gpu or resources.gpu_type is set
|
|
425
426
|
#
|
|
426
427
|
# @example Resize a started sandbox (CPU and memory can be increased)
|
|
427
428
|
# sandbox.resize(Daytona::Resources.new(cpu: 4, memory: 8))
|
|
@@ -432,6 +433,11 @@ module Daytona
|
|
|
432
433
|
def resize(resources, timeout = DEFAULT_TIMEOUT)
|
|
433
434
|
raise Sdk::Error, 'Resources must not be nil' if resources.nil?
|
|
434
435
|
|
|
436
|
+
if resources.gpu || resources.gpu_type
|
|
437
|
+
raise Sdk::Error,
|
|
438
|
+
'Resize does not support changes to gpu or gpu_type — to change GPU, create a new sandbox'
|
|
439
|
+
end
|
|
440
|
+
|
|
435
441
|
with_timeout(
|
|
436
442
|
timeout:,
|
|
437
443
|
message: "Sandbox #{id} failed to resize within the #{timeout} seconds timeout period",
|
data/lib/daytona/sdk/version.rb
CHANGED
|
@@ -102,6 +102,10 @@ module Daytona
|
|
|
102
102
|
if params.resources
|
|
103
103
|
create_snapshot_req.cpu = params.resources.cpu
|
|
104
104
|
create_snapshot_req.gpu = params.resources.gpu
|
|
105
|
+
if params.resources.gpu_type
|
|
106
|
+
create_snapshot_req.gpu_type =
|
|
107
|
+
params.resources.gpu_type.is_a?(Array) ? params.resources.gpu_type : [params.resources.gpu_type]
|
|
108
|
+
end
|
|
105
109
|
create_snapshot_req.memory = params.resources.memory
|
|
106
110
|
create_snapshot_req.disk = params.resources.disk
|
|
107
111
|
end
|
data/project.json
CHANGED
|
@@ -44,7 +44,11 @@
|
|
|
44
44
|
"test": {
|
|
45
45
|
"executor": "nx:run-commands",
|
|
46
46
|
"cache": true,
|
|
47
|
-
"inputs": [
|
|
47
|
+
"inputs": [
|
|
48
|
+
"default",
|
|
49
|
+
"{workspaceRoot}/libs/api-client-ruby/**/*",
|
|
50
|
+
"{workspaceRoot}/libs/toolbox-api-client-ruby/**/*"
|
|
51
|
+
],
|
|
48
52
|
"outputs": [],
|
|
49
53
|
"options": {
|
|
50
54
|
"cwd": "{projectRoot}",
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: daytona
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.184.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daytona Platforms Inc.
|
|
@@ -85,28 +85,28 @@ dependencies:
|
|
|
85
85
|
requirements:
|
|
86
86
|
- - '='
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: 0.
|
|
88
|
+
version: 0.184.0
|
|
89
89
|
type: :runtime
|
|
90
90
|
prerelease: false
|
|
91
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
92
92
|
requirements:
|
|
93
93
|
- - '='
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: 0.
|
|
95
|
+
version: 0.184.0
|
|
96
96
|
- !ruby/object:Gem::Dependency
|
|
97
97
|
name: daytona_toolbox_api_client
|
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
|
99
99
|
requirements:
|
|
100
100
|
- - '='
|
|
101
101
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: 0.
|
|
102
|
+
version: 0.184.0
|
|
103
103
|
type: :runtime
|
|
104
104
|
prerelease: false
|
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
106
106
|
requirements:
|
|
107
107
|
- - '='
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: 0.
|
|
109
|
+
version: 0.184.0
|
|
110
110
|
- !ruby/object:Gem::Dependency
|
|
111
111
|
name: dotenv
|
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|