nitro icon indicating copy to clipboard operation
nitro copied to clipboard

open-runtimes preset

Open sandros94 opened this issue 1 year ago • 4 comments

Describe the feature

Recently I've discovered open-runtimes, used under the hood by Appwrite:

Runtime environments for serverless cloud computing for multiple coding languages, aiming to create a consistent and predictable open standard for writing cloud functions in containerized systems.

I was looking for building a custom nitro worker-preset, but I have no idea where to start. The runtime accepts a context argument (Bun's one for reference) and I imagine that it is about mapping the request information to what nitro accepts and then the nitro return to the response one? But then how could I catch server logs?

I'm farily new to this topic, so I hope I'm not mixing up things. My endgoal was to experiment with Nuxt on open-runtimes

Additional information

  • [X] Would you be willing to help implement this feature?

sandros94 avatar May 17 '24 11:05 sandros94

As i undrestand correctly, they essentially provide docker image for Node? What would be benefit of supporting this project as a preset?

(update, i see this example it is docker+node+micro still wondering the benefit of doing this over simple docker+node)

pi0 avatar May 17 '24 13:05 pi0

As i undrestand correctly, they essentially provide docker image for Node?

More or less yes. Basically that project started for the need of Appwrite to handle the full Continuous Delivery of serverless functions. Basically Appwrite provides a self-hostable one-stop shop for having a DB, Storage, Users and Serverless execution.

While that is great, I'm currently only interested in studying the use cases for the latter one. One of which is based on the concept of a self-hosted NuxtHub version, where I could have it deployed on a personal docker/k8s instance (like a homelab) alongside open-runtimes that handles both deployment and execution. Bootstrapping a project would only require adding its repo to your instance of NuxtHub (via GitHub App), pushing a commit and watching the logs go.

There are a number of proprietary projects that already do this, but I much enjoy the goal of open runtimes being an open standard in handling serverless functions both in deployments and execution. In particular for personal projects and non-business critical work.

P.S.: I hope I didn't sound too confusing. As I said, I'm still experimenting in this topic. But while I'm loving NuxtHub+Cloudflare, I find myself thinking too many times about not wasting precious client's quota when deploying a non-optimized personal test. Something I just don't care when I'm on my old core duo quad server just to show something to my mom (IMHO developer's best reviewer)

sandros94 avatar May 17 '24 22:05 sandros94

Okay thanks for the context. BTW i plan to open source a similar solution for js servers but it is way lighter than what seems they do and better tailored for nitro.

I'm not against adding this preset but if your purpose is mainly to study possibilities, i would suggest using a custom preset in your project.

pi0 avatar May 17 '24 23:05 pi0

Okay thanks for the context. BTW i plan to open source a similar solution for js servers but it is way lighter than what seems they do and better tailored for nitro.

I'll be happy to check it out once you do!

I'm not against adding this preset but if your purpose is mainly to study possibilities, i would suggest using a custom preset in your project.

Indeed, or at least until I have both a clear view of its capabilities and their status in the road map (in particular k8s support and auto scaling). Currently I see it more like a community preset, may I ask you if you could point me into the direction on how I should build the custom preset? Should I simply extend the node preset and map the context requests to nitro?

sandros94 avatar May 18 '24 09:05 sandros94

Okay thanks for the context. BTW i plan to open source a similar solution for js servers but it is way lighter than what seems they do and better tailored for nitro.

🤩 That sounds extremely interesting. I've forked lagon to have a self-hostable js serverless system. And having more lightweight and open-source systems would be awesome.

Currently I see it more like a community preset, may I ask you if you could point me into the direction on how I should build the custom preset?

https://nitro.unjs.io/deploy/custom-presets

anbraten avatar Jul 05 '24 18:07 anbraten

https://nitro.unjs.io/deploy/custom-presets

Thanks, I did already check the docs before opening this issue. It's that my insanely limited knowledge in how serverless workers do work leave me without any idea on how to draft things up 😅

sandros94 avatar Jul 05 '24 21:07 sandros94

Moving to unified tracker #2973

pi0 avatar Jan 07 '25 16:01 pi0