lambda-microvms 0.0.0 → 0.2.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/CHANGELOG.md +10 -1
- data/README.md +39 -4
- data/exe/lambda-microvms +41 -10
- data/lib/lambda/microvms/adapters/microvm_sdk.rb +59 -0
- data/lib/lambda/microvms/client.rb +81 -8
- data/lib/lambda/microvms/deployer.rb +27 -5
- data/lib/lambda/microvms/doctor.rb +15 -2
- data/lib/lambda/microvms/endpoint.rb +26 -4
- data/lib/lambda/microvms/function_client.rb +90 -0
- data/lib/lambda/microvms/image.rb +22 -0
- data/lib/lambda/microvms/microvm.rb +68 -1
- data/lib/lambda/microvms/packager.rb +9 -2
- data/lib/lambda/microvms/project.rb +93 -4
- data/lib/lambda/microvms/scaffold.rb +3 -0
- data/lib/lambda/microvms/session.rb +15 -0
- data/lib/lambda/microvms/util.rb +9 -0
- data/lib/lambda/microvms/version.rb +2 -1
- data/lib/lambda/microvms/waiter.rb +8 -0
- data/lib/lambda/microvms.rb +7 -0
- data/sig/lambda/microvms.rbs +150 -3
- metadata +5 -6
data/sig/lambda/microvms.rbs
CHANGED
|
@@ -3,6 +3,7 @@ module Lambda
|
|
|
3
3
|
VERSION: String
|
|
4
4
|
|
|
5
5
|
def self.session: (image_arn: String, role_arn: String, ?after: Symbol, ?client: Client, **untyped) { (MicroVM) -> untyped } -> untyped
|
|
6
|
+
def session: (image_arn: String, role_arn: String, ?after: Symbol, ?client: Client, **untyped) { (MicroVM) -> untyped } -> untyped
|
|
6
7
|
|
|
7
8
|
class Error < StandardError
|
|
8
9
|
end
|
|
@@ -26,8 +27,12 @@ module Lambda
|
|
|
26
27
|
end
|
|
27
28
|
|
|
28
29
|
class Client
|
|
30
|
+
REQUIRED_OPERATIONS: Array[Symbol]
|
|
29
31
|
attr_reader sdk: untyped
|
|
30
|
-
|
|
32
|
+
attr_reader adapter: Adapters::MicroVMSdk
|
|
33
|
+
def self.unsupported_operations: (?untyped sdk) -> Array[Symbol]
|
|
34
|
+
def self.sdk_contract_supported?: (?untyped sdk) -> bool
|
|
35
|
+
def initialize: (?region: String?, ?profile: String?, ?sdk: untyped, ?adapter: Adapters::MicroVMSdk, **untyped) -> void
|
|
31
36
|
def image: (String arn) -> Image
|
|
32
37
|
def microvm: (String id_or_arn) -> MicroVM
|
|
33
38
|
def create_image: (**untyped) -> Image
|
|
@@ -43,6 +48,56 @@ module Lambda
|
|
|
43
48
|
def create_auth_token: (**untyped) -> untyped
|
|
44
49
|
def create_microvm_auth_token: (**untyped) -> untyped
|
|
45
50
|
def call_sdk: (Symbol operation, **untyped) -> untyped
|
|
51
|
+
|
|
52
|
+
private
|
|
53
|
+
|
|
54
|
+
def build_sdk: (region: String?, profile: String?, **untyped) -> untyped
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
module Adapters
|
|
58
|
+
class MicroVMSdk
|
|
59
|
+
REQUIRED_OPERATIONS: Array[Symbol]
|
|
60
|
+
attr_reader sdk: untyped
|
|
61
|
+
def initialize: (untyped sdk) -> void
|
|
62
|
+
def unsupported_operations: () -> Array[Symbol]
|
|
63
|
+
def supported?: () -> bool
|
|
64
|
+
def call: (Symbol operation, **untyped) -> untyped
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
class FunctionClient
|
|
69
|
+
attr_reader sdk: untyped
|
|
70
|
+
def initialize: (?region: String?, ?profile: String?, ?sdk: untyped, **untyped) -> void
|
|
71
|
+
def create_function: (name: String, role_arn: String, handler: String, runtime: String, zip_file: String, **untyped) -> untyped
|
|
72
|
+
def update_function_code: (function_name: String, zip_file: String, **untyped) -> untyped
|
|
73
|
+
def invoke: (function_name: String, ?payload: untyped, **untyped) -> untyped
|
|
74
|
+
|
|
75
|
+
private
|
|
76
|
+
|
|
77
|
+
def build_sdk: (region: String?, profile: String?, **untyped) -> untyped
|
|
78
|
+
def encode_payload: (untyped payload) -> String?
|
|
79
|
+
def parse_payload: (untyped payload) -> untyped
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
module Util
|
|
83
|
+
def extract: (untyped value, *untyped keys) -> untyped
|
|
84
|
+
def normalize_state: (untyped value) -> Symbol
|
|
85
|
+
def self.extract: (untyped value, *untyped keys) -> untyped
|
|
86
|
+
def self.normalize_state: (untyped value) -> Symbol
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
class Waiter
|
|
90
|
+
DEFAULT_DELAY: Float
|
|
91
|
+
DEFAULT_TIMEOUT: Float
|
|
92
|
+
def initialize: (?delay: Numeric, ?timeout: Numeric, ?sleeper: untyped) -> void
|
|
93
|
+
def wait: (?message: String) { () -> untyped } -> untyped
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
module Session
|
|
97
|
+
def session: (image_arn: String, role_arn: String, ?after: Symbol?, ?client: Client, **untyped) { (MicroVM) -> untyped } -> untyped
|
|
98
|
+
def cleanup: (MicroVM vm, Symbol? after) -> untyped
|
|
99
|
+
def self.session: (image_arn: String, role_arn: String, ?after: Symbol?, ?client: Client, **untyped) { (MicroVM) -> untyped } -> untyped
|
|
100
|
+
def self.cleanup: (MicroVM vm, Symbol? after) -> untyped
|
|
46
101
|
end
|
|
47
102
|
|
|
48
103
|
class Image
|
|
@@ -88,7 +143,13 @@ module Lambda
|
|
|
88
143
|
def initialize: (url: String, token: String?, ?http: untyped) -> void
|
|
89
144
|
def get: (String path, ?headers: Hash[String, String]) -> untyped
|
|
90
145
|
def post: (String path, ?json: untyped, ?body: String?, ?headers: Hash[String, String]) -> untyped
|
|
91
|
-
def request: (
|
|
146
|
+
def request: (untyped klass, String path, ?json: untyped, ?body: String?, ?headers: Hash[String, untyped]) -> untyped
|
|
147
|
+
|
|
148
|
+
private
|
|
149
|
+
|
|
150
|
+
def build_uri: (String? path) -> untyped
|
|
151
|
+
def parse_response: (untyped response) -> untyped
|
|
152
|
+
def build_request: (untyped klass, String path, ?headers: Hash[String, untyped], ?json: untyped, ?body: String?) -> untyped
|
|
92
153
|
end
|
|
93
154
|
|
|
94
155
|
class Project
|
|
@@ -113,7 +174,16 @@ module Lambda
|
|
|
113
174
|
def payload: () -> Hash[String, untyped]
|
|
114
175
|
def create_image_params: (artifact_uri: String) -> Hash[Symbol, untyped]
|
|
115
176
|
def run_params: () -> Hash[Symbol, untyped]
|
|
177
|
+
def validate!: () -> Project
|
|
116
178
|
def require!: (String field, untyped value) -> untyped
|
|
179
|
+
|
|
180
|
+
private
|
|
181
|
+
|
|
182
|
+
def validate_hash!: () -> void
|
|
183
|
+
def validate_lifecycle_after!: () -> void
|
|
184
|
+
def hash_config: (String path) -> Hash[untyped, untyped]
|
|
185
|
+
def fetch: (*String paths, default: untyped) -> untyped
|
|
186
|
+
def stringify_keys: (untyped value) -> untyped
|
|
117
187
|
end
|
|
118
188
|
|
|
119
189
|
class Scaffold
|
|
@@ -121,12 +191,23 @@ module Lambda
|
|
|
121
191
|
attr_reader directory: String
|
|
122
192
|
def initialize: (String name, ?directory: String, ?force: bool) -> void
|
|
123
193
|
def create: () -> String
|
|
194
|
+
|
|
195
|
+
private
|
|
196
|
+
|
|
197
|
+
def ensure_target!: () -> void
|
|
198
|
+
def write: (String path, String content) -> untyped
|
|
199
|
+
def gemfile: () -> String
|
|
200
|
+
def dockerfile: () -> String
|
|
201
|
+
def app_rb: () -> String
|
|
202
|
+
def microvm_yml: () -> String
|
|
203
|
+
def readme: () -> String
|
|
204
|
+
def env_example: () -> String
|
|
124
205
|
end
|
|
125
206
|
|
|
126
207
|
class Packager
|
|
127
208
|
DEFAULT_EXCLUDES: Array[String]
|
|
128
209
|
attr_reader project: Project
|
|
129
|
-
def initialize: (Project project) -> void
|
|
210
|
+
def initialize: (Project project, ?runner: untyped) -> void
|
|
130
211
|
def package: (?output: String) -> String
|
|
131
212
|
end
|
|
132
213
|
|
|
@@ -139,6 +220,11 @@ module Lambda
|
|
|
139
220
|
def upload: (String path) -> String
|
|
140
221
|
def deploy: () -> Image
|
|
141
222
|
def run: () -> MicroVM
|
|
223
|
+
|
|
224
|
+
private
|
|
225
|
+
|
|
226
|
+
def build_s3: () -> untyped
|
|
227
|
+
def ensure_microvm_contract!: () -> void
|
|
142
228
|
end
|
|
143
229
|
|
|
144
230
|
class Doctor
|
|
@@ -148,6 +234,67 @@ module Lambda
|
|
|
148
234
|
def initialize: (project: Project, ?runner: untyped) -> void
|
|
149
235
|
def checks: () -> Array[untyped]
|
|
150
236
|
def ok?: () -> bool
|
|
237
|
+
|
|
238
|
+
private
|
|
239
|
+
|
|
240
|
+
def check: (String name, untyped ok, untyped detail) -> untyped
|
|
241
|
+
def command_check: (String name, String command) -> untyped
|
|
242
|
+
def file_check: (String name, String path) -> untyped
|
|
243
|
+
def config_check: (String name, untyped value) -> untyped
|
|
244
|
+
def ric_check: () -> untyped
|
|
245
|
+
def sdk_contract_check: () -> untyped
|
|
151
246
|
end
|
|
152
247
|
end
|
|
153
248
|
end
|
|
249
|
+
|
|
250
|
+
module Aws
|
|
251
|
+
module Lambda
|
|
252
|
+
class Client
|
|
253
|
+
def initialize: (**untyped) -> void
|
|
254
|
+
end
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
module S3
|
|
258
|
+
class Client
|
|
259
|
+
def initialize: (**untyped) -> void
|
|
260
|
+
end
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
module FileUtils
|
|
265
|
+
def self.mkdir_p: (String | Array[String]) -> untyped
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
module JSON
|
|
269
|
+
class ParserError < StandardError
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
def self.parse: (String source) -> untyped
|
|
273
|
+
def self.generate: (untyped value) -> String
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
module Net
|
|
277
|
+
class HTTP
|
|
278
|
+
def self.start: (String address, Integer port, ?use_ssl: bool) { (untyped) -> untyped } -> untyped
|
|
279
|
+
|
|
280
|
+
class Get
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
class Post
|
|
284
|
+
end
|
|
285
|
+
end
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
module Open3
|
|
289
|
+
def self.capture3: (*String command, ?chdir: String) -> [String, String, untyped]
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
module URI
|
|
293
|
+
def self.parse: (String uri) -> untyped
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
module YAML
|
|
297
|
+
def self.safe_load_file: (String filename, ?permitted_classes: Array[singleton(Symbol)], ?aliases: bool) -> untyped
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
$CHILD_STATUS: untyped
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lambda-microvms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kenneth C. Demanawa
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: aws-sdk-lambda
|
|
@@ -66,11 +65,13 @@ files:
|
|
|
66
65
|
- README.md
|
|
67
66
|
- exe/lambda-microvms
|
|
68
67
|
- lib/lambda/microvms.rb
|
|
68
|
+
- lib/lambda/microvms/adapters/microvm_sdk.rb
|
|
69
69
|
- lib/lambda/microvms/client.rb
|
|
70
70
|
- lib/lambda/microvms/deployer.rb
|
|
71
71
|
- lib/lambda/microvms/doctor.rb
|
|
72
72
|
- lib/lambda/microvms/endpoint.rb
|
|
73
73
|
- lib/lambda/microvms/error.rb
|
|
74
|
+
- lib/lambda/microvms/function_client.rb
|
|
74
75
|
- lib/lambda/microvms/image.rb
|
|
75
76
|
- lib/lambda/microvms/microvm.rb
|
|
76
77
|
- lib/lambda/microvms/packager.rb
|
|
@@ -91,7 +92,6 @@ metadata:
|
|
|
91
92
|
source_code_uri: https://github.com/kanutocd/lambda-microvms
|
|
92
93
|
changelog_uri: https://github.com/kanutocd/lambda-microvms/blob/main/CHANGELOG.md
|
|
93
94
|
rubygems_mfa_required: 'true'
|
|
94
|
-
post_install_message:
|
|
95
95
|
rdoc_options: []
|
|
96
96
|
require_paths:
|
|
97
97
|
- lib
|
|
@@ -106,8 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
106
106
|
- !ruby/object:Gem::Version
|
|
107
107
|
version: '0'
|
|
108
108
|
requirements: []
|
|
109
|
-
rubygems_version: 3.
|
|
110
|
-
signing_key:
|
|
109
|
+
rubygems_version: 3.6.9
|
|
111
110
|
specification_version: 4
|
|
112
111
|
summary: Idiomatic Ruby lifecycle client for AWS Lambda MicroVMs.
|
|
113
112
|
test_files: []
|