From patchwork Mon Jun 10 21:08:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 14279 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 37DD01704B; Mon, 10 Jun 2019 22:10:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 5A3981704B for ; Mon, 10 Jun 2019 22:10:10 +0100 (BST) Received: from localhost ([::1]:49698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haRYO-0006Pu-Nr for patchwork@mira.cbaines.net; Mon, 10 Jun 2019 17:10:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56052) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haRYJ-0006Pl-Qc for guix-patches@gnu.org; Mon, 10 Jun 2019 17:10:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haRYI-0006F4-Hp for guix-patches@gnu.org; Mon, 10 Jun 2019 17:10:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43997) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1haRYI-0006Dl-9T for guix-patches@gnu.org; Mon, 10 Jun 2019 17:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1haRYI-0005UI-1G for guix-patches@gnu.org; Mon, 10 Jun 2019 17:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36162] [PATCH 0/4] Add 'remote-eval' Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 10 Jun 2019 21:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36162 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 36162@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.156020094720984 (code B ref -1); Mon, 10 Jun 2019 21:10:01 +0000 Received: (at submit) by debbugs.gnu.org; 10 Jun 2019 21:09:07 +0000 Received: from localhost ([127.0.0.1]:57540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1haRXP-0005SM-9y for submit@debbugs.gnu.org; Mon, 10 Jun 2019 17:09:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:45219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1haRXM-0005SC-72 for submit@debbugs.gnu.org; Mon, 10 Jun 2019 17:09:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55805) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haRXL-0006M9-4Z for guix-patches@gnu.org; Mon, 10 Jun 2019 17:09:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1haRXK-0005WP-KD; Mon, 10 Jun 2019 17:09:02 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59690 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1haRXJ-0006Aq-Kg; Mon, 10 Jun 2019 17:09:02 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 10 Jun 2019 23:08:53 +0200 Message-Id: <20190610210853.5709-1-ludo@gnu.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello Guix! This patch series add ‘remote-eval’, which takes a gexp, remotely deploys everything the gexp refers to, and evaluates it (see for the initial discussion.) So you can have gexps like: #~(execl #$(file-append ffmpeg "/bin/ffmpeg") …) When you evaluate it, this specific ‘ffmpeg’ will be deployed over there. Another example is: (with-imported-modules (source-module-closure '((gnu services herd))) #~(begin (use-modules (gnu services herd)) (map live-service-provision (current-services)))) This gexp, when evaluated remotely, will use your very own (gnu services herd) module and the corresponding Guile (so if you’re on Guile 3 and the remote is still on Guile 2, that’s fine: Guile 3 will first be deployed there.) ‘remote-eval’ allows you to build locally and send the build results, or to send the derivations and build remotely. The use case is for code that deals with state or has a side effect. Otherwise you’d just use a derivation and offload it. There are no tests for ‘remote-eval’ currently. It would need a VM with access to the store, as Jakob explained on guix-devel. Thoughts? Ludo’. Ludovic Courtès (4): gexp: Add 'lower-gexp' and express 'gexp->derivation' in terms of it. Add (guix repl). inferior: Add 'read-repl-response'. Add (guix remote). Makefile.am | 2 + guix/gexp.scm | 238 +++++++++++++++++++++++++++++++----------- guix/inferior.scm | 9 +- guix/remote.scm | 130 +++++++++++++++++++++++ guix/repl.scm | 86 +++++++++++++++ guix/scripts/repl.scm | 56 +--------- tests/gexp.scm | 37 +++++++ 7 files changed, 444 insertions(+), 114 deletions(-) create mode 100644 guix/remote.scm create mode 100644 guix/repl.scm