Skip to main content
A session helps a client remember workflow state. It does not keep a sandbox VM or process alive after an operation ends.

What each object retains

A new command from a saved image always creates new execution.

Choose an execution mode

The SDK popen() wrapper is not the REST additional-subprocess API. It does not attach a new child to an already-running operation.

Python run patterns

Complete Set up access and install contree-sdk==0.3.6 as shown in the Python quickstart. Each example runs /bin/echo so the execution mode is easy to compare. Use an image tag available in your project. Place the async fragment inside the quickstart’s async main(), with its authenticated client. The synchronous examples can run as ordinary Python scripts. Async SDK 0.3.6 prepares the request first and submits it when awaited:
The synchronous client uses wait():
The synchronous subprocess-style wrapper supports the familiar popen() and wait() sequence in SDK 0.3.6:
Each example prints:
Set persistence explicitly in any run() call whose state matters. The SDK 0.3.6 session signature also defaults to disposable=True; session naming does not change that choice.

Live processes

An additional subprocess can run only while its parent operation is active. It shares the parent VM, filesystem, resource budget, and lifetime. Use the REST endpoints to:
  1. wait for an explicit parent readiness signal;
  2. spawn the additional process and record its subprocess ID;
  3. observe its output or send ordered stdin;
  4. close stdin deliberately or send a signal; and
  5. inspect both child and parent results.
A completed child does not create its own checkpoint. See Run subprocesses and send input for the bounded workflow.

Continue