Skip to content

Execution from source code #11

@expede

Description

@expede

A question that was raised recently was "how would one run source code directly from a Task". For example, how would you run a Python script?

We know from other systems like Nix that this is actually a nontrivial case to make reproducible. It depends on the chip architecture, OS, available system libraries, and so on.

You can specify all of these by hash ahead of time. A generic task type "run this Python" could fall into one of the following strategies:

  1. If you don't care about reproducibility, set that expectation as a very loose/dangerous/attested effect
  2. Fully specification the expectations of the environment (x86 Linux, with these versions down to the hash of these libraries installed)
  3. Run inside of an established Docker container (by CID) that has the relevant environment set up
  4. Feed the source to a Wasm Python interpreter
  5. Feed the source to a Wasm compiler
  6. Compile the Python to Wasm and execute it directly

2, 3, and 4 are actually really interesting, because you don't even need a new kind of Task. The source can "just" be an argument, and either use the output to further steps (4) or get the result back directly.

4 additionally gets you new Wasm that can be cached for future invocation, which is really helpful for (automatically) publishing reproducible packages to registries — which is a common workflow for e.g. a GitHub Actions.

3 and 4 and kind of microkernel-y, because you could later swap in a different (faster, bugfixed, etc) interpreter/compiler.

CC @simonwo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions