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.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# on Mac OS X
brew install protobuf
# or on Linux, APT-based distros
apt install protobuf-compiler
cargo install cross --git https://github.com/cross-rs/cross
curl https://ops.city/get.sh -sSfL | sh
RUSTFLAGS='-C target-feature=+crt-static' cross build --release --target aarch64-unknown-linux-gnu
ops image create target/aarch64-unknown-linux-gnu/release/api -c deployment/config.json -i api-v1 -t gcp
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