From 22b727dbfcdd074baf0b5a4109d21d14fb8ffde4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laure=CE=B7t?= Date: Sun, 17 Dec 2023 16:46:03 +0100 Subject: [PATCH] nixify --- .gitignore | 1 + flake.lock | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 34 +++++++++++++++++++++++++++++ slides.md | 3 +-- 4 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..af9faf5 --- /dev/null +++ b/flake.lock @@ -0,0 +1,64 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1702312524, + "narHash": "sha256-gkZJRDBUCpTPBvQk25G0B7vfbpEYM5s5OZqghkjZsnE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a9bf124c46ef298113270b1f84a164865987a91c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1701253981, + "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b666502 --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + }; + + outputs = inputs@{ nixpkgs, flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" "aarch64-linux" ]; + + perSystem = { pkgs, system, ... }: { + devShells.default = pkgs.mkShell { packages = with pkgs; [ marp-cli ]; }; + + packages.slides = pkgs.stdenvNoCC.mkDerivation { + name = "slides"; + + src = ./.; + dontUnpack = true; + buildInputs = with pkgs; [ marp-cli ]; + + buildPhase = '' + marp --html $src/slides.md --allow-local-files -o slides.html + ''; + + installPhase = '' + mkdir -p $out + cp -r $src/figs $out/figs + cp slides.html $out/index.html + ''; + }; + }; + }; +} + diff --git a/slides.md b/slides.md index 7bcf736..39ee850 100644 --- a/slides.md +++ b/slides.md @@ -268,7 +268,7 @@ RPC = Remote Procedure Call - Sûreté: autoriser au maximum un gagnant par mandat - Chaque serveur ne donne qu'un seul vote par mandat (persistant sur disque) - Majorité requise pour gagner l'élection - ![](figs/election-correctness.png) + ![width:20em](figs/election-correctness.png) - Vivacité: un candidat doit finir par gagner - Délais d'expiration des élections aléatoire dans $[T, 2T]$ (e.g. 150-300 ms) - Le serveur gagne l'élection en dépassant le délai d'attente avant les autres @@ -441,7 +441,6 @@ Normal Operation: | hashicorp/raft | Armon Dadgar (hashicorp) | Go | MPL-2.0 | | copycat | Jordan Halterman | Java | Apache2 | | LogCabin | Diego Ongaro (Stanford, Scale Computing) | C++ | ISC | -| akka-raft | Konrad Malawski | Scala | Apache2 | | kanaka/raft.js | Joel Martin | Javascript | MPL-2.0 |