https://github.com/deislabs/wagi Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} deislabs / wagi Public * Notifications * Star 244 * Fork 23 Write HTTP handlers in WebAssembly with a minimal amount of work Apache-2.0 License 244 stars 23 forks Star Notifications * Code * Issues 9 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 4 branches 2 tags Code Latest commit @technosophos technosophos Merge pull request #120 from radu-matei/apache ... 79ff7ae Sep 7, 2021 Merge pull request #120 from radu-matei/apache Update license to Apache v2 79ff7ae Git stats * 221 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows Fix name of licence file in release pipeline (#85) Jun 30, 2021 docs Change version to 0.3.0 Aug 26, 2021 examples Nitishm/enhancement/42/module config concurrency param (#107) Aug 17, 2021 src Fetch credentials for priv registry if exists Sep 3, 2021 .gitignore Nitishm/enhancement/42/module config concurrency param (#107) Aug 17, 2021 Cargo.lock Fetch credentials for priv registry if exists Sep 3, 2021 Cargo.toml Fetch credentials for priv registry if exists Sep 3, 2021 LICENSE.txt Update license to Apache v2 Sep 7, 2021 Makefile improve support for environment variables Jul 7, 2021 README.md Updated a bunch of things related to WAGI releases Jul 8, 2021 View code WAGI: WebAssembly Gateway Interface tl;dr Quickstart Examples and Demos Contributing Code of Conduct README.md WAGI: WebAssembly Gateway Interface WAGI is the easiest way to get started writing WebAssembly microservices and web apps. WARNING: This is experimental code. It is not considered production-grade by its developers, neither is it "supported" software. DeisLabs is experimenting with many WASM technologies right now. This is one of a multitude of projects (including Krustlet) designed to test the limits of WebAssembly as a cloud-based runtime. tl;dr WAGI allows you to run WebAssembly WASI binaries as HTTP handlers. Write a "command line" application that prints a few headers, and compile it to WASM32-WASI. Add an entry to the modules.toml matching URL to WASM module. That's it. You can use any programming language that can compile to WASM32-WASI. Quickstart Here's the fastest way to try out WAGI. For details, checkout out the documentation. 1. Get the latest binary release 2. Unpack it tar -zxf wagi-VERSION-OS.tar.gz 3. Run the wagi --help command If you would like to try out a few simple configurations, we recommend cloning this repository and then using the examples directory: $ wagi -c examples/modules.toml No log_dir specified, using temporary directory /var/folders/hk/l1mlxz1x01x9yl33ll9vh9980000gp/T/.tmpx55XkJ for logs This will start WAGI on http://localhost:3000. Use a browser or a tool like curl to test: $ curl -v http://localhost:3000/hello/world * Trying 127.0.0.1... * TCP_NODELAY set * Connected to localhost (127.0.0.1) port 3000 (#0) > GET /hello/world HTTP/1.1 > Host: localhost:3000 > User-Agent: curl/7.64.1 > Accept: */* > < HTTP/1.1 200 OK < content-type: text/html; charset=UTF-8 < content-length: 12 < date: Wed, 14 Oct 2020 22:00:59 GMT < hello world * Connection #0 to host localhost left intact * Closing connection 0 To add your own modules, compile your code to wasm32-wasi format and add them to the modules.toml file. Check out our Yo-Wasm project for a quick way to build Wasm modules in a variety of languages. Examples and Demos Wagi is an implementation of CGI for WebAssembly. That means that writing a Wagi module is as easy as sending properly formatted content to standard output. If you want to understand the details, read the Common Gateway Interface 1.1 specification. Take a look at the Wagi Examples Repository for examples in various languages. For a "production grade" (whatever that means for a pre-release project) module, checkout out the Wagi Fileserver: A fileserver written in Grain, compiled to Wasm, and ready to run in Wagi. Contributing Want to chat? We hang out in the #krustlet channel of the Kubernetes Slack. WAGI is experimental, and we welcome contributions to improve the project. In fact, we're delighted that you're even reading this section of the docs! For bug fixes: * Please, pretty please, file issues for anything you find. This is a new project, and we are SURE there are some bugs to work out. * If you want to write some code, feel free to open PRs to fix issues. You may want to drop a comment on the issue to let us know you're working on it (so we don't duplicate effort). For refactors and tests: * We welcome any changes to improve performance, clean up code, add tests, etc. * For style/idiom guidelines, we follow the same conventions as Krustlet For features: * If there is already an issue for that feature, please let us know in the comments if you plan on working on it. * If you have a new idea, file an issue describing it, and we will happily discuss it. Since this is an experimental repository, we might be a little slow to answer. Code of Conduct This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments. About Write HTTP handlers in WebAssembly with a minimal amount of work Topics cgi webassembly wasm wasi Resources Readme License Apache-2.0 License Releases 2 Wagi v0.3, now even MORE like CGI! Latest Aug 26, 2021 + 1 release Packages 0 No packages published Contributors 13 * @technosophos * @radu-matei * @thomastaylor312 * @nitishm * @itowlson * @simongdavies * @adamreese * @brooksmtownsend * @VishnuJin * @ColinEberhardt * @bacongobbler + 2 contributors Languages * Rust 99.1% * Makefile 0.9% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.