Client
penvm.client.config
Collection of configuration support, mostly used in penvm.client.world.
BaseConfig
Base configuration.
Provides standard methods: add
, get
, update
.
Source code in penvm/src/client/penvm/client/config.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
|
__init__(world, name, config=None)
Initialize.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
world |
WorldConfig
|
World configuration object. |
required |
name |
str
|
Configuration name. |
required |
config |
Union[dict, None]
|
Configuration. |
None
|
Source code in penvm/src/client/penvm/client/config.py
338 339 340 341 342 343 344 345 346 347 348 349 350 |
|
add(k, v)
Add key+value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k |
Any
|
Key. |
required |
v |
Any
|
Value. |
required |
Source code in penvm/src/client/penvm/client/config.py
352 353 354 355 356 357 358 359 360 361 362 |
|
get(k, default=None)
Get value for key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k |
Any
|
Key. |
required |
default |
Any
|
Default value if key is not found. |
None
|
Returns:
Type | Description |
---|---|
Any
|
Value for key. |
Source code in penvm/src/client/penvm/client/config.py
364 365 366 367 368 369 370 371 372 373 374 |
|
update(config)
Update configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
dict
|
Configuration. |
required |
Source code in penvm/src/client/penvm/client/config.py
376 377 378 379 380 381 382 |
|
GroupConfig
Bases: BaseConfig
Group configuration.
Source code in penvm/src/client/penvm/client/config.py
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 |
|
get_targets()
Get target configuration objects.
Returns:
Type | Description |
---|---|
List[TargetConfig]
|
List of Target configuration objects. |
Source code in penvm/src/client/penvm/client/config.py
391 392 393 394 395 396 397 398 399 400 |
|
NetworkConfig
Bases: BaseConfig
Network configuration.
Source code in penvm/src/client/penvm/client/config.py
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 |
|
get_targets()
Get target configuration objects.
Returns:
Type | Description |
---|---|
List[TargetConfig]
|
List of Target configuration objects. |
Source code in penvm/src/client/penvm/client/config.py
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 |
|
TargetConfig
Bases: BaseConfig
Target configuration.
Source code in penvm/src/client/penvm/client/config.py
426 427 428 429 430 431 432 433 434 435 |
|
__init__(*args, **kwargs)
Initialize.
Source code in penvm/src/client/penvm/client/config.py
429 430 431 432 |
|
TemplateConfig
Bases: BaseConfig
Template configuration.
Source code in penvm/src/client/penvm/client/config.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 |
|
run()
Add target configurations based on template.
Automatic substitution for $target
is done forhost
,
machine-id
with target name.
Source code in penvm/src/client/penvm/client/config.py
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 |
|
WorldConfig
World configuation.
Provide high-level methods for working with the world configuration file. This is normally used only by penvm.client.world.World.
Source code in penvm/src/client/penvm/client/config.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
|
__init__()
Initialize.
Source code in penvm/src/client/penvm/client/config.py
166 167 168 169 170 171 172 |
|
add_group(name, config)
Add group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Group name. |
required |
config |
dict
|
Configuration. |
required |
Source code in penvm/src/client/penvm/client/config.py
177 178 179 180 181 182 183 184 |
|
add_meta(config)
Add meta(data).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
dict
|
Configuration. |
required |
Source code in penvm/src/client/penvm/client/config.py
186 187 188 189 190 191 192 |
|
add_network(name, config)
Add network.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Network name. |
required |
config |
dict
|
Configuration. |
required |
Source code in penvm/src/client/penvm/client/config.py
194 195 196 197 198 199 200 201 |
|
add_target(name, config)
Add target.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Target name. |
required |
config |
dict
|
Configuration. |
required |
Source code in penvm/src/client/penvm/client/config.py
203 204 205 206 207 208 209 210 |
|
add_template(name, config)
Add template.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Template name. |
required |
config |
dict
|
Configuration. |
required |
Source code in penvm/src/client/penvm/client/config.py
212 213 214 215 216 217 218 219 220 |
|
clear()
Clear configuration.
Source code in penvm/src/client/penvm/client/config.py
222 223 224 225 226 227 228 |
|
get_group(name)
Get group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Group name. |
required |
Returns:
Type | Description |
---|---|
GroupConfig
|
Group confguration object. |
Source code in penvm/src/client/penvm/client/config.py
264 265 266 267 268 269 270 271 272 273 |
|
get_groups()
Get group names.
Returns:
Type | Description |
---|---|
List[str]
|
List of group names. |
Source code in penvm/src/client/penvm/client/config.py
275 276 277 278 279 280 281 |
|
get_meta(name)
Get meta(data).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Metadata item name. |
required |
Returns:
Type | Description |
---|---|
Any
|
Metadata item value. |
Source code in penvm/src/client/penvm/client/config.py
283 284 285 286 287 288 289 290 291 292 |
|
get_network(name)
Get network configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Network name. |
required |
Returns:
Type | Description |
---|---|
NetworkConfig
|
Network configuration object. |
Source code in penvm/src/client/penvm/client/config.py
294 295 296 297 298 299 300 301 302 303 |
|
get_networks()
Get network names.
Returns:
Type | Description |
---|---|
List[str]
|
List of network names. |
Source code in penvm/src/client/penvm/client/config.py
305 306 307 308 309 310 311 |
|
get_target(name)
Get target.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Target name. |
required |
Returns:
Type | Description |
---|---|
TargetConfig
|
Target configuration object. |
Source code in penvm/src/client/penvm/client/config.py
313 314 315 316 317 318 319 320 321 322 |
|
get_targets()
Get target names.
Returns:
Type | Description |
---|---|
List[str]
|
List of target names. |
Source code in penvm/src/client/penvm/client/config.py
324 325 326 327 328 329 330 |
|
load(path)
Load configuration from a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
File path. |
required |
Source code in penvm/src/client/penvm/client/config.py
230 231 232 233 234 235 236 237 238 239 240 241 242 |
|
load_config(d)
Load configuration from a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
d |
dict
|
Configuration. |
required |
Source code in penvm/src/client/penvm/client/config.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
|
expand_range(s)
Expand numbered, comma-separated ranges.
Supported formats are:
- <start>-<end>
- <single>
Leading 0s set width of resulting numbers (e.g., 001 for a width of three digits).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s |
str
|
Formatted string. |
required |
Returns:
Type | Description |
---|---|
List[str]
|
List of expanded ranges. |
Source code in penvm/src/client/penvm/client/config.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
expand_value(v, d)
Expand/resolve value using dictionary.
Resolvable items are specified using the str.format
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
v |
str
|
Regular or format string. |
required |
d |
dict
|
Dictionary used to resolve format string. |
required |
Returns:
Type | Description |
---|---|
str
|
Resolved "value". |
Source code in penvm/src/client/penvm/client/config.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
listify_targets(s)
Expand targets settings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
s |
str
|
String of targets/target ranges. |
required |
Returns:
Type | Description |
---|---|
List[str]
|
List of expanded ranges. |
Source code in penvm/src/client/penvm/client/config.py
110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
srange(start, end, step, sz)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start |
int
|
Start value. |
required |
end |
int
|
End value. |
required |
step |
int
|
Step value. |
required |
sz |
str
|
Field width. |
required |
Yields:
Type | Description |
---|---|
str
|
Range value. |
Source code in penvm/src/client/penvm/client/config.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|
penvm.client.machine
Machine
Bases: BaseObject
Client-side representation of a server-side machine.
Source code in penvm/src/client/penvm/client/machine.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
|
__init__(host, port, sslprofile=None, machineid=None)
Initialize.
Set up client-side machine representation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
host |
str
|
Host address. |
required |
port |
int
|
Port. |
required |
sslprofile |
Union[str, None]
|
SSL profile for SSL context. |
None
|
machineid |
Union[str, None]
|
Machine id. Generated if not provided. |
None
|
Source code in penvm/src/client/penvm/client/machine.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
get_debug_session(sessionid=None)
Get debug-specific session.
Debug sessions (should) start with "-debug-". They are treated specially by machines: they are not subject to the debug mode.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sessionid |
str
|
Session id (suffix) for a debug session. |
None
|
Returns:
Type | Description |
---|---|
Session
|
Session for debugging. |
Source code in penvm/src/client/penvm/client/machine.py
92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
get_kernel_class(kernel_name)
Get kernel client class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kernel_name |
str
|
Kernel name. |
required |
Returns:
Type | Description |
---|---|
Type[KernelClient]
|
Kernel client class for |
Source code in penvm/src/client/penvm/client/machine.py
106 107 108 109 110 111 112 113 114 115 |
|
get_machconnspec()
Get MachineConnectionSpec
object for this machine.
Returns:
Type | Description |
---|---|
MachineConnectionSpec
|
|
Source code in penvm/src/client/penvm/client/machine.py
117 118 119 120 121 122 123 |
|
get_machconnstr()
Get machine connection string for this machine.
Returns:
Type | Description |
---|---|
str
|
Machine connection string. |
Source code in penvm/src/client/penvm/client/machine.py
125 126 127 128 129 130 131 |
|
get_session(sessionid=None, kernelname='default')
Get session.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sessionid |
Union[str, None]
|
Session id. Generated if not provided. |
None
|
kernelname |
str
|
Kernel name. |
'default'
|
Returns:
Type | Description |
---|---|
Session
|
New |
Source code in penvm/src/client/penvm/client/machine.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
|
get_sslcontext(sslprofile)
Load client-side SSLContext based on named ssl profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sslprofile |
str
|
SSL profile name. |
required |
Returns:
Type | Description |
---|---|
SSLContext
|
|
Source code in penvm/src/client/penvm/client/machine.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
|
imq_put(msg)
Put a message on the IMQ.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg |
Message
|
Message object. |
required |
Source code in penvm/src/client/penvm/client/machine.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
|
list_kernels()
Get list of kernel names.
Returns:
Type | Description |
---|---|
List[str]
|
List of kernel names. |
Source code in penvm/src/client/penvm/client/machine.py
209 210 211 212 213 214 215 216 217 218 219 |
|
load_assets(assets)
Load/copy assets to the machines.
NIY.
Source code in penvm/src/client/penvm/client/machine.py
221 222 223 224 225 226 227 228 229 |
|
load_kernel(kernel_name, pkgname)
Load/copy kernel to the machine.
Kernel support is provided as:
<pkg>/
client.py
KernelClient
server.py
Kernel
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kernel_name |
str
|
Kernel name. |
required |
pkgname |
str
|
Package name (as a string). |
required |
Returns:
Type | Description |
---|---|
KernelClient
|
Kernel client class. |
Source code in penvm/src/client/penvm/client/machine.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
|
omq_put(msg)
Put a message on the OMQ.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg |
Message
|
Message to enqueue. |
required |
Source code in penvm/src/client/penvm/client/machine.py
269 270 271 272 273 274 275 276 277 278 279 |
|
start()
Start machine.
Source code in penvm/src/client/penvm/client/machine.py
281 282 283 284 285 286 287 288 289 |
|
stop()
Stop machine.
Set exit
attribute to signal machine should exit.
Source code in penvm/src/client/penvm/client/machine.py
291 292 293 294 295 296 297 298 299 300 |
|
penvm.client.session
A client-side session is used to interact with a machine. Each session has its own unique session id, specified on the client side. Any number of concurrent sessions are supported, subject to resource limits.
Each client-side session has its own incoming and outgoing message queues (not the same as those on the server side but related). All communication is mediated with these message queues with forwarding to and from handle automatically (see penvm.lib.connection).
Convenience methods are provided for interacting at a high level
with the message queues (e.g., Session.get_response()
).
Each client-side session is set up with access to a selected,
session-specific, client-side kernel interface. Although not
absolutely required, this interface is highly recommended to provide
a function-style interface rather than having to build a Request
message.
See penvm.server.session for details.
Session
Bases: BaseObject
Client-side session object.
Provides unique sessionid and access to client-side machine services.
Low-level methods return the request object. This allows for tracking and followup of a session.
High-level methods return None.
Source code in penvm/src/client/penvm/client/session.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|
__init__(machine, sessionid=None, kernelcls=None)
Initialize.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
machine |
Machine
|
Machine owning this session. |
required |
sessionid |
Union[str, None]
|
Session id. |
None
|
kernelcls |
Type[KernelClient]
|
|
None
|
Source code in penvm/src/client/penvm/client/session.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
get_response()
Pull (from remote) and pop from local and return.
Returns:
Type | Description |
---|---|
Message
|
Response message. |
Source code in penvm/src/client/penvm/client/session.py
93 94 95 96 97 98 99 100 |
|
new_request(op, d=None)
Return session-specific Request object with op
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
op |
str
|
Operation name. |
required |
d |
Union[dict, None]
|
Request payload settings. |
None
|
Returns:
Type | Description |
---|---|
Message
|
Created request. |
Source code in penvm/src/client/penvm/client/session.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
newput_request(op, d=None)
Create request and put it out to be sent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
op |
str
|
Operation name. |
required |
d |
Union[dict, None]
|
Request payload settings. |
None
|
Returns:
Type | Description |
---|---|
Message
|
Created request. |
Source code in penvm/src/client/penvm/client/session.py
119 120 121 122 123 124 125 126 127 128 129 130 |
|
pop_response()
Pop response from local and return.
Returns:
Type | Description |
---|---|
Message
|
Response message. |
Source code in penvm/src/client/penvm/client/session.py
132 133 134 135 136 137 138 |
|
pull_response(sessionid=None)
Pull (pop from remote to local) response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sessionid |
Union[str, None]
|
Session id. |
None
|
Source code in penvm/src/client/penvm/client/session.py
140 141 142 143 144 145 146 |
|
put_request(req)
Put the request on the machine OMQ. Return it, also.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
req |
Message
|
Request message. |
required |
Returns:
Type | Description |
---|---|
Message
|
The Request message, itself. |
Source code in penvm/src/client/penvm/client/session.py
148 149 150 151 152 153 154 155 156 157 158 |
|
penvm.client.world
The World object is foundational for defining the set of networks and machines available to an application. It can be set up in various ways: configuration, configuration file, network string, environment variables. All of these provide flexibility for many use cases.
An application is associated with a world configuration explicitly (specific configuration or named configuration file) or implicitly (environment variable or related .penvm file).
Each running machine instance is defined by a MachineConnectionSpec
which can be represented as a Machine Connection string. A machine
connection consists of:
- machine id (unique)
- ssl profile (name)
- hostname/address
- port
A network string consists of one or more machine connection strings.
Network
Bases: BaseObject
Network.
Encapsulates references to targets and booted machine instances.
Source code in penvm/src/client/penvm/client/world.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
|
__init__(name, targets, config)
Initialize.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Network name. |
required |
targets |
List[Target]
|
List of network targets. |
required |
config |
NetworkConfig
|
Network configuration. |
required |
Source code in penvm/src/client/penvm/client/world.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
boot(concurrency=None)
Boot (machines in) network.
Boots machine instances using target information.
Boot concurrency ("boot-concurrency" configuration setting) is: 0: number of targets, 1: serial, > 1 concurrent. Final minimum is 1. Default is 1.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
concurrency |
Union[int, None]
|
Boot concurrency. Overrides configuration if provided. |
None
|
Source code in penvm/src/client/penvm/client/world.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
|
get_machconnspecs()
Get MachineConnectionSpec
s for machines.
Returns:
Type | Description |
---|---|
List[MachineConnectionSpec]
|
List of |
Source code in penvm/src/client/penvm/client/world.py
341 342 343 344 345 346 347 |
|
get_machconnstrs()
Get machine connection strings for machines.
Returns:
Type | Description |
---|---|
List[str]
|
List of machine connection strings. |
Source code in penvm/src/client/penvm/client/world.py
349 350 351 352 353 354 355 |
|
get_machine(target_name)
Get machine.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_name |
str
|
Target name. |
required |
Returns:
Type | Description |
---|---|
Machine
|
Machine for named target. |
Source code in penvm/src/client/penvm/client/world.py
357 358 359 360 361 362 363 364 365 366 |
|
get_machine_names()
Get list of machine names for network.
Returns:
Type | Description |
---|---|
List[str]
|
List of machine names. |
Source code in penvm/src/client/penvm/client/world.py
376 377 378 379 380 381 382 |
|
get_machines()
Get list of machines for network.
Returns:
Type | Description |
---|---|
List[Machine]
|
List of |
Source code in penvm/src/client/penvm/client/world.py
368 369 370 371 372 373 374 |
|
get_target_names()
Get target names for network.
Returns:
Type | Description |
---|---|
List[str]
|
List of target names. |
Source code in penvm/src/client/penvm/client/world.py
392 393 394 395 396 397 398 |
|
get_targets()
Get targets for network.
Returns:
Type | Description |
---|---|
List[Target]
|
List of Targets. |
Source code in penvm/src/client/penvm/client/world.py
384 385 386 387 388 389 390 |
|
is_alive()
Indicate if network is alive, or not.
Returns:
Type | Description |
---|---|
bool
|
|
Source code in penvm/src/client/penvm/client/world.py
400 401 402 403 404 405 406 |
|
shutdown()
Shut down network.
Request for machines to be shutdown. Clear local tracking of machines by network.
Source code in penvm/src/client/penvm/client/world.py
408 409 410 411 412 413 414 415 416 417 418 |
|
Target
Bases: BaseObject
Target.
Source code in penvm/src/client/penvm/client/world.py
421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 |
|
__init__(name, config=None)
Initialize.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Target name. |
required |
config |
Union[TargetConfiguration, None]
|
Target configuration. |
None
|
Source code in penvm/src/client/penvm/client/world.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 |
|
boot()
Boot machine on target.
Spawns penvm-server
processes for each target.
Source code in penvm/src/client/penvm/client/world.py
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 |
|
update(config)
Update configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
dict
|
Configuration. |
required |
Source code in penvm/src/client/penvm/client/world.py
597 598 599 600 601 602 603 |
|
World
Bases: BaseObject
World of networks and hosts.
Configuration is taken from:
config
keyword argumentnetworkstr
keyword argumentfilename
keyword argumentPENVM_AUTO_NETWORK
environment variablePENVM_WORLD_FILENAME
environment variable<binname>.penvm
found in directory containing executable
Source code in penvm/src/client/penvm/client/world.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
|
__init__(**kwargs)
Initialize.
Other Parameters:
Name | Type | Description |
---|---|---|
config |
dict
|
Dictionary configuration. |
filename |
str
|
Configuration filename. |
networkstr |
str
|
Network string of machine connection strings. |
Source code in penvm/src/client/penvm/client/world.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
get_meta(name)
Get meta(data) value.
Returns:
Type | Description |
---|---|
Any
|
Value. |
Source code in penvm/src/client/penvm/client/world.py
130 131 132 133 134 135 136 |
|
get_network(network_name='default')
Get network object by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
network_name |
str
|
Network name. |
'default'
|
Returns:
Type | Description |
---|---|
Network
|
Network. |
Source code in penvm/src/client/penvm/client/world.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|
get_network_names()
Get network names.
Return
Network names.
Source code in penvm/src/client/penvm/client/world.py
169 170 171 172 173 174 175 |
|
get_networks()
Get networks.
Return
List of networks.
Source code in penvm/src/client/penvm/client/world.py
161 162 163 164 165 166 167 |
|
get_target(target_name)
Get target by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_name |
str
|
Target name. |
required |
Returns:
Type | Description |
---|---|
Target
|
Target. |
Source code in penvm/src/client/penvm/client/world.py
177 178 179 180 181 182 183 184 185 186 |
|
get_target_names()
Get target names.
Returns:
Type | Description |
---|---|
List[str]
|
List of target names. |
Source code in penvm/src/client/penvm/client/world.py
188 189 190 191 192 193 194 |
|
load_auto_network(name, networkstr)
Load auto-scheme (predefined, running) network
The machine connection strings are used to generate a configuration for targets (by machid) and a network.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Network name. |
required |
networkstr |
str
|
Network string. |
required |
Source code in penvm/src/client/penvm/client/world.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
|
shutdown()
Shut down network.
Results in machine instances being shut down.
Source code in penvm/src/client/penvm/client/world.py
226 227 228 229 230 231 232 233 234 235 |
|