Contexts and Executions¶
Manage contexts and executions on the server.
Methods available on client.contexts
:
-
class
renga.models.deployer.
ContextCollection
(client=None)[source]¶ Represent a collection of contexts.
Create a representation of objects on the server.
-
list
()¶ Return a list if the collection is iterable.
-
Context objects¶
-
class
renga.models.deployer.
Context
[source]¶ Represent a deployer context.
Create a representation of an object on the server.
-
executions
¶ Return the collection of context executions.
-
id
¶ The identifier of the object.
-
image
¶ Image used for the executions.
-
inputs
¶ Return the context input objects.
-
labels
¶ Return the context labels.
-
lineage
¶ Return the lineage of this context.
-
outputs
¶ Return the context output objects.
-
run
(inputs=None, outputs=None, **kwargs)[source]¶ Execute the context.
Optionally provide new values for input and output slots. Following example shows how to create new execution from the current context with different files attached to input and output slots.
execution = client.current_context.run( engine='docker', inputs={ 'notebook': client.buckets[1234].file[9876].clone(), }, outputs={ 'plot': client.buckets[1234].create('plot.png'), }, ) print(execution.url)
-
spec
¶ Specification of the execution context.
-
vertex_id
¶ Graph vertex id.
-
Executions¶
Execution objects¶
-
class
renga.models.deployer.
Execution
[source]¶ Represent a context execution.
Create a representation of an object on the server.
-
context
¶ Return the related context.
-
context_id
¶ Return the associated context id.
-
engine
¶ Return the execution engine.
-
environment
¶ Return the execution environment variables.
-
id
¶ The identifier of the object.
-
ports
¶ Return runtime port mapping.
-
url
¶ Return a URL for accessing the running container.
-