TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Program Explorer, a container playground

73 点作者 aconz22 个月前
Inspired by Compiler Explorer and other playground&#x2F;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&#x27;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.<p>I&#x27;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&#x27;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.<p>You choose a container image, set the args, edit the files you want to have at &#x2F;run&#x2F;pe&#x2F;input, then it gets run in a fresh VM and sends back stdout, stderr, and whatever is in &#x2F;run&#x2F;pe&#x2F;output. No network access.<p>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.<p>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&#x2F;demos.<p>The files you send and produce are never written to disk and not stored after your request is complete.<p>MIT licensed at <a href="https:&#x2F;&#x2F;github.com&#x2F;aconz2&#x2F;program-explorer" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;aconz2&#x2F;program-explorer</a>. 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.<p>I have lots of ideas and directions I&#x27;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!

5 条评论

mattgodbolt2 个月前
Congrats! It&#x27;s amazing to see what CE has inspired! Thanks for the shout out :)
simpaticoder2 个月前
Congrats on a launch, sounds like your implementation is quite thoughtful. In fact limiting to only shell helps focus on what you&#x27;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.
评论 #43337087 未加载
TkTech2 个月前
Neat! One small bug - In dark mode, the text on the banner at the top is unreadable.
评论 #43342112 未加载
sys132 个月前
Feedback on the name: I didn&#x27;t think that it would be about containers. The other platforms you mentioned are more descriptive (jsfiddle, db-fiddle, Go playground, and Rust playground)
评论 #43334682 未加载
评论 #43334983 未加载
评论 #43334633 未加载
vivzkestrel2 个月前
only supports running shell scripts?
评论 #43335510 未加载