microsandbox-rb 0.17.0 → 0.17.2

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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +229 -8
  3. data/Cargo.lock +45 -46
  4. data/DESIGN.md +90 -72
  5. data/README.md +178 -669
  6. data/SECURITY.md +65 -0
  7. data/docs/configuration.md +154 -0
  8. data/docs/errors.md +74 -0
  9. data/docs/execution.md +108 -0
  10. data/docs/filesystem.md +45 -0
  11. data/docs/images.md +65 -0
  12. data/docs/lifecycle.md +141 -0
  13. data/docs/observability.md +99 -0
  14. data/docs/releasing.md +117 -0
  15. data/docs/runtime.md +154 -0
  16. data/docs/surface.md +75 -0
  17. data/ext/microsandbox/Cargo.toml +9 -5
  18. data/ext/microsandbox/src/agent.rs +13 -11
  19. data/ext/microsandbox/src/backend.rs +1 -1
  20. data/ext/microsandbox/src/exec.rs +12 -8
  21. data/ext/microsandbox/src/fs_stream.rs +19 -7
  22. data/ext/microsandbox/src/host_path.rs +108 -0
  23. data/ext/microsandbox/src/image.rs +2 -2
  24. data/ext/microsandbox/src/lib.rs +3 -2
  25. data/ext/microsandbox/src/runtime.rs +189 -13
  26. data/ext/microsandbox/src/sandbox.rs +149 -102
  27. data/ext/microsandbox/src/snapshot.rs +17 -11
  28. data/ext/microsandbox/src/ssh.rs +22 -16
  29. data/ext/microsandbox/src/stream.rs +6 -2
  30. data/ext/microsandbox/src/volume.rs +50 -17
  31. data/lib/microsandbox/fs.rb +4 -8
  32. data/lib/microsandbox/image.rb +2 -2
  33. data/lib/microsandbox/log_entry.rb +1 -1
  34. data/lib/microsandbox/metrics.rb +1 -1
  35. data/lib/microsandbox/outbound_proxy.rb +8 -0
  36. data/lib/microsandbox/sandbox.rb +128 -13
  37. data/lib/microsandbox/snapshot.rb +1 -1
  38. data/lib/microsandbox/ssh.rb +2 -10
  39. data/lib/microsandbox/streams.rb +8 -5
  40. data/lib/microsandbox/version.rb +1 -1
  41. data/lib/microsandbox/volume.rb +31 -14
  42. data/lib/microsandbox-rb.rb +7 -0
  43. data/lib/microsandbox.rb +88 -31
  44. data/sig/microsandbox.rbs +24 -0
  45. metadata +14 -1
data/sig/microsandbox.rbs CHANGED
@@ -82,6 +82,7 @@ module Microsandbox
82
82
  end
83
83
 
84
84
  class FsEntry
85
+ def initialize: (Hash[String, untyped] data) -> void
85
86
  def path: () -> String
86
87
  def name: () -> String
87
88
  def type: () -> Symbol
@@ -94,6 +95,7 @@ module Microsandbox
94
95
  end
95
96
 
96
97
  class FsMetadata
98
+ def initialize: (Hash[String, untyped] data) -> void
97
99
  def type: () -> Symbol
98
100
  def size: () -> Integer
99
101
  def mode: () -> Integer
@@ -106,6 +108,7 @@ module Microsandbox
106
108
  end
107
109
 
108
110
  class FS
111
+ def initialize: (untyped native) -> void
109
112
  def read: (String path) -> String
110
113
  def read_text: (String path) -> String
111
114
  def write: (String path, String data) -> nil
@@ -125,17 +128,20 @@ module Microsandbox
125
128
 
126
129
  class FsReadStream
127
130
  include Enumerable[String]
131
+ def initialize: (untyped native) -> void
128
132
  def each: () { (String) -> void } -> self
129
133
  | () -> Enumerator[String, self]
130
134
  def read: () -> String
131
135
  end
132
136
 
133
137
  class FsWriteSink
138
+ def initialize: (untyped native) -> void
134
139
  def write: (String data) -> self
135
140
  def close: () -> nil
136
141
  end
137
142
 
138
143
  class Metrics
144
+ def initialize: (Hash[String, untyped] data) -> void
139
145
  def cpu_percent: () -> Float
140
146
  def vcpu_time_ns: () -> Integer
141
147
  def memory_bytes: () -> Integer
@@ -154,6 +160,7 @@ module Microsandbox
154
160
  end
155
161
 
156
162
  class LogEntry
163
+ def initialize: (Hash[String, untyped] entry) -> void
157
164
  def source: () -> Symbol
158
165
  def session_id: () -> Integer?
159
166
  def cursor: () -> String
@@ -163,6 +170,7 @@ module Microsandbox
163
170
  end
164
171
 
165
172
  class SandboxHandle
173
+ def initialize: (untyped native) -> void
166
174
  def name: () -> String
167
175
  def id: () -> String
168
176
  def status: () -> Symbol
@@ -200,6 +208,7 @@ module Microsandbox
200
208
  SandboxInfo: singleton(SandboxHandle)
201
209
 
202
210
  class SandboxStopResult
211
+ def initialize: (Hash[String, untyped] data) -> void
203
212
  def name: () -> String
204
213
  def status: () -> Symbol
205
214
  def exit_code: () -> Integer?
@@ -290,6 +299,7 @@ module Microsandbox
290
299
  def self.list_with: (?labels: Hash[untyped, untyped], ?limit: Integer?, ?cursor: String?) -> SandboxPage
291
300
  def self.remove: (String name) -> nil
292
301
 
302
+ def initialize: (untyped native) -> void
293
303
  def name: () -> String
294
304
  def id: () -> String
295
305
  def exec: (String command, ?Array[String] args, ?cwd: String?, ?user: String?,
@@ -354,17 +364,20 @@ module Microsandbox
354
364
 
355
365
  class LogStream
356
366
  include Enumerable[LogEntry]
367
+ def initialize: (untyped native) -> void
357
368
  def each: () { (LogEntry) -> void } -> self
358
369
  | () -> Enumerator[LogEntry, self]
359
370
  end
360
371
 
361
372
  class MetricsStream
362
373
  include Enumerable[Metrics]
374
+ def initialize: (untyped native) -> void
363
375
  def each: () { (Metrics) -> void } -> self
364
376
  | () -> Enumerator[Metrics, self]
365
377
  end
366
378
 
367
379
  class ExecEvent
380
+ def initialize: (Hash[String, untyped] event) -> void
368
381
  def type: () -> Symbol
369
382
  def pid: () -> Integer?
370
383
  def code: () -> Integer?
@@ -379,18 +392,21 @@ module Microsandbox
379
392
  end
380
393
 
381
394
  class ExitStatus
395
+ def initialize: (Hash[String, untyped] data) -> void
382
396
  def exit_code: () -> Integer?
383
397
  def success?: () -> bool
384
398
  def failure?: () -> bool
385
399
  end
386
400
 
387
401
  class ExecStdin
402
+ def initialize: (untyped native) -> void
388
403
  def write: (String data) -> self
389
404
  def close: () -> nil
390
405
  end
391
406
 
392
407
  class ExecHandle
393
408
  include Enumerable[ExecEvent]
409
+ def initialize: (untyped native) -> void
394
410
  def id: () -> String
395
411
  def each: () { (ExecEvent) -> void } -> self
396
412
  | () -> Enumerator[ExecEvent, self]
@@ -403,6 +419,7 @@ module Microsandbox
403
419
  end
404
420
 
405
421
  class ImageInfo
422
+ def initialize: (Hash[String, untyped] data) -> void
406
423
  def reference: () -> String
407
424
  def size_bytes: () -> Integer?
408
425
  def manifest_digest: () -> String?
@@ -414,6 +431,7 @@ module Microsandbox
414
431
  end
415
432
 
416
433
  class ImageDetail
434
+ def initialize: (Hash[String, untyped] data) -> void
417
435
  def handle: () -> ImageInfo
418
436
  def config: () -> Hash[String, untyped]?
419
437
  def layers: () -> Array[Hash[String, untyped]]
@@ -421,6 +439,7 @@ module Microsandbox
421
439
  end
422
440
 
423
441
  class ImagePruneReport
442
+ def initialize: (Hash[String, untyped] data) -> void
424
443
  def image_refs_removed: () -> Integer
425
444
  def manifests_removed: () -> Integer
426
445
  def layers_removed: () -> Integer
@@ -441,6 +460,7 @@ module Microsandbox
441
460
  end
442
461
 
443
462
  class VolumeInfo
463
+ def initialize: (Hash[String, untyped] data) -> void
444
464
  def name: () -> String
445
465
  def path: () -> String?
446
466
  def kind: () -> Symbol?
@@ -481,6 +501,7 @@ module Microsandbox
481
501
  end
482
502
 
483
503
  class SnapshotInfo
504
+ def initialize: (Hash[String, untyped] data) -> void
484
505
  def digest: () -> String
485
506
  def path: () -> String
486
507
  def name: () -> String?
@@ -506,6 +527,7 @@ module Microsandbox
506
527
  end
507
528
 
508
529
  class SnapshotVerifyReport
530
+ def initialize: (Hash[String, untyped] data) -> void
509
531
  def digest: () -> String
510
532
  def path: () -> String
511
533
  def status: () -> Symbol
@@ -569,6 +591,7 @@ module Microsandbox
569
591
  end
570
592
 
571
593
  class BackendInfo
594
+ def initialize: (Hash[String, untyped] data) -> void
572
595
  def kind: () -> Symbol
573
596
  def api_url: () -> String?
574
597
  def source: () -> Symbol
@@ -643,6 +666,7 @@ module Microsandbox
643
666
 
644
667
  class AgentStream
645
668
  include Enumerable[AgentFrame]
669
+ def initialize: (untyped native, Integer id, Integer handle) -> void
646
670
  def id: () -> Integer
647
671
  def recv: () -> AgentFrame?
648
672
  def each: () { (AgentFrame) -> void } -> self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: microsandbox-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ya-luotao
@@ -43,6 +43,17 @@ files:
43
43
  - DESIGN.md
44
44
  - LICENSE
45
45
  - README.md
46
+ - SECURITY.md
47
+ - docs/configuration.md
48
+ - docs/errors.md
49
+ - docs/execution.md
50
+ - docs/filesystem.md
51
+ - docs/images.md
52
+ - docs/lifecycle.md
53
+ - docs/observability.md
54
+ - docs/releasing.md
55
+ - docs/runtime.md
56
+ - docs/surface.md
46
57
  - ext/microsandbox/Cargo.toml
47
58
  - ext/microsandbox/extconf.rb
48
59
  - ext/microsandbox/src/agent.rs
@@ -51,6 +62,7 @@ files:
51
62
  - ext/microsandbox/src/error.rs
52
63
  - ext/microsandbox/src/exec.rs
53
64
  - ext/microsandbox/src/fs_stream.rs
65
+ - ext/microsandbox/src/host_path.rs
54
66
  - ext/microsandbox/src/image.rs
55
67
  - ext/microsandbox/src/lib.rs
56
68
  - ext/microsandbox/src/runtime.rs
@@ -59,6 +71,7 @@ files:
59
71
  - ext/microsandbox/src/ssh.rs
60
72
  - ext/microsandbox/src/stream.rs
61
73
  - ext/microsandbox/src/volume.rs
74
+ - lib/microsandbox-rb.rb
62
75
  - lib/microsandbox.rb
63
76
  - lib/microsandbox/agent.rb
64
77
  - lib/microsandbox/backend_info.rb