Much like Spark, Gradle, Cypress, and Flink, a multi-phase approach is used when Kurtosis runs Starlark:
- Interpretation Phase: The Starlark is uploaded to the Kurtosis engine and the Starlark code is run. Each function call on the
Planobject adds a step to a plan of instructions to execute, but the instruction isn't executed yet.
- Validation Phase: The plan of instructions is validated to ensure port dependencies are referencing existing ports, container images exist, duplicate services aren't being created, etc.
- Execution Phase: The validated plan of instructions is executed, in the order they were defined.
Practically, the user should be aware that:
- Running a function on the
Planobject does not execute the instruction on-the-spot; it instead adds the instruction to a plan of instructions to execute during the Execution Phase.
- Any value returned by a
Planfunction in Starlark is not the actual value - it is a future reference that Kurtosis will replace during the Execution Phase when the value actually exists.
To read about why Kurtosis uses this multi-phase approach, see here.