diff --git a/default.nix b/default.nix index 7821287..cd07161 100644 --- a/default.nix +++ b/default.nix @@ -19,6 +19,6 @@ rec { exmap = pkgs.callPackage ./pkgs/exmap { }; urunc = pkgs.callPackage ./pkgs/urunc {}; bima = pkgs.callPackage ./pkgs/bima {}; - # some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { }; - # ... + vhive = pkgs.callPackage ./pkgs/vhive { }; + firecracker-containerd = pkgs.callPackage ./pkgs/firecracker-containerd { }; } diff --git a/pkgs/firecracker-containerd/default.nix b/pkgs/firecracker-containerd/default.nix new file mode 100644 index 0000000..c5bfc7b --- /dev/null +++ b/pkgs/firecracker-containerd/default.nix @@ -0,0 +1,38 @@ +{ lib, fetchFromGitHub, fetchurl, buildGoModule, stdenv }: + +buildGoModule rec { + pname = "firecracker-containerd"; + version = "0.1"; + src = fetchFromGitHub { + owner = "vhive-serverless"; + repo = "firecracker-containerd"; + rev = "3fae0bdd0f592581a2e0519fd6c307b8549569f8"; + hash = "sha256-e3b9e11PBCGXuQtsrO5deNYdiEZIRSPdsex3fn/b4nU="; + }; + + subPackages = [ + "firecracker-control/cmd/containerd" + "agent" + "runtime" + ]; + + postBuild = '' + set -x + CGO_ENABLED=0 buildGoDir install ./agent + set +x + ''; + + postInstall = '' + mv $out/bin/{runtime,containerd-shim-aws-firecracker} + ''; + + doCheck = false; + vendorHash = "sha256-IY3YMQMJrxUbKLoY+PJj6JwXd2BtC37vMQPyZlHhpBk="; + + meta = with lib; { + homepage = https://vhive-serverless.github.io/; + description = "firecracker-containerd enables containerd to manage containers as Firecracker microVMs"; + license = licenses.asl20; + broken = false; + }; +} diff --git a/pkgs/urunc/default.nix b/pkgs/urunc/default.nix index dde84da..3e9daee 100644 --- a/pkgs/urunc/default.nix +++ b/pkgs/urunc/default.nix @@ -1,16 +1,32 @@ -{ lib, fetchgit, buildGoModule }: +{ lib, fetchgit, fetchurl, buildGoModule, stdenv }: -buildGoModule rec { +#buildGoModule rec { +stdenv.mkDerivation rec { name = "urunc-${version}"; version = "0.2.0"; - src = fetchgit{ - url = "https://github.com/nubificus/urunc.git"; - rev = "b897d271d43185bdf9164bf570d16cbc1b2110df"; - hash = "sha256-ONHOcmQw5+ksqpMh3dcSkemPt32AGdrr3dCAiiYghh4="; - }; + srcs = [ + (fetchurl { + url = "https://github.com/nubificus/urunc/releases/download/v0.2.0/urunc_amd64"; + hash = "sha256-Bo34E7alpKREOAVRtmYdHbDB7PysYgTa0SejBSOIJ+c="; + }) + (fetchurl { + url = "https://github.com/nubificus/urunc/releases/download/v0.2.0/containerd-shim-urunc-v2_amd64"; + hash = "sha256-FCmEUQLLGTHYKvkQMf92cSypiAlUn3nPDHQL331XYzs="; + })]; + #src = fetchgit{ + # url = "https://github.com/nubificus/urunc.git"; + # rev = "b897d271d43185bdf9164bf570d16cbc1b2110df"; + # hash = "sha256-ONHOcmQw5+ksqpMh3dcSkemPt32AGdrr3dCAiiYghh4="; + #}; + + #doCheck = false; + #vendorHash = "sha256-yucUMVVmDmeR4k7UQ3RZuYV3Lg9YNT+jdt+k0dIcr9s="; - doCheck = false; - vendorHash = "sha256-yucUMVVmDmeR4k7UQ3RZuYV3Lg9YNT+jdt+k0dIcr9s="; + installPhase = '' + mkdir -p $out + cp urunc_amd64 $out/bin/urunc + cp containerd-shim-urunc-v2_amd64 $out/bin/containerd-shim-urunc-v2 + ''; meta = with lib; { homepage = https://github.com/nubificus/urunc; diff --git a/pkgs/vhive/default.nix b/pkgs/vhive/default.nix new file mode 100644 index 0000000..bc86548 --- /dev/null +++ b/pkgs/vhive/default.nix @@ -0,0 +1,37 @@ +{ lib, fetchFromGitHub, fetchurl, buildGoModule, stdenv }: + +buildGoModule rec { + pname = "vhive"; + version = "v" + "1.7.1"; + src = fetchFromGitHub { + owner = "vhive-serverless"; + repo = "vHive"; + rev = version; + hash = "sha256-8/REu4mSajZ+XUDTBSmt2Dj2xOaglRxoMRLSARqlaCo="; + }; + + preBuild = '' + export GOWORK=off + ''; + + excludedPackages = [ + "function-images/hello_gpu" + "function-images/tests/save_load_minio/client" + "function-images/tests/save_load_minio/proto_gen" + "function-images/tests/save_load_minio/server" + "power_manager" + "scripts" + ]; + + ldflags = [ "-w" ]; + doCheck = false; + vendorHash = "sha256-5HYB45D7zfrjduvMRXw2+N9ErUSY3uhjm0NYgzMNytU="; + #deleteVendor = true; + + meta = with lib; { + homepage = https://vhive-serverless.github.io/; + description = "Open-source framework for serverless experimentation "; + license = licenses.mit; + broken = false; + }; +}