I have something similar[0] but with a different philosophy. Basically, a docker container running and you can execute code against with ability to set timeouts, auto install and uninstall dependencies and a bunch of other cool stuff.
The pain point of all of this is dependencies and making sure someone doesn’t use your infrastructure to DDOS other folks.