From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CI+YIDYXCWMxhAAAbAwnHQ (envelope-from ) for ; Fri, 26 Aug 2022 20:55:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id uBOMIDYXCWNJegEAauVa8A (envelope-from ) for ; Fri, 26 Aug 2022 20:55:50 +0200 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 5C137164A2 for ; Fri, 26 Aug 2022 20:55:50 +0200 (CEST) Received: from localhost ([::1]:35834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oReUf-0002uQ-Hx for larch@yhetil.org; Fri, 26 Aug 2022 14:55:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oReUT-0002uA-0l for guix-devel@gnu.org; Fri, 26 Aug 2022 14:55:37 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]:38207) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oReUR-0000wM-04 for guix-devel@gnu.org; Fri, 26 Aug 2022 14:55:36 -0400 Received: (Authenticated sender: mail@davie.li) by mail.gandi.net (Postfix) with ESMTPSA id D39241C0002; Fri, 26 Aug 2022 18:55:25 +0000 (UTC) References: <87v8qfe7yh.fsf@latte.josefsson.org> User-agent: mu4e 1.8.9; emacs 28.1 From: David Dashyan To: Simon Josefsson Cc: guix-devel@gnu.org Subject: Re: cloud-init? Date: Fri, 26 Aug 2022 17:29:04 +0200 In-reply-to: <87v8qfe7yh.fsf@latte.josefsson.org> Message-ID: <87edx2hm2c.fsf@davie.li> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2001:4b98:dc4:8::225; envelope-from=mail@davie.li; helo=relay5-d.mail.gandi.net X-Spam_score_int: -9 X-Spam_score: -1.0 X-Spam_bar: - X-Spam_report: (-1.0 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_03_06=1.592, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661540150; 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=uM6FqJt/Jv4uYknWU6SU5iQm7r0eLpycEuJBOok+Fso=; b=h5w3cd8nxGAYBPAcmqbHLRlu1B0xtED/TL9CQQJ442r4EeMFPTW81cEqvNda6Gk2UFHra0 j8Bt0b668yD5wfEgx0m3i3nYeaLE39upEiRUfwZXwF1fx+G2UTbmo1EETzRk7AU27U8K95 l0FK3Y2lmOWHWQaongxlWO5jzXcboqhD4mvFIubNFyLoKJUnfwcCo49zqASbdzbnWNJNxX PB9mUPqFO1rMrOpaui/vmeKG80FqvmZOmVqWWjykYehSqy+phpCFaoRMFY+DfK1aCrYYg5 holT/luxLIXyLkXz74Ju2pVjfr/dkYMF8UXNFg8nwiN6+6zQdMIefo2FZ7BPZw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661540150; a=rsa-sha256; cv=none; b=Ue9VyZkJaKW/a/2JMBSrhf524ghSVa3VRwGXq97CenMuaz6oIR6tif/cJQrMl17+FXnxIR JvfEEiMjddxIPbAM3VbHjeccIciDBQ8HM9BG1892//wCb2onAuziaPnNBi+G8n5pK90Oos Ela2Aoj+VJneI5wLEbhI4T2xm2V3sc79DP7+HuLuXGgP2i4R0YkejsPqKopG4ZTKkmEJGI z5bW25nops0pzMpFgaOtOmXlXgX0B6EFVt5cnp4SJHijtv/UczQAuvsx2GG91s4UrnuCv9 DhqwNsn85x3Lek/p1gU+NPOd2GvH9hhIjNDCD9ibXGH4YGNKwuiqoLAa2zI9PA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.71 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 5C137164A2 X-Spam-Score: -1.71 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5Hiac8AXdzSd Hi Simon! I've been interested in adding cloud-init support for a while already. It would make Guix much easier to use in a cloud setting. I did ask people weather anyone is interested in it couple of times in #guix and also mentioned it on the mailing list couple of times. People didn't seem to express much interest but once they have it they'll like it a lot I think :) It is common practice to spawn other distro type and turn it into Guix or install Guix on it and do "guix system init" on mounted volume and then swap them. Not to mention the fact that every now and then there is a new question on running Guix on some other vendor. Guix deploy was made exactly for that in mind, wasn't it? I hacked together a little module that provides "cloud-init" service that makes a query to DigitalOcean HTTP API hosted on link-local address and does some essential stuff like configure the network, add SSH key and resize partitions and filesystem. https://github.com/ipdb/bigchaindb-guix/blob/master/bigchaindb-guix/service= s/cloud-init.scm So as you see I went in a different direction - rather than integrating actual cloud-init package I just made a Guile substitute for it. I am not sure which approach is best though. There are many cloud vendors and they all have slightly different APIs. On the other side, my guess is that cloud-init (the real one) is designed specifically to work with systemd and Debian derived distributions. I am not sure which way is a bigger hassle =E2=80=94 to rew= rite it our-self or try and add Guix support to cloud-init. I doubt that cloud-init team would be interested in Guix support upstreaming either. I tend to think that adding Guix-style cloud-init service could still be easier in the end. APIs don't differ that much and are pretty stable, plus all investigation is already done by cloud-init team =E2=80=94 I didn't even read DigitalOcean docs when I wrote my module I just looked up what cloud-init does. But I'm interested in your opinion on it. Wait there is more on Guix cloud-init service. If you followed the code above, what it essentially does is it compiles a giant g-expression that does everything. As a result I borrowed some code from already existing Guix services. If cloud-init service was to do more it would mean even more duplication. But it is not how I wanted in a first place. It ended up like this because as I found out later that 1.) not all module are importable into a g-expression so I can't just import other Guix services procedures and reuse them 2.) you need to know all service-type arguments in advance (which not compatible with having idea of cloud-init at all :)). I think you can't spawn one service from another service either, you'll probably need to dig deeper and reach shepherd for that. But I am not sure about that. Someone mentioned "recursive derivations" that are not yet possible when I discussed that topic. But it would be cool if there was a way for Guix cloud-init service to query the environment compose and start other Guix services at startup. So-called "user-data" can be also used in interesting way too. There could be a "user-data" guile record that extends operating system somehow rather that bash-script. All in all I am glad I am not the only one interested in it. Cheers, --=20 David