From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 4sIiKinXEWAuRAAA0tVLHw (envelope-from ) for ; Wed, 27 Jan 2021 21:12:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id CBNlJSnXEWCyEgAAB5/wlQ (envelope-from ) for ; Wed, 27 Jan 2021 21:12:09 +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 CD92A9403E7 for ; Wed, 27 Jan 2021 21:12:08 +0000 (UTC) Received: from localhost ([::1]:41812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4s6h-00033D-9J for larch@yhetil.org; Wed, 27 Jan 2021 16:12:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4s5h-0002s5-Qq for guix-devel@gnu.org; Wed, 27 Jan 2021 16:11:05 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:39271) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4s5f-0007ZK-J0; Wed, 27 Jan 2021 16:11:05 -0500 Received: by mail-wm1-x334.google.com with SMTP id u14so2842342wmq.4; Wed, 27 Jan 2021 13:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=h9pWelzjrRwe1ELDjdIMsUwqX6IBSfqz1K/7oE4qPyY=; b=syRN5lArGgfLqil5LTWNgLm1Gi+rMmsCPEYXKVja+lzGAxMIfGktYRESzN46U8sbSg eFSnZjHs2Dig/11x4D3Yy1cgElLazpB1V/3h7EB8lBw/tJTpaas6RG+t+hDEwFJNoKmF 8GAuUCaNBswcvfK0CxmjPyO6QY73C3ujVKedng55nxnLy1d4yd5dPc7t19MZxosl+oP1 GuBcf5x7eNDv0XHDwMDDE1+LOg4uagMAzTgpR9AGxrX5HJknXhpNKnYvbKwpO4KRsu1H CR5CEJJFd3NInU/KZWLWu1xVzO2oxAOnj/i3M8hRwLRNCpBFSpKOovPDZsgA6H5aBehn j0xw== 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:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=h9pWelzjrRwe1ELDjdIMsUwqX6IBSfqz1K/7oE4qPyY=; b=AiuXxq9IWiQ6sjYxPBrQJRoZ9I5H1eQzh698rKf2raPy8Fv1+SW0ehcaq+1b7u17S3 f93Dl2Ldy+lFAZjUbMliw4CVkyTNvG/InWkO5SEyWR2RlTrv2FwUE4HnItt7Ind3tXkr 2j/78iLYeDP9QNAWKglgf4L9I5y2ogX+xJ8+67rvsWac41Z1dNaooKSvuZNkNnYyfMcq odbsx9EAkgbv3rr7K1jrjnUESKRuKdq4lyvAqUBNfLsrRDppCMg/Fga2UWPzklehBfW3 /xQwZWmV01rDhss6RpfPEvYzzub1SL43DAOrP+ATTxOLnD0pLkXvIzGgl1c4EU9DCo7U ePyg== X-Gm-Message-State: AOAM533rZBFCF/rqb7szW+jSTrJmMbOru7XFcTcjpnIBFc29jvPhmuZ3 G7EOA5yKvFMPPUklcNv5tSaqrAUa5mw= X-Google-Smtp-Source: ABdhPJy0nofYDlriN3PBTGN6CTbx4hxj1sdrV9iMOiZBng309cRFWs5OdKGiyewcTXMa9WzYkjmstg== X-Received: by 2002:a1c:730f:: with SMTP id d15mr5691776wmb.135.1611781860381; Wed, 27 Jan 2021 13:11:00 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id u142sm3795618wmu.3.2021.01.27.13.10.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 13:10:59 -0800 (PST) From: zimoun To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#45919] [PATCH 0/8] Exporting a manifest and channels from a profile References: <20210116182957.31075-1-ludo@gnu.org> <87wnvyv7w6.fsf@gnu.org> Date: Wed, 27 Jan 2021 22:02:53 +0100 In-Reply-To: <87wnvyv7w6.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Wed, 27 Jan 2021 14:14:49 +0100") Message-ID: <86bldahz42.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel , 45919@debbugs.gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.25 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=syRN5lAr; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: CD92A9403E7 X-Spam-Score: -1.25 X-Migadu-Scanner: scn1.migadu.com X-TUID: DbTLSUDjZjbf Hi Ludo, On Wed, 27 Jan 2021 at 14:14, Ludovic Court=C3=A8s wrote: > Ludovic Court=C3=A8s skribis: > >> Here=E2=80=99s a simple but oft-requested feature (I remember discussing >> with Pierre and Simon a year ago at the Guix Days about ways to >> implement it=E2=80=94time flies!): these patches provide =E2=80=98guix p= ackage >> --export-manifest=E2=80=99 and =E2=80=98--export-channels=E2=80=99. The= se options spit >> a manifest and a channel spec, respectively, with the goal of >> helping users who wish to migrate to the declarative model. > > I=E2=80=99m rather happy with this patch set but since this is something = we=E2=80=99ve > discussed several times in the past, I think it=E2=80=99d be great if tho= se > interested could chime in and comment: > > https://issues.guix.gnu.org/45919 > > I=E2=80=99ll leave a few more days and then=E2=80=A6 push! You are looking at me? :-) Well, the feature is nice! At first, I thought that it could be a bit smarter than using only one commit. But as you said, the aim is for transitioning. Maybe a future improvement should to list somewhere in the comments which commit provides which set of packages. It could help=E2=80=A6 or not. :-) Using Docker, it works. Let describe how in case people are interested. On machine A, I have: --8<---------------cut here---------------start------------->8--- $ guix describe -f channels (list (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (commit "cb68ae668af2ade4b0777d82f227e5462768e9e5") (introduction (make-channel-introduction "9edb3f66fd807b096b48283debdcddccfea34bad" (openpgp-fingerprint "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))) $ cat ~/.config/guix/manifests/python.scm (specifications->manifest (append '("python" ) (map (lambda (pkg) (string-append "python-" pkg)) '("ipython" "numpy" "matplotlib" "scipy" "biopython" )))) --8<---------------cut here---------------end--------------->8--- And I generate a Docker pack with: --8<---------------cut here---------------start------------->8--- $ guix pack -f docker --save-provenance -m ~/.config/guix/manifests/python.= scm /gnu/store/wxymmnxdvdvf08ifsfy39xjaxilhrigk-docker-pack.tar.gz --8<---------------cut here---------------end--------------->8--- Then on machine B, after fetching this tarball, I run: --8<---------------cut here---------------start------------->8--- $ docker load < /tmp/img/wxymmnxdvdvf08ifsfy39xjaxilhrigk-docker-pack.tar.gz $ docker images REPOSITORY TAG IMAGE ID = CREATED SIZE python-python-ipython-python-numpy latest 49ddfedf1e27 = 51 years ago 1.45GB --8<---------------cut here---------------end--------------->8--- And it works as expected: --8<---------------cut here---------------start------------->8--- $ docker run -ti python-python-ipython-python-numpy:latest python3 Python 3.8.2 (default, Jan 1 1970, 00:00:01) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! >>> import numpy as np >>> A =3D np.array([[1,0,1],[0,1,0],[0,0,1]]) >>> _, s, _ =3D np.linalg.svd(A); s; abs(s[0] - 1./s[2]) array([1.61803399, 1. , 0.61803399]) 0.0 >>> --8<---------------cut here---------------end--------------->8--- Neat! So far, so good. Well, let extract the =E2=80=99manifest=E2=80=99 from thi= s Docker blob. --8<---------------cut here---------------start------------->8--- $ docker export -o /tmp/img/re-pack.tar $(docker ps -a --format "{{.ID}}" |= head -n1) $ tar -xf /tmp/img/re-pack.tar $(tar -tf /tmp/img/re-pack.tar | grep 'profi= le/manifest') $ cat gnu/store/7frdchgf5sqw8b83azsml3lw0h52gfbk-profile/manifest | grep -E= "(\(\"python|cb68ae)" | head -n5 (("python" "cb68ae668af2ade4b0777d82f227e5462768e9e5") ("python-ipython" (("python-backcall" ("python-pyzmq" --8<---------------cut here---------------end--------------->8--- Now, a trick to get the channels and specifications: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix package -p /tmp/img/gnu/store/7frdchgf5sqw8b83azsml3l= w0h52gfbk-profile --export-channels ;; This channel file can be passed to 'guix pull -C' or to ;; 'guix time-machine -C' to obtain the Guix revision that was ;; used to populate this profile. (list (channel (name 'guix) (url "https://git.savannah.gnu.org/git/guix.git") (commit "cb68ae668af2ade4b0777d82f227e5462768e9e5") (introduction (make-channel-introduction "9edb3f66fd807b096b48283debdcddccfea34bad" (openpgp-fingerprint "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))) ) $ ./pre-inst-env guix package -p /tmp/img/gnu/store/7frdchgf5sqw8b83azsml3l= w0h52gfbk-profile --export-manifest $ ./pre-inst-env guix package -p /tmp/img/gnu/store/7frdchgf5sqw8b83azsml3l= w0h52gfbk-profile --export-manifest ;; This "manifest" file can be passed to 'guix package -m' to reproduce ;; the content of your profile. This is "symbolic": it only specifies ;; package names. To reproduce the exact same profile, you also need to ;; capture the channels being used, as returned by "guix describe". ;; See the "Replicating Guix" section in the manual. (specifications->manifest (list "python" "python-ipython" "python-numpy" "python-matplotlib" "python-scipy" "python-biopython")) --8<---------------cut here---------------end--------------->8--- Awesome! The unexpected is this channels and manifests files do not reproduce the same Docker pack tarball: --8<---------------cut here---------------start------------->8--- $ guix describe Generation 99 Jan 05 2021 16:56:39 (current) guix-past 829923f repository URL: https://gitlab.inria.fr/guix-hpc/guix-past branch: master commit: 829923f01f894f1e687735627025ada26230832f guix-bimsb a8b539d repository URL: https://github.com/BIMSBbioinfo/guix-bimsb branch: master commit: a8b539d61a359060c35f3cb34c7edd1d9d14241d bimsb-nonfree 4084e63 repository URL: https://github.com/BIMSBbioinfo/guix-bimsb-nonfree.git branch: master commit: 4084e63c9c0d662780870aded9f5a6ca1b063780 guix-science cf87b05 repository URL: https://github.com/guix-science/guix-science.git branch: master commit: cf87b0501c4a38b96edf41025a27bf1cb91f521a guix 957f0c4 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: 957f0c40327ce00f53db22737e3775ce616ac258 $ guix time-machine -C /tmp/img/channels.scm -- pack -f docker --save-prove= nance -m /tmp/img/manifest.scm Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.or= g/git/guix.git'... /gnu/store/xzk604g8gysv4azn7sf9nylr6iah97gl-docker-pack.tar.gz --8<---------------cut here---------------end--------------->8--- To compare with /gnu/store/wxymmnxdvdvf08ifsfy39xjaxilhrigk-docker-pack.tar.gz. On a third machine, I get: /gnu/store/wxymmnxdvdvf08ifsfy39xjaxilhrigk-docker-pack.tar.gz Well, that=E2=80=99s another story and I have not inspected yet the derivations and what could be wrong on the machine B. Cheers, simon