[HN Gopher] Show HN: Program Explorer, a container playground
       ___________________________________________________________________
        
       Show HN: Program Explorer, a container playground
        
       Inspired by Compiler Explorer and other playground/fiddle websites
       like jsfiddle, db-fiddle, Go playground, and Rust playground, I
       thought it would be cool to have a playground for nearly any
       program so I've been working on Program Explorer: a playground for
       running programs from containers. I am inspired by these
       playgrounds because they are great educational tools for quickly
       experimenting and as communication tools by sharing shortlinks that
       reproduce bugs for instance. I would love for every open source
       project that publishes a container to get their own playground for
       free.  I'm also interested in the user experience of setupless
       container execution. Containers have greatly improved program
       distribution, but serverless container cloud runtimes like Google
       Cloud Run or AWS Lambda still require transferring the container
       image, creating an executor, and invoking the executor. These cloud
       services also come with hardware caps like memory limits where if
       you need more than that, you're back to provisioning a server. I
       want science researchers for instance to be able to run any
       computational tool with no setup. Program Explorer is a step in
       that direction.  You choose a container image, set the args, edit
       the files you want to have at /run/pe/input, then it gets run in a
       fresh VM and sends back stdout, stderr, and whatever is in
       /run/pe/output. No network access.  You can also set env vars and
       attach a file as stdin for more control. Most flexibility comes
       from containers with a shell so that you can write a script to run
       multiple commands.  Currently, you can only pick container images
       from a predefined list, but suggestions on what to include are
       welcome. Each run is limited to 1 second (wall clock on a dedicated
       core) and 1 GB memory as right now the focus is on quick
       tests/demos.  The files you send and produce are never written to
       disk and not stored after your request is complete.  MIT licensed
       at https://github.com/aconz2/program-explorer. Briefly how it
       works: container images get packed (ahead of time) into an erofs
       image, a VM is run with cloud-hypervisor, init process unpacks your
       files and mounts the rootfs, crun runs the container, then pack
       your output files and exit code etc. (rusage is in there too if you
       open the JS console). The server is written as a load balancer
       using pingora so multiple workers could (eventually) be used, but
       that is a WIP and currently only has one worker.  I have lots of
       ideas and directions I'd like to take this but wanted to ship
       something so others could start playing with it. Looking forward to
       hearing your ideas and feedback!
        
       Author : aconz2
       Score  : 46 points
       Date   : 2025-03-11 16:33 UTC (6 hours ago)
        
 (HTM) web link (programexplorer.org)
 (TXT) w3m dump (programexplorer.org)
        
       | sys13 wrote:
       | Feedback on the name: I didn't think that it would be about
       | containers. The other platforms you mentioned are more
       | descriptive (jsfiddle, db-fiddle, Go playground, and Rust
       | playground)
        
         | connormon wrote:
         | Completely agree. It almost sounds like a website to discover
         | new programs. At the same time, I can't think of anything off
         | the top of my head that would be a better name.
        
         | aconz2 wrote:
         | Yeah names are hard and it is just a working name. I'm
         | simultaneously using containers as the distribution and runtime
         | mechanism but also wanted them to be an implementation detail
         | and not the spotlight
        
       | vivzkestrel wrote:
       | only supports running shell scripts?
        
         | aconz2 wrote:
         | You can run any program that is in the container you select.
         | Right now it ignores the entrypoint from the container config
         | (though you could manually copy that into the Cmd field). Shell
         | is a convenient program to run though so you can pass it a
         | script to then run multiple commands. But you can run `date`
         | directly for instance:
         | https://programexplorer.org/#s=eyJjbWQiOiJkYXRlIiwic3RkaW4iO...
        
       | simpaticoder wrote:
       | Congrats on a launch, sounds like your implementation is quite
       | thoughtful. In fact limiting to only shell helps focus on what
       | you're giving - 1 second of compute with 1GB of RAM, for free.
       | Who knows what scripts people will try? I think sharing those
       | scripts would be interesting. In that vein, sharing from you to
       | your users, consider providing some example scripts that
       | demonstrate the fiddly differences between base images.
        
         | aconz2 wrote:
         | Thank you! I'm also excited at the possibilities and today you
         | can share "long links" (with all the data embedded in the URL's
         | fragment) but in the future short links with storage on the
         | server or loading from a gist for example would be another cool
         | feature. And having a variety of interesting examples ready to
         | go like you mention would be nice too. There's almost too much
         | there that I was worried I would never ship and would still be
         | playing with examples. For fun, here is the most basic version
         | of compiler explorer
         | https://programexplorer.org/#s=eyJjbWQiOiJzaCAvcnVuL3BlL2luc...
        
       ___________________________________________________________________
       (page generated 2025-03-11 23:00 UTC)