Skip to content

Instantly share code, notes, and snippets.

View samoht's full-sized avatar
💭
⛵️

Thomas Gazagnaire samoht

💭
⛵️
View GitHub Profile

Mirage Compilation Process

This document details the details of the compilation process for MirageOS unikernels. It outlines the steps required to prepare, compile, and manage dependencies for Mirage applications.

Overview of the Compilation Process

Developing a simple application with Mirage involves starting with two primary files:

  • config.ml: Contains the configuration of your unikernel.

A distributed, decentralized immutable block store for dune-cache

Objective

The aim of this project is to create a system to store data in the form of immutable, content addressable blocks that can be used as a backend for the dune-cache-daemon.

The envisioned characteristics are:

@samoht
samoht / config.ml
Created March 15, 2020 09:21
MirageOS + dune
open Mirage
let disk = generic_kv_ro "t"
let main = foreign "Unikernel.Main" (kv_ro @-> job)
let () = register ~reporter:Mirage.no_reporter "kv_ro" [ main $ disk ]
@samoht
samoht / digestif.cudf
Created September 3, 2018 11:27
digestif+opam
This file has been truncated, but you can view the full file.
# Solver: builtin-mccs+glpk
# Criteria: -removed,-count[version-lag,request],-count[version-lag,changed],-changed
preamble:
property: opam-query: int = [0], version-lag: nat = [0], pinned: bool = [false], installed-root: bool = [false], reinstall: bool = [false], opam-version: string, opam-name: string
package: fstar
version: 3
depends: ocaml >= 34 , ocamlfind , batteries , ocamlbuild , num
conflicts: fstar
version-lag: 5
@samoht
samoht / docker.log
Created February 1, 2017 18:17
don't panic
unexpected fault address 0x420580
fatal error: fault
[signal 0xb code=0x2 addr=0x420580 pc=0x7663ff]
goroutine 156126 [running]:
runtime.throw(0x1e1c070, 0x5)
/usr/local/go/src/runtime/panic.go:547 +0x90 fp=0xc82222fd58 sp=0xc82222fd40
runtime.sigpanic()
/usr/local/go/src/runtime/sigpanic_unix.go:27 +0x2ab fp=0xc82222fda8 sp=0xc82222fd58
encoding/json.(*decodeState).scanWhile(0x420568, 0x9, 0xc822372168)
@samoht
samoht / opam-bundle.md
Last active August 19, 2016 15:31
Managing development/deployment bundles

Bundles

OPAM can manage development and deployment bundles

Commands

Now that we have compiler-as-packages, switches can come empty by default. OPAM 2.0 adds a new mechanism to handle set of packages, called bundles.

Switch bundle

@samoht
samoht / opam-package.md
Last active August 19, 2016 14:28
opam package

Managing local packages

OPAM is able to manage local packages.

Commands

The opam package sub-command extracts and uses the fields of a local opam file as it is was a globally available package.

Documentation

@samoht
samoht / opam-sources.sh
Last active May 15, 2016 23:01
Gather the sources to build an opam project
#!/usr/bin/env bash
# Instructions. You need:
# - a working opam environment
# - an opam file in your current directory (to describe your project)
# - possibly some packages path-pinned in the current switch
#
# Run the scripts, and then check the contents of sources/
set -eu
@samoht
samoht / type_error.ml
Last active December 21, 2015 23:39
type error
module type S1 = sig
type t
end
module X = struct
type t = int
let f x = x
end
module type S2 = sig
@samoht
samoht / check_ocamlfind.ml
Last active December 21, 2015 18:19
Check that all the package correctly depend on ocamlfind
(* Run that file at the root of your repository:
ocamlbuild -pkg opam chek_ocamlfind.native --
This will rewrite all the OPAM files to add the missing ocamlfind dependency if needed.
*)
open OpamTypes
module N = OpamPackage.Name