WebAssembly is a very promising new technology that is getting a lot of attention from the cloud-native teams at Microsoft, both at its Deis Labs subsidiary and in Azure. With new WebAssembly tools arriving quickly, what is needed is an environment in which you can try it out.
This is why Deis Labs released a file New WebAssembly Hippo WebAssembly very important. Designed like many Deis tools to scratch its own itch, it’s a way to quickly install, manage, and run WebAssembly (WASM) code, whether it’s a hosted browser or a WebAssembly System Standalone Interface (WASI). By using its built-in channels along with the Git server, you can create and publish different versions in one environment, keeping your production, processing and development builds separate while still only needing one Hippo server.
You can host multiple apps at Hippo. WebAssembly means that it is protected by default, which requires explicit permissions to access the host system or external devices. Your code is also portable. Once it’s compiled for WebAssembly, it will run on any WebAssembly system, whether it’s Windows, Linux, or macOS, or whether it’s Intel, RISC-V, or ARM. Hippo gives you a way to build code once, test it once, and run it anywhere.
Setting up Hippo on a PC for development
While tools like Hippo would be ideal for cloud-native operations, the current developer version has only been tested on desktop systems. I decided to try it out on a Windows PC running a recent version of WSL2, hosting Ubuntu. Deis provides instructions for running Hippo locally, with details of macOS and Linux.
There were some issues getting the prerequisites to run Hippo on a WSL2 Ubuntu 20.04 LTS system. First, you need to Install WAGI, WebAssembly Application Gateway Interface. This installs easily enough, with only one binary in the downloadable tarfile hosted at the GitHub repo. Once downloaded, disassembled and navigated to the user binary directory, it is easy to operate. I took the opportunity to install Rust, as I might need it if I had to recompile any of the Deis tools.
This step was probably the hardest in WSL2, as it required a copy of the basic build kit. Ubuntu 20.04 doesn’t have the correct set of dependencies for that, so I needed an alternative package installer that would allow me to revert certain key libraries to the appropriate versions. Stack Overflow’s answer indicated efficiency, which is an alternative to apt that allows you to choose the appropriate dependencies for your installation and allows it to replace two low-level C libraries. I finally got an infrastructure installed, ready for Rust, with its setup scripts.
What is a Bindle?
The main reason for Installing Rust as part of a Hippo installation is for BindleWebAssembly packaging tool from Deis. Bindle is described as an “aggregate object storage” system. The metaphor used by its documentation is that “Bindle is the drawer of digital silver tools”. We may all have a few different items in our silverware drawer, but we all use the drawer to sort and store silverware. Bindle does the same for the artifacts that make up a modern application while providing a level of understanding of how applications are configured, based on how and where they are used.
You can get a Bindle description of an application that contains the items required for a sparse installation on a resource-limited edge host (such as a Raspberry Pi) and for a high-powered server in the heart of a public cloud. The Bindle client in the application host can take the elements and dependencies and deploy them appropriately. The result is an application-centric deployment model that avoids multiple builds by using repositories and smart descriptions to deliver the right code to the right environment.
Once you install Bindle, you can launch it, using the default settings to set up a local Bindle server ready to use Hippo. After that, I installed node.js, Using WSL Guidelines provided by Microsoft. This entailed using curl to download nvm, then running it to install the latest long-running support versions of node. Do not use Ubuntu’s instructions to install node; They use the snap to install it, and snapshots are not well supported in WSL2.
You’ll need to install Rust’s wasm32-wasi support for any Rust WebAssembly applications hosted on Hippo, as well as yo-wasm Yeoman’s application scaffolding tools. This will allow you to compile Rust code to a WASI target, ready to run inside Hippo.
With those, I can now NET 5 installationFirst, set up support for Microsoft Debian package repositories before installing the .NET 5 SDK and runtime. you have Two options for .NET runtimes: one with ASP.NET Core support and the other without. Since Hippo is a web application to control form rendering, you must use the ASP.NET runtime version.
Build and run a hippo
Once you have all the prerequisites installed, you can build Hippo. Start by cloning the Hippo GitHub repository to a local directory in your WSL system. Once installed, you can build and run the app, and point it to your local Bindle server by adding the BINDLE_URL environment variable. It’s a good idea to install Hippo’s CLI at this point, as it is essential for developing and deploying applications.
You can now connect to the Hippo server to test if it is working. You should find it on localhost on port 5001. If you’re running a recent version of WSL 2, you should be able to connect to it from your Windows desktop browser using localhost, as Microsoft has finally fixed one of those long-running WSL 2 networking problems, creating A proxy for virtual machine networks through Windows while keeping its own IP address and virtual network adapter. Scripts are no longer needed to extract and share network addresses.
Before you can connect to the server, you will need to register an account. Since it works locally, you can choose any account details you want; Just make sure it’s something you can remember because you’ll need the details to build your first app. Once you create an account, log in. You are taken to your Applications page with the Create New Application button.
Create your first Hippo WebAssembly app
Although you can create apps for Hippo from the web user interface, It is now easier to use the command line. Make sure you have Hippo CLI installedYeoman will use it to build application scaffolding for you. Before you begin, set the environment variables for the Hippo account and password as well as for its endpoints. Yes, this is not a good security practice, but here we are just building and running test code on an isolated computer using software that is not yet production ready.
To create a basic hello world application, use the yo-wasm tools to create a WebAssembly Rust application. If you follow the script and enter the appropriate values, it will generate the source code and upload it to the Hippo server. Next, use the Rust cargo tool to compile and test your WASI app. Once you have it running on the command line, you can use the Hippo CLI tool to push it into the Bindle where it will be visible inside the Hippo. Open the project, select your build development environment, and click on the link to run your code.
There is a lot to like about Hippo. If there’s one thing missing from WebAssembly, it’s a powerful Heroku-like playground to help you get started. Hippo may not be that playground yet, but it’s definitely one that you can use as part of your development workflow now, even in its early stage. Being able to run it on a developed PC is a plus, as there is no need to rely on third-party systems. It’s small enough to run as part of a WSL 2 environment, so you can take advantage of tools like Visual Studio Code, and work with remote development features to edit Rust code in WSL from Windows.
If you’re interested in WebAssembly, Hippo might be the tool you need to get started. It makes working with WebAssembly code simpler, as it brings many different pieces needed to run development in one place. While it’s clearly still an early release, there’s enough here to get you started, making it an essential tool for anyone working with WebAssembly.