# Diggy: a zero-setup development environment ## Current status Completed. ## Overview Diggy is an open-source out-of-the-box solution aimed at aspiring developers, helping them to start working on a project in less than a second, and without the need for setup and deployment. It is Google Docs tailored coding. ## Why My hypothesis is that to do anything interesting in programming nowadays, one must to learn at least a dozen disjointed tools and platforms such as Git/Github, VS Code, AWS/DigitalOcean, Nginx, GoDaddy to begin with. As a beginner one doesn’t need source control, automatically provision infrastructure, or build a CI/CD pipeline. Moreover, beginners may not fully control their machines due to security policies--for example, Chromebooks provided by schools--to setup essential developer tools. This situation is frustrating for those learning to code. Furthermore, I found that course completion rates across the online/distance education industry are staggeringly low, at 12%. Certainly, there numerous variables at play, but a part of the problem lies inthe initial barriers. With Diggy, users can learn, create and run applications anywhere the web goes, whether it is on desktop, Chromebook or mobile device. Diggy is open-source, and can be integrated into existing platforms to provide cohesive educational experience. Users don't have to watch lectures in one window and switch to another tab to complete an assignment. To launch a real, fully-functional application, a user: - Doesn’t need to install an operating system, Python, LAMP, Node or anything else. - Doesn’t need to sign up with a hosting provider and provision anything. - Doesn’t need to commit, push, build, or deploy code. While this sounds like a sales pitch, everything is open-source and could be self-hosted. ## Project This project went through three iterations, and the latest one is being the most fruitful: 1. Nomad cluster running Firecracker containers 2. Run Python as a WASM module 3. A shared environment running jailed processes ## Nomad Cluster Nomad is a breath of fresh air in the world of container orchestration. It is simple, fast, and reliable. However, after a few experiments, I decided to explore alternatives because managing a cluster of containers for small projects felt unnecessary complicated. ## Python as a WASM module I was excited about the potential of WebAssembly to run code in the browser and thought it would be a perfect fit for Diggy. However, I discovered that the performance of Python compiled to WASM was not good enough for me. It was slow and memory-hungry. Additionally, library management--such as compile Pandas to WASM--proved to be problematic. I decided to explore other options. ## Jailed processes Jailed processes and a shared environment that executes application or scripts. I found a project called `nsjail` that allows running processes in a restricted environment. I built a simple web interface that allows users to write and safely execute code. This time, I was happy: it was fast, secure, and easy to use. There are a few constraints: - Time limit: 6 seconds. - Memory limit: 50MB. - Process count limit: two threads max. - No networking. - Restricted filesystem: `/userland` is the only read-write volume. - As of writing this post, only Python and Ruby languages are supported. I have opened another PR for ANSI C support, which works, but I need to streamline a few aspects before I merge it into the master branch. URL: https://github.com/oneearedrabbit/shell/ Or Diggy: https://diggy.sh diggy-website.png ## Related - [[2021-05-21-run-python-in-a-sandbox-with-nsjail]] - [[2021-02-28-run-a-firecracker-on-nomad]] - [[2021-02-26-run-streamlit-on-firecracker]] - [[2021-02-24-running-firecracker-on-google-kubernetes-engine]] - [[2021-02-24-run-firecracker-on-digitalocean]] - [[2021-02-23-firecracker-network-setup]] - [[2021-02-21-firecracker-on-thinkpad-x220]] - [[2021-02-18-docker-checkpoint-and-restore]] - [[2021-02-12-setting-up-minikube-on-thinkpad-x220]]