Skip to content

nielsbergsma/nanovms-arm-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NanoVMs - Rust - ARM example

This repository contains the code accompanying the medium article found here.

In short, it demonstrates running NanoVM unikernel on Google Cloud T2A (arm) instances with Rust.

Install the dependencies

Rust compiler via Rustup

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Protobuf compiler (optional, for local testing)

# on Mac OS X
brew install protobuf
# or on Linux, APT-based distros
apt install protobuf-compiler

Rust cross-compile toolkit

cargo install cross --git https://github.com/cross-rs/cross

OPS from NanoVMs

curl https://ops.city/get.sh -sSfL | sh

Deploy instructions

Step 1. Cross-compile the project for Aarch64 (arm64) architecture

RUSTFLAGS='-C target-feature=+crt-static' cross build --release --target aarch64-unknown-linux-gnu

Step 2. Create the VM image on GCP

ops image create target/aarch64-unknown-linux-gnu/release/api -c deployment/config.json -i api-v1 -t gcp

Step 3. Create an VM instance on GCP with that VM image

ops instance create api-v1 -c deployment/config.json -t gcp 

The last step targets an instance group. Alternatively, if you wish to deploy just a single instance, and expose it directly with a public ip-address, do the following:

Remove RunConfig.InstanceGroup property from deployment/config.json and execute:

ops instance create api-v1 -c deployment/config.json p 80 -t gcp

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages