This is a public snapshot of Fly's init code. It powers every Firecracker microvm we run for our users.

Overview

Fly Init

This is a public snapshot of Fly's init code. It powers every Firecracker microvm we run for our users.

It is Rust-based and we thought making it public (even in this very limited fashion) could help as a reference for people making Rust-based init programs.

Usage

Please note that our init is tailored for firecracker microvms. These instructions might not quite work and differ from what we do in production.

  • Build with cargo build --release
  • Create a device for the init
fallocate -l 64M tmpinit
mkfs.ext2 tmpinit
mkdir initmount
mount -o loop,noatime tmpinit initmount
mkdir initmount/fly
cp target/x86_64-unknown-linux-musl/release/init initmount/fly/init
cp run.json initmount/fly/run.json # more on this later
umount initmount
  • Attach this device as /dev/vda
  • Attach your rootfs as /dev/vdb
  • Attach a vsock virtio device

initrd

This init should also work packaged as an initrd. However, we're not running it as such at the time of this writing.

mkdir -p tmpcpio/fly
cp target/x86_64-unknown-linux-musl/release/init tmpcpio/fly/init
cp run.json tmpcpio/fly/run.json
cd tmpcpio
ls | cpio --null --create -V --format=newc -O ../initrd.cpio

You can then use initrd.cpio as your initrd parameter.

/fly/run.json

To configure out init, we're injecting a JSON file into the root device.

You should be able to figure out the format by looking at lib.rs

You might also like...
Yellhole is a lightweight tumblelog which can run on e.g. fly.io for cheap.

Yellhole A Hole To Yell In Yellhole is a lightweight tumblelog which can run on e.g. fly.io for cheap. Features Runs on a single node. Use a CDN if yo

Run LLaMA inference on CPU, with Rust ๐Ÿฆ€๐Ÿš€๐Ÿฆ™
Run LLaMA inference on CPU, with Rust ๐Ÿฆ€๐Ÿš€๐Ÿฆ™

LLaMA-rs Do the LLaMA thing, but now in Rust ๐Ÿฆ€ ๐Ÿš€ ๐Ÿฆ™ Image by @darthdeus, using Stable Diffusion LLaMA-rs is a Rust port of the llama.cpp project. Th

Run LLaMA inference on CPU, with Rust ๐Ÿฆ€๐Ÿš€๐Ÿฆ™
Run LLaMA inference on CPU, with Rust ๐Ÿฆ€๐Ÿš€๐Ÿฆ™

LLaMA-rs Do the LLaMA thing, but now in Rust ๐Ÿฆ€ ๐Ÿš€ ๐Ÿฆ™ Image by @darthdeus, using Stable Diffusion LLaMA-rs is a Rust port of the llama.cpp project. Th

unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

unflow ๆ˜ฏไธ€ไธชไฝŽไปฃ็ ใ€ๆ— ไปฃ็ ่ฎพ่ฎก่ฏญ่จ€ใ€‚unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

A CLI tool to convet Hex color code or RGB to color code, RGB, HSL and color name(if exists)
A CLI tool to convet Hex color code or RGB to color code, RGB, HSL and color name(if exists)

iro -่‰ฒ- A CLI tool to convert the hex color code or RGB to color code, RGB, HSL, color name(if exists, according to jonathantneal/color-names). Usage

Rust ABI safe code generator

CGlue offers an easy way to ABI (application binary interface) safety. Just a few annotations and your trait is ready to go!

Source code for the Telegram channel @pixiv_daily
Source code for the Telegram channel @pixiv_daily

PixivDaily (Rust) This repository contains the source code of the program running the Telegram channel @pixiv_daily. Usage First, you'll need to clone

A boiler plate code to create dynamic link library in rust.

๐Ÿ”ญ rust-dll-bp This is a boiler plate code that will be generated as a dll binary. I personally cache this here for me but if you're intend to create

ttasm is an assembler for assembling source code to TTVM executable.

ttasm is an assembler for assembling source code to TTVM executable.

Owner
fly.io
fly.io
A realtime flight tracking program for our Software Engineering 300 class at ERAU

Flight Tracking ERAU SE300 Description Software that allows for weather and plane tracking to facilitate the user in looking at plane paths. Many peop

null 18 Sep 29, 2022
Fixing Discord shortcomings (for our internal server) with Chuckle

About Chuckle is our in-house Discord bot for our internal company server. We weren't a huge fan of Slack and, most of our target demographic uses Dis

Truffle 17 Aug 18, 2023
Asset-Pool is a decentralized lending protocol and enables users to lend through their social networks

Run If you need to, set up your Substrate development environment . Then, build and run a development chain: $ cargo run -- --dev --tmp Once the node

antimatter-repo 11 Oct 22, 2022
A library to access BGPKIT Broker API and enable searching for BGP data archive files over time from public available data sources.

BGPKIT Broker BGPKIT Broker is a online data API service that allows users to search for publicly available BGP archive files by time, collector, proj

BGPKIT 10 Nov 30, 2022
Single-operator public liveness notification

Single-operator public liveness notification

Charlotte Som 1 Feb 16, 2022
Telegram bot help you to run Rust code in Telegram via Rust playground

RPG_BOT (Rust Playground Bot) Telegram bot help you to run Rust code in Telegram via Rust playground Bot interface The bot supports 3 straightforward

TheAwiteb 8 Dec 6, 2022
Buildomat manages the provisioning of ephemeral UNIX systems on which to run software builds

B U I L D O M A T a software build labour-saving device Buildomat manages the provisioning of ephemeral UNIX systems (e.g., instances in AWS EC2) on w

Oxide Computer Company 33 Dec 4, 2022
TAT agent is an agent written in Rust, which run in CVM or Lighthouse instances.

TAT agent is an agent written in Rust, which run in CVM, Lighthouse or CPM 2.0 instances. Its role is to run commands remotely without ssh login, invoked from TencentCloud Console/API. Commands include but not limited to: Shell, PowerShell, Python. TAT stands for TencentCloud Automation Tools. See more info at https://cloud.tencent.com/product/tat.

Tencent 97 Dec 21, 2022
Damavand is a quantum circuit simulator. It can run on laptops or High Performance Computing architectures, such CPU distributed architectures or multi GPU distributed architectures.

Damavand is a quantum circuit simulator. It can run on laptops or High Performance Computing architectures, such CPU distributed architectures or multi GPU distributed architectures.

MichelNowak 0 Mar 29, 2022
Rust Keeper bots that run various functions, from liquidations, to orderbook cranks, and more.

The zo-keeper (pronounced "zoo keeper") repository runs large scale instructions that secure the 01 network, and allow it to operate in a fully decentralized manner.

Zero One Global Foundation 61 Dec 16, 2022