From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Guix "ops" Date: Thu, 30 Apr 2015 17:25:39 +0200 Message-ID: <87vbgdy6x8.fsf@gnu.org> References: <87k2wx6t1e.fsf@fsf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnqLU-0001aH-F9 for guix-devel@gnu.org; Thu, 30 Apr 2015 11:25:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnqLP-0007A5-GW for guix-devel@gnu.org; Thu, 30 Apr 2015 11:25:48 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnqLP-0007A0-7t for guix-devel@gnu.org; Thu, 30 Apr 2015 11:25:43 -0400 In-Reply-To: <87k2wx6t1e.fsf@fsf.org> (David Thompson's message of "Mon, 27 Apr 2015 19:38:37 -0400") 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+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: David Thompson Cc: guix-devel@gnu.org David Thompson skribis: > I'm writing this in an attempt to "think out loud" about a deployment > automation tool for GuixSD. Yay, good idea! > * The central data type is a "deployment", which is a Nix expression > consisting of one or more named OS configs >=20=20=20 > * The OS configs contain extra data that specifies the target platform: > VirtualBox, EC2, NixOS container, etc. Each platform implements the > generic MachineDefinition and MachineState interfaces. > > * The 'nixops' command is stateful. It stores necessary state about > deployed systems in a special directory ($HOME/.nixops by default), > such as the IP addresses of the deployed systems. Because of this, > each deployment needs a unique identifier. Oh, I remember =E2=80=9Ccharon create=E2=80=9D creating this =E2=80=98netwo= rk.json=E2=80=99 file containing the list of machines and the file names of the Nix expression used to create that deployment. I=E2=80=99m not 100% clear on why this state needs to be stored; it seems m= ore like a cache to me, no? That is, Charon/NixOps can always recreate it from the source Nix expressions. > * Deployments may be parameterized by values known only at deploy time. > This covers cases such as a web application server needing to know the > IP address of the database server. > > * There are useful subcommands to check the status of each system or ssh > into one of them. > > Here's a rough outline of how I'm thinking of implementing similar > features in Guix: > > * Introduce new data types: > > * : The generic interface type for implementing deployment > targets. Its fields hold procedures for various actions like > 'provision', 'destroy', 'boot', or 'reboot'. I haven't determined > the precise list of actions needed, but it will become apparent as > platforms are added. OK. > * : Describes a single system in the deployment. Contains a > name string, an , and a . Yes (it=E2=80=99s best to keep it separate from ; in NixO= ps it=E2=80=99s a =E2=80=98deployment=E2=80=99 attribute in the OS attribute s= et.) > * : Contains a name string and a list of and > procedures. Procedures in the list should accept an argument > containing the deployment results of the non-parameterized machines > and return a . OK. > * Use a simple s-exp deployment state format. Store the state in > $HOME/.config/guix by default. Or ~/.cache/guix? > * Implement a 'guix ops' subcommand roughly the same actions as NixOps: > create, deploy, start, stop, destroy, list, info, check, ssh, etc. > > * The bulk of the work will be creating objects that actually > provision various types of resources. For prototyping, a > 'local-vm-platform' would be enough to test that the whole system > works. Sure. > Anyone want to join in on this brainstorming party? Your thoughts are > appreciated! It seems you already have all the requirements and design options in mind! Thanks, Ludo=E2=80=99.