From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uCusGhykH2EyHQAAgWs5BA (envelope-from ) for ; Fri, 20 Aug 2021 14:46:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id +JV5FhykH2GzbgAA1q6Kng (envelope-from ) for ; Fri, 20 Aug 2021 12:46:20 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D40B8D4A1 for ; Fri, 20 Aug 2021 14:46:19 +0200 (CEST) Received: from localhost ([::1]:54020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mH3ub-000673-EM for larch@yhetil.org; Fri, 20 Aug 2021 08:46:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH3uO-00063m-BE for guix-patches@gnu.org; Fri, 20 Aug 2021 08:46:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49859) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mH3uN-0005wy-VL for guix-patches@gnu.org; Fri, 20 Aug 2021 08:46:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mH3uN-0002W3-Ti for guix-patches@gnu.org; Fri, 20 Aug 2021 08:46:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50133] [PATCH 5/6] gnu: Add lxd. Resent-From: Andrew Whatson Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 20 Aug 2021 12:46:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50133 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50133@debbugs.gnu.org Cc: Andrew Whatson Received: via spool by 50133-submit@debbugs.gnu.org id=B50133.16294635549613 (code B ref 50133); Fri, 20 Aug 2021 12:46:03 +0000 Received: (at 50133) by debbugs.gnu.org; 20 Aug 2021 12:45:54 +0000 Received: from localhost ([127.0.0.1]:33166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mH3uD-0002Uy-NZ for submit@debbugs.gnu.org; Fri, 20 Aug 2021 08:45:54 -0400 Received: from mail-pl1-f170.google.com ([209.85.214.170]:35689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mH3u9-0002UF-EO for 50133@debbugs.gnu.org; Fri, 20 Aug 2021 08:45:50 -0400 Received: by mail-pl1-f170.google.com with SMTP id b9so1513617plx.2 for <50133@debbugs.gnu.org>; Fri, 20 Aug 2021 05:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SSXJKEO3Tl7gZhQke8VjMVFbt3a5LU8kqnVXMuDd5Xs=; b=k8xhji/GhK8tL8vwcmY/Ltm3UHbbjeLfZGOFwFXbpTPUTAkeiMJtsVTlE5TNg7JJP5 oaH5I4ZcWb1a1k1xxSHpjzoQQ9ruuFRgrCL15VzukKzbdxk3hU98DZPcm/BBAsF7Mlii xvbyNQ5fVdM70AYyJMcsoErpJuXa782TmTvIclV9bP/0p/x0TOh6BcTCJ8SRUkKagw+S dX3LRMAZwhQarKq8k56kv9FVtFRGmr/yah4ebNXOxgHOZb9xqBpDvtcG8GkW6ONJfTDS ZmqJFI1Qi84X5NM0tRXUq3hB4NFDJBdBZjSNLR0v12e486f7SZZBhCmhgZ2EjuIs3uoG UH6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SSXJKEO3Tl7gZhQke8VjMVFbt3a5LU8kqnVXMuDd5Xs=; b=cWg61n4iVccqUTMSWkJyeQ7dUbj8KsqSvHHeU5ZJyJQIus+ffEWvR1Ld/qDLPQ+TOV iorgF2SHZEhYKX6pgOlYW6KzWDDhHLMXzWTblALuqBqklzlMGrDCMbTgUD/d+ce5ScWv qCjEX/I5Rq1P+aZ7egyyMSkTU2TJLQzquQmSFOzhKySwiviZx55G7oy08t3UQRoMNdCj zd8RBYw9AAKqcsUkte0LQ/WxZTl8G1ydxgkNDlM1t4wNVx1EnHa1TcItXDIt3pOMwk+K sXCsE8kJzyHN33hxAS58UArVn4pocbRF9TBAlrauiTrnUEJPeO109oEhdawOYnAt8a0i 4UIA== X-Gm-Message-State: AOAM53241LYYvrCeRUt7dmnjTBAc6OObPdTz6VS2PGHM65yO0I1oCLMp 3bBmAg0jHc7KxINKI8oB+c0CuCNwVmU= X-Google-Smtp-Source: ABdhPJzRXWrRNf2CLfBupidMkXYXcNhu3PZB2E7iXCvrUV3XorFpzqfptGP6hsHjh9qDu25Shc01LA== X-Received: by 2002:a17:90a:b284:: with SMTP id c4mr4519300pjr.213.1629463543496; Fri, 20 Aug 2021 05:45:43 -0700 (PDT) Received: from muon.fritz.box (220-235-208-141.tpgi.com.au. [220.235.208.141]) by smtp.gmail.com with ESMTPSA id o10sm5113868pfk.212.2021.08.20.05.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Aug 2021 05:45:43 -0700 (PDT) From: Andrew Whatson Date: Fri, 20 Aug 2021 22:45:23 +1000 Message-Id: <20210820124524.117090-5-whatson@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210820124524.117090-1-whatson@gmail.com> References: <20210820124524.117090-1-whatson@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1629463580; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=SSXJKEO3Tl7gZhQke8VjMVFbt3a5LU8kqnVXMuDd5Xs=; b=C+n1u/4pyo9iGtsDdUxxcKAdEJAqK65IqUNVIGJnTg29eOBdJLND2tmCPybc9hJpWR2vxp SdEo2IDRKajyum4x/hvuDdn2vdDc3Hn+KHIcy8zBI/hC1MM3aqHQ7kdpRql6Co0bPqZm9B xLZR9dYIDRoZGjMP7ioZ9nao56KkUHsyDFlTsSdV7FEXyRrRx1rTmK8+ZcfI/aL6WgdK3w lDYzgIxY63xNdZppXRhCbWs0Re/A7g0hwjuDKKz682r2i4O2qs+bqqujiL/GS51uKv2Iod K1NL6l6S1XGtuG3be36Dj8HSWyajq90cFoJDoEPo0XqRHep3prQlzBNeV51sPQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629463580; a=rsa-sha256; cv=none; b=qdkC8Vr6nJmWauYDfUJ826D0DktpTUEgKthBZ5owQe2CxpMQtarjk+iSK9chDJ2/XPuTxb CUDREGp27C99YPtucEmDSMnrmIOc43Xc6p5Cptv21VgHdUFsdLDLUWpI3f39IsboykYiYK loQkeJCF/U1zHbwhdrg8SOzVn57oPBktY5dZRxUPtSouFrbTjmVF7k7gmd0UXgE89ntFR2 BSLgns3hLduJSu2z1fk1KBFvqkBEyezhwG9KENC97Nl4abmH840E9z4BsCz5kR0yw3sDWO LpoMJ780j3pg47D4/WJ32vB7h2MBIuYDvPEz3hXNJ4Ar092BC3P7iUkL94QFsQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b="k8xhji/G"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -0.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b="k8xhji/G"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: D40B8D4A1 X-Spam-Score: -0.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: g4vZWRhtj/LM * gnu/packages/virtualization.scm (lxd): New variable. --- gnu/packages/virtualization.scm | 113 ++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 07ad1cb101..da130d1e9d 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -20,6 +20,7 @@ ;;; Copyright © 2021 Leo Famulari ;;; Copyright © 2021 Pierre Langlois ;;; Copyright © 2021 Dion Mendel +;;; Copyright © 2021 Andrew Whatson ;;; ;;; This file is part of GNU Guix. ;;; @@ -49,6 +50,7 @@ #:use-module (gnu packages bison) #:use-module (gnu packages build-tools) #:use-module (gnu packages check) + #:use-module (gnu packages cluster) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) #:use-module (gnu packages cross-base) @@ -102,6 +104,7 @@ #:use-module (gnu packages python-xyz) #:use-module (gnu packages pulseaudio) #:use-module (gnu packages readline) + #:use-module (gnu packages rsync) #:use-module (gnu packages selinux) #:use-module (gnu packages sdl) #:use-module (gnu packages sphinx) @@ -1070,6 +1073,116 @@ of making Linux containers feel more like a virtual machine. It started as a side project of LXC but can be used by any run-time.") (license license:lgpl2.1+))) +(define-public lxd + (package + (name "lxd") + (version "4.17") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/lxc/lxd/releases/download/" + "lxd-" version "/lxd-" version ".tar.gz")) + (sha256 + (base32 + "1kzmgyg5kw3zw9qa6jabld6rmb53b6yy69h7y9znsdlf74jllljl")))) + (build-system go-build-system) + (arguments + `(#:import-path "github.com/lxc/lxd" + #:tests? #f ;; tests fail due to missing /var, cgroups, etc. + #:modules ((guix build go-build-system) + (guix build union) + (guix build utils) + (srfi srfi-1)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'unpack-dist + (lambda* (#:key import-path #:allow-other-keys) + (with-directory-excursion (string-append "src/" import-path) + ;; remove the link back to the top level + (delete-file (string-append "_dist/src/" import-path)) + ;; move all the deps into the src directory + (copy-recursively "_dist/src" "../../..")) + #t)) + (replace 'build + (lambda* (#:key import-path #:allow-other-keys) + (with-directory-excursion (string-append "src/" import-path) + (invoke "make" "build" "CC=gcc" "TAG_SQLITE3=libsqlite3") + #t))) + (replace 'check + (lambda* (#:key tests? import-path #:allow-other-keys) + (when tests? + (with-directory-excursion (string-append "src/" import-path) + (invoke "make" "check" "CC=gcc" "TAG_SQLITE3=libsqlite3"))) + #t)) + (replace 'install + (lambda* (#:key inputs outputs import-path #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin-dir + (string-append out "/bin/")) + (doc-dir + (string-append out "/share/doc/lxd-" ,version)) + (completions-dir + (string-append out "/share/bash-completion/completions"))) + (with-directory-excursion (string-append "src/" import-path) + ;; wrap lxd with runtime dependencies + (wrap-program (string-append bin-dir "lxd") + `("PATH" ":" prefix + ,(fold (lambda (input paths) + (let* ((in (assoc-ref inputs input)) + (bin (string-append in "/bin")) + (sbin (string-append in "/sbin"))) + (append (filter file-exists? + (list bin sbin)) paths))) + '() + '("bash" "acl" "rsync" "tar" "xz" "btrfs-progs" + "gzip" "dnsmasq" "squashfs-tools" "iproute2" + "criu" "iptables")))) + ;; remove unwanted binaries + (for-each (lambda (prog) + (delete-file (string-append bin-dir prog))) + '("deps" "macaroon-identity" "generate")) + ;; install documentation + (for-each (lambda (file) + (install-file file doc-dir)) + (find-files "doc")) + ;; install bash completion + (rename-file "scripts/bash/lxd-client" "scripts/bash/lxd") + (install-file "scripts/bash/lxd" completions-dir))) + #t))))) + (native-inputs + `(;; test dependencies: + ;; ("go-github-com-rogpeppe-godeps" ,go-github-com-rogpeppe-godeps) + ;; ("go-github-com-tsenart-deadcode" ,go-github-com-tsenart-deadcode) + ;; ("go-golang-org-x-lint" ,go-golang-org-x-lint) + ("pkg-config" ,pkg-config))) + (inputs + `(("acl" ,acl) + ("eudev" ,eudev) + ("libdqlite" ,libdqlite) + ("libraft" ,libraft) + ("libcap" ,libcap) + ("lxc" ,lxc) + ;; runtime dependencies: + ("bash" ,bash-minimal) + ("rsync" ,rsync) + ("tar" ,tar) + ("xz" ,xz) + ("btrfs-progs" ,btrfs-progs) + ("gzip" ,gzip) + ("dnsmasq" ,dnsmasq) + ("squashfs-tools" ,squashfs-tools) + ("iproute2" ,iproute) + ("criu" ,criu) + ("iptables" ,iptables))) + (synopsis "Daemon based on liblxc offering a REST API to manage containers") + (home-page "https://linuxcontainers.org/lxd/") + (description "LXD is a next generation system container manager. It +offers a user experience similar to virtual machines but using Linux +containers instead. It's image based with pre-made images available for a +wide number of Linux distributions and is built around a very powerful, yet +pretty simple, REST API.") + (license license:asl2.0))) + (define-public libvirt (package (name "libvirt") -- 2.32.0