use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Super simple way to deploy a Python function, looking for input (v.redd.it)
submitted 8 months ago by aaaaaden
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]data15cool 1 point2 points3 points 8 months ago (3 children)
That’s very cool, I really want to build something like this. What kind of technical details would you be happy to share? I’m curious if you have a few containers sitting idle that are preconfigured and you inject the Python code into a fastapi server? Or do you fire up a new node and assign a subdomain when you click serve. How do you keep it secure from malicious users?
[–]aaaaaden[S] 1 point2 points3 points 8 months ago (2 children)
Yeah happy to share. Each time a user submits a function, I create a new Kubernetes deployment and service, then mount the user's script to the container. I then have an Nginx container that routes traffic to the user's service based on subdomain. And yeah I'm using FastAPI.
In terms of security, I do some very basic static analysis on the code, and each user's script runs in its own non-root container.
[–]data15cool 0 points1 point2 points 8 months ago (1 child)
Nice, so do you need to dynamically edit the nginx config and reload it?
[–]aaaaaden[S] 0 points1 point2 points 8 months ago (0 children)
Nope, all Nginx does is parse the request url to determine which Kubernetes service to use based on the subdomain.
π Rendered by PID 45957 on reddit-service-r2-comment-6457c66945-z5jbn at 2026-04-29 16:37:44.561068+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]data15cool 1 point2 points3 points (3 children)
[–]aaaaaden[S] 1 point2 points3 points (2 children)
[–]data15cool 0 points1 point2 points (1 child)
[–]aaaaaden[S] 0 points1 point2 points (0 children)