Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"reflect"
)
type nestedFoo struct {
A int
B uint32
# kubeadm init --pod-network-cidr=10.244.0.0/16
# kubectl apply -f flannel.yaml
# git clone https://github.com/openfaas/faas-netes
# kubectl apply -f ./faas-netes/faas.yml,monitoring.yml,rbac.yml
# XXX: Warning: this file is auto-generated from file "config/configuration.toml.in".
[hypervisor.qemu]
path = "/usr/bin/qemu-lite-system-x86_64"
kernel = "/usr/share/clear-containers/vmlinuz.container"
image = "/usr/share/clear-containers/clear-containers.img"
machine_type = "pc"
# Optional space-separated list of options to pass to the guest kernel.
# For example, use `kernel_params = "vsyscall=emulate"` if you are having
# trouble running pre-2.15 glibc
root@k8s-vm:~# docker pull busybox
root@k8s-vm:~# docker export $(docker create busybox) > busybox.tar
root@k8s-vm:~# mkdir -p bundle/rootfs
root@k8s-vm:~# tar -xf busybox.tar -C bundle/rootfs/
root@k8s-vm:~# ls bundle/rootfs/
bin  dev  etc  home  lib  media  mnt  proc  root  run  sbin  srv  sys  tmp  usr  var
root@k8s-vm:~# cd bundle
root@k8s-vm:~/bundle# runc spec
root@k8s-vm:~/bundle# ls

Solo5 unikernel - NOOP payload

Test description

We build a solo5 unikernel (mirageOS based) with an empty payload:

#include "solo5.h"
#include "../../kernel/lib.c"

virtio is a kernel virtual bus. From drivers/virtio/virtio.c:

static struct bus_type virtio_bus = {
	.name  = "virtio",
	.match = virtio_dev_match,
	.dev_groups = virtio_dev_groups,
	.uevent = virtio_uevent,
	.probe = virtio_dev_probe,
	.remove = virtio_dev_remove,

Containerd runtimes

A runtime in containerd does not stand at the runc level, but at the platform one. There are separate Linux and Windows runtimes, and they register as plugins:

const (
	runtimeName    = "linux"
	configFilename = "config.json"

Q: vhost and kernel driver/device binding? Q: vhost virtqueue

~/devlp/crosvm/target/debug/crosvm stop /run/user/1000/crosvm.sock
rm -f /run/user/1000/crosvm.sock && cargo build && ./target/debug/crosvm run --disable-sandbox -s /run/user/1000/crosvm.sock  ~/devlp/kernels/nfc/arch/x86/boot/compressed/vmlinux.bin