From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mx9pF19GiGAWEgEAgWs5BA (envelope-from ) for ; Tue, 27 Apr 2021 19:14:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id BtjqEV9GiGCTBgAAB5/wlQ (envelope-from ) for ; Tue, 27 Apr 2021 17:14:07 +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 9A47C14E0A for ; Tue, 27 Apr 2021 19:14:06 +0200 (CEST) Received: from localhost ([::1]:55842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbRHh-0005qW-9a for larch@yhetil.org; Tue, 27 Apr 2021 13:14:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbRGN-0005cM-C5 for help-guix@gnu.org; Tue, 27 Apr 2021 13:12:43 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:37633) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbRGI-0007hR-CI for help-guix@gnu.org; Tue, 27 Apr 2021 13:12:43 -0400 X-Originating-IP: 185.213.154.168 Received: from neinpad (unknown [185.213.154.168]) (Authenticated sender: mail@davie.li) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 6AB4AFF807; Tue, 27 Apr 2021 17:12:31 +0000 (UTC) References: <87blajj0kh.fsf@davie.li> User-agent: mu4e 1.4.15; emacs 27.2 From: David Dashyan To: Maxime Devos Subject: Re: Bug? Importing (gnu rest ...) fails due to lack of patch files on build side. In-reply-to: Date: Tue, 27 Apr 2021 20:03:40 +0300 Message-ID: <87k0onoe1f.fsf@davie.li> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=217.70.183.199; envelope-from=mail@davie.li; helo=relay9-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Guix Help Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619543646; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=scbAHGUo/NmW/XIhS+2/FhNMjE3U3ACV4mZBnWblqTY=; b=bRZybQzGXpLyygX40Bx14AKACCT6Z+HHve9V81IqM1lqr5oHJsqU9Mp171CUNyIfJcqMeF eg17IXme1y07OBz+da4wbG8BSmb7JiJ512c8m6xLGhrib+Am5bly+vF3gzdM+zVLUC2iSo 1hXboTnmHrmXH9RQW6Sgg/8vuBA6McM3mJ+bp7UBTQxU5uC+8GxfaH4H2DhkQe8epTieBx UsxYfvvWAV4dAFgnfQ6CCj0EsAHZ6eSfptZMjRYovetaoo2MILWFxq8No/RDJivWtKxgxF BeO0QOpQAbFDUKKjLaddyOjHTZ9zf0E07HR4cdZGNLqT7IellYNT/fFlKflQ6A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619543646; a=rsa-sha256; cv=none; b=J5bd+Lzj+s3wv4YLfWknRSBiqk4LPflCYNvAriLpyIidefDXVhR2M0KHoZl/qtSvJTFuTj T2xX59GvvC8f2qhDCv2BmuDGG7IbZLQRTBieLaM9OGi7imHUBrzTH7jDhZfw+R2Y6E9qta PqjmRcL1rsnkRkG7W8AHNZ/b3emW2LJSNKNjXwq7SWSblgOOVlS3aCuTFTvY9pONCECtVB SOlizaFDRoel/8kr70Cqk4IVMQGMnFla+PWlUdEVkbYX3AETuegeTNlKvDPyAtY1qYAYO6 79AIb8t3KacFPkYiHuZw+AQjuQ4GomBEKLXPSv6nTMYYvskRNOV0EI6eCIiC0Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.45 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 9A47C14E0A X-Spam-Score: -2.45 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6gUI6R6E0DE9 Hello, Maxime! > No, it is not supposed to work! Only guix/build/... and > gnu/build/utils/... (and maybe others I forgot) are supposed to be > imported, so source-module-closure excludes other modules. The reason > is that gnu/packages/*.scm are supposed to be changeable without > causing any change in derivation hash (and therefore resulting in > rebuilds). Ah, great! I'm glad I got definitive answer to this question. But I don't get the last sentence. Changeable when? You mean that by including (gnu package ...) in inputs of a derivation change in gnu/package/*scm files will cause change of derivation hash? But why it is a problem for service derivations? As I understand it won't cause change in other package derivations hashes propagating down the graph. Service derivation sits on the leaf of dependency graph. Or I missing something? >> Some context to why am I doing it in the first place. I found this >> out while I was implementing "guix-cloud-init" service. > > Instead of importing (gnu packages ...), you could use > (with-extensions (list guix) ...), where guix is the guix package. > Then there's no need for with-imported-modules IIUC. That package > isn't always the newest though (it is primarily used for the > guix-daemon, for cuirass, emacs-guix and some others), so consider > using an inferior or something. Thanks! I'll try it. I havent thought of that. >> Some context to why am I doing it in the first place. I found this >> out while I was implementing "guix-cloud-init" service. The service >> to simplify guix deployment to digialocean, aws and others. >> Cloud-init is widely used way of configuring cloud vm instances and >> it works by providing metadata via mounted storage or link-local >> address http endpoint. This includes ip addresses, devices, ssh keys >> etc... So given you have a guix image with guix-cloud-init service >> you can upload to your cloud and it will "just work". :) > > Do you know about "guix deploy"? > Yes. I think ssh deploy is great, but I don't really like how digitalocean deployment works, particularly the idea of mutating debian instance by running big chunk of shell code and leaving all the debian stuff laying around. Especially when you have all the info needed for system configuration provided to you. I think creating with `guix system image`, uploading it to digitalocean/aws/etc and only then use `guix deploy` is much cleaner and robust way. There are also use cases when guix deploy just won't work. E.g. vm instance might be teleported to other location with other network, ssh keys, network devices. By using metadata services instance can automatically reconfigure itself after migration. example metadata structure: (define %test-metadata-json-string "{ \"droplet_id\": 213129999, \"hostname\": \"test-test\", \"vendor_data\": \"Content-Type: loadsof/randomstuff\" \"public_keys\": [ \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCUnbO+g3Gc8zaxCLfpVegABaCyrKQwq= 3l7D\ asMqcVXdFFdDkaR26RfZkS13T0XQuxeM+2o7HGwFebkts56vWe/FLDMdNjAvViNo8hlX6bUaR+I= PRf3\ KJSyy0aS7Ht7qtWHdDcuxtaDS8YebOw3GE9AG1P+nQMVRR12TesJnuq632gLdv/UlzIH32Qk7rM= R3/9\ oDIbO24kFx9dTU/5Mdj2b+GQzfstux3uLMvlNxztRLTqFNSwQcc09vMAS0WZUkB4trT/WlkoDka= /L46\ 7k5gA0KjHtIprnP73oKlMBLu7NFq+UANUqncUzGbb99XbXQDFQYRiDdYCMX6wrW8mRL+Cz\" ], \"auth_key\": \"d873f96dbd087d05a4c5490379a925b5\", \"region\": \"fra1\", \"interfaces\": { \"private\": [ { \"ipv4\": { \"ip_address\": \"10.114.0.2\", \"netmask\": \"255.255.240.0\", \"gateway\": \"0.0.0.0\" }, \"mac\": \"de:83:28:c9:fe:92\", \"type\": \"private\" } ], \"public\": [ { \"ipv4\": { \"ip_address\": \"207.188.191.111\", \"netmask\": \"255.255.240.0\", \"gateway\": \"207.155.240.1\" }, \"ipv6\": { \"ip_address\": \"2848:F0F:5171:2F45:58B5:3A88:6062:AB3F\", \"CIDR\": 64, \"gateway\": \"2A03:B0C0:0003:00D0:0000:0000:0000:0001\" }, \"anchor_ipv4\": { \"ip_address\": \"10.19.0.5\", \"netmask\": \"255.255.0.0\", \"gateway\": \"10.19.0.1\" }, \"mac\": \"12:BE:48:43:D9:0D\", \"type\": \"public\" } ] }, \"floating_ip\": { \"ipv4\": { \"active\": false } }, \"dns\": { \"nameservers\": [ \"67.207.67.2\", \"67.207.67.3\" ] }, \"tags\": [ \"some\", \"test\", \"tags\" ], \"features\": { \"dhcp_enabled\": false }, \"modify_index\": 88992338 }") It usually either provided on 169.244.169.244/metadata/v1.json lladdr endpoint and/or inside mounted /dev/vdb storage. Plus cloud-init is kind of standard nowadays. So it will provide integration with other "clouds" for free. >> So my thinking was that I will write shepherd-root-service extension >> that will query metadata import (gnu services ...) modules and run them >> with values gotten from metadata. > Not sure what you're trying to do there. =E2=80=98query metadata import= =E2=80=99 and > =E2=80=98run them with values from metadata=E2=80=99 is a bit vague. Sorry forgot the comma here. It should have been=20 >> "..will query metadata#{,}# import (gnu services ...) modules and..." >> To be honest it feels a bit hackish >> to me, but I didn't find any other ways to make such service and reuse >> existing code. >>=20 >> Comments are much appreciated! >>=20 >> P.S. Side note to macrologysts out there... >> If I embed select? into with-imported-modules form like so: >>=20 >> (with-imported-modules >> `(((guix config) =3D> ,(make-config.scm)) >> ,@(source-module-closure >> '((gnu packages base)) >> #:select? (match-lambda >> (('guix 'config) #f) >> (('guix rest ...) #t) >> (('gnu rest ...) #t) >> (_ #f)))) >> #~(pk 'hello)) > > I wonder what would happen if you replace #t with > (and (list rest ...) #t)?=20=20 Same result... --=20 David aka zzappie