Summary
Currently, invoking Tesseracts via from_tesseract_api doesn't really provide any value-add outside of interactive debugging. When workloads can't be containerized (e.g. when interacting with system-level resources or binaries) we're essentially left with a bunch of restrictions and no real advantages over using Python/JAX code directly.
Having from_tesseract_api invoke tesseract-runtime serve in a subprocess would at least make this marginally more useful, because that way we (1) provide process isolation where it matters; (2) allow code with conflicting Python versions / dependencies to inter-operate.
Why is this needed?
One example: pasteurlabs/tesseract-jax#177 – using JAX-within-JAX isn't safe, so T-JAX can trigger deadlocks when using from_tesseract_api.
Usage example
from tesseract_core import Tesseract
tess = Tesseract.from_tesseract_api(".../tesseract_api.py", spawn_dedicated_process=True)
with tess:
...
Summary
Currently, invoking Tesseracts via
from_tesseract_apidoesn't really provide any value-add outside of interactive debugging. When workloads can't be containerized (e.g. when interacting with system-level resources or binaries) we're essentially left with a bunch of restrictions and no real advantages over using Python/JAX code directly.Having
from_tesseract_apiinvoketesseract-runtime servein a subprocess would at least make this marginally more useful, because that way we (1) provide process isolation where it matters; (2) allow code with conflicting Python versions / dependencies to inter-operate.Why is this needed?
One example: pasteurlabs/tesseract-jax#177 – using JAX-within-JAX isn't safe, so T-JAX can trigger deadlocks when using
from_tesseract_api.Usage example