verygoodsecurity / starlarky

VGS edition of Google's safe and hermetically sealed Starlark language - a non-Turing complete subset of Python 3.
https://vgs.dev
Apache License 2.0
28 stars 38 forks source link

Provide Docker Runtime #140

Open mjallday opened 3 years ago

mjallday commented 3 years ago

It would be good to have a dockerized container that allows executing starlark runtime locally.

This would be useful for local development as well as running other projects such as argo workflows.

Here's an example of how it could be used in argo

script:
 image: starlarky:1.0
 command:
 - python
 source: |
    load("@stdlib//re2j", "re2j")
    def process(input, ctx):
       # do your code here

I guess the concept here is that we'd provide an entrypoint or cmd which takes a script as an input and then allows it to be invoked by passing data via stdin/stdout.

I'm not sure exactly how the api would work but it would be useful for executing starlarky anywhere.

AndrewGold commented 1 year ago

+1 this would be very helpful. I'm currently struggling to get the local environment set up

Iapetus999 commented 1 year ago

You can do this via Horizon and grpcurl I have scripts in Horizon that do this.