Tom Larkworthy12/03/2021, 8:08 AM
Konrad Hinsen12/03/2021, 10:06 AM
Tom Larkworthy12/03/2021, 10:57 AM
//server remoteFunction = serve((x) => x*x), options)
I think there is enough wiggle room for people to add their own abstractions, and because the result is a promise we can put in network errors. Would this cover your usecase? (if anyone knows of any simple RPC abstractions I should draw inspiration from I would love to see)
answer = await remoteFunction(5)
Konrad Hinsen12/08/2021, 1:27 PM
Tom Larkworthy12/08/2021, 1:54 PM
Konrad Hinsen12/09/2021, 8:02 AM
Tom Larkworthy12/09/2021, 8:18 AM
I need to set up some server first, right?No! The webcode runtime is a generic container  that knows how to run notebooks (it has puppeteer inside it). So that one container runs all the notebooks. If you looks at the outbound requests to webcode, the URL encodes which notebook to dynamically lookup. The Oath implementation is at the application level in a notebook. Often, you also need persistence, so I use Firebase as that works well with browser. The server is pupeteer, i.e., also a browser. So if you want to run your own Oauth server you need to bring-your-own-firebase after forking my notebook.  https://github.com/endpointservices/webcode.run/blob/main/Dockerfile
Konrad Hinsen12/10/2021, 9:40 AM
Tom Larkworthy12/10/2021, 6:52 PM
Florian Schulz12/11/2021, 5:51 AM
Tom Larkworthy12/11/2021, 7:22 AM
What if you write a crazy service that causes way too much load?1. Its rate limited but also 2. I hit their "embed" endpoint which is hosted on a CDN and targeted at 3rd party embedding on external websites.
Do you think this can fly for real world projects?Yes! Most features are implemented as webcode, for example, the secrets API is webcode hosted and wraps Google Secret Manager The latency prober I use to measure performance is also webcode implemented. We have got hot performance down to 30ms! It's not quite as fast as a dedicated lambda but its in an acceptable engineering trade off zone IMHO (devX for a little perf hit).
is there a way to host/install the environment on your own cloud infrastructure of choice?Yes it is technically possible, if you look at the API options, you can set the remote and region, so you can host your own webcode.run container (and you can set it to localhost for testing). I have not documented the self hosting path yet, but I would like to encourage it when I have some demand for that. The runtime is in a single container, so it should be fairly portable. I use Cloud Run.
Is only the source code (as text) from Observable used but the actual executing server is deployed elsewhere?Yeah Observable is the code hosting platform + reactive runtime. The compute is external (webcode.run uses Google Cloud Run but any docker hosting service "should" work, I am thinking about migrating to fly.io). The realtime user control plane is Firestore though, and that is unlikely to be switchable. I would say the state of it is still a little pre-production. I am not providing an SLO or carrying a pager yet, but it is actively monitored and robustness has hugely improved in the last 6 months. I think it's amazing for API glue, but it struggles when you need a filesystem, like technically it can be a webserver, but uploading static assets is kinda hard so it can only really do small util endpoints at the moment.
Florian Schulz12/18/2021, 6:12 AM
Tom Larkworthy12/18/2021, 9:27 AM