plugins for kurtosis #813
-
How can I add plugins to kurtosis |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Hi @Mr-Nobody21! Thanks for asking a question here on Github Discussions! To help us help you, can you share with me:
Thank you! |
Beta Was this translation helpful? Give feedback.
-
I also would like to use native starlark plugins in Kurtosis. |
Beta Was this translation helpful? Give feedback.
-
Hey @Mr-Nobody21 @ericobi , thanks for the question! I could see three concepts of "plugins" for Kurtosis, so I'll address all of them here (and if they don't answer your question, let me know!): The ability to add extra functionality to Starlark itselfI.e., adding extra functionality to the language, sort of like C or Rust macros (for example, redefining the We don't want to do this because part of the reason we chose Starlark was for its simplicity, approachability, and ease-of-reading (it's pretty much Just Python). In our experience, macros - while powerful - also add a lot of mental complexity to the reader. Further, we don't want to build a new general-purpose, Turing-complete programming language, because there are already dozens of great options out there. If we're trying to morph Starlark (which is intentionally basic and simple) into a general-purpose language, we're fighting a losing battle. Instead, we want to use Starlark for what it's good at: an orchestration language. In essence, we want users to have enough power to write DRY orchestration logic to define their environments, but not attempt to replace the general-purpose languages. So how do we do this? Basically, by keeping Starlark functionality intentionally limited, and making it very easy to call down to general-purpose programming languages. Our philosophy is basically, "use Starlark for the top-level orchestration, to stitch together a bunch of different pieces, but the pieces are written in actual programming languages". That way users can use whatever general-purpose programming language they please, or mix-and-match as desired. In practice, the ways to call down to different programming languages in Kurtosis are We'll likely continue to add conveniences to make it easier to call down to general-purpose programming languages (e.g. maybe we add Starlark librariesWith that being said, part of writing DRY orchestration logic is code reuse and we do want to promote reusing the Starlark code that you write. This is available in Kurtosis right now through the packaging system for publishing code, and For example, you can start a Postgres service using the Postgres package simply by writing & running this Starlark on your machine: postgres_package = import_module("github.com/kurtosis-tech/postgres-package/main.star")
def run(plan, args):
postgres_package.run(plan) You aren't limited to just the packages we publish though; as long as your package is on Github and has a Adding extra
|
Beta Was this translation helpful? Give feedback.
-
Hey @Mr-Nobody21 , wanted to ping again and check if this answers your question? |
Beta Was this translation helpful? Give feedback.
-
Hi @mieubrisse Yes it does answer my questions and thanks for the elaborate reply |
Beta Was this translation helpful? Give feedback.
Hey @Mr-Nobody21 @ericobi , thanks for the question! I could see three concepts of "plugins" for Kurtosis, so I'll address all of them here (and if they don't answer your question, let me know!):
The ability to add extra functionality to Starlark itself
I.e., adding extra functionality to the language, sort of like C or Rust macros (for example, redefining the
+
operator).We don't want to do this because part of the reason we chose Starlark was for its simplicity, approachability, and ease-of-reading (it's pretty much Just Python). In our experience, macros - while powerful - also add a lot of mental complexity to the reader.
Further, we don't want to build a new general-purpose, Turing-…