From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Thompson Subject: Re: Guix "ops" Date: Fri, 22 May 2015 10:59:39 -0400 Message-ID: <87382oejz8.fsf@fsf.org> References: <87k2wx6t1e.fsf@fsf.org> <87vbgdy6x8.fsf@gnu.org> <87fv7h5zhk.fsf@fsf.org> <87mw1obbfq.fsf@gnu.org> <87bnhzrjf1.fsf@gnusosa.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvoQR-0005Qq-Rd for guix-devel@gnu.org; Fri, 22 May 2015 10:59:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvoQQ-0004hH-LZ for guix-devel@gnu.org; Fri, 22 May 2015 10:59:51 -0400 Received: from mail.fsf.org ([208.118.235.13]:43668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvoQQ-0004h9-HV for guix-devel@gnu.org; Fri, 22 May 2015 10:59:50 -0400 In-Reply-To: <87bnhzrjf1.fsf@gnusosa.net> 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: Carlos Sosa , guix-devel@gnu.org Hello again Carlos, Carlos Sosa writes: > I like the idea of 'guix deploy', and maybe something to propagates > given configuration files, like 'guix config prepare' and later 'guix > config apply'. > > Now, how can I contribute? work the guix command? > > Let me know if you have a specific repository or place to find any work > done on this. I have just pushed a new branch called "wip-deploy" to the official guix repository. Since this branch is prefixed with "wip-", expect it to be rebased frequently. There's not much code here yet, but a very simple prototype has been implemented that supports the creation of local QEMU VMs. To take it for a spin, add something like this to a file, let's call it "deployment.scm": (use-modules (gnu) (guix gexp)) (use-service-modules databases) (use-package-modules web databases) (define dummy-fs (file-system (mount-point "/") (device "dummy") (type "dummy"))) (define grub (grub-configuration (device "/dev/sda"))) (define timezone "America/New_York") (define locale "en_US.UTF-8") ;; TODO: Needs nginx-service. (define web-server (machine (name "web-server") (system (operating-system (host-name "web-server") (timezone timezone) (locale locale) (bootloader grub) (file-systems (list dummy-fs %binary-format-file-system)) (packages (cons nginx %base-packages)))) (platform (local-vm #:ip-address "10.0.2.10")))) (define db-server (machine (name "db-server") (system (operating-system (host-name "db-server") (timezone timezone) (locale locale) (bootloader grub) (file-systems (list dummy-fs %binary-format-file-system)) (services (cons (postgresql-service) %base-services)) (packages (cons postgresql %base-packages)))) (platform (local-vm #:ip-address "10.0.2.11")))) (deployment (name "test-deployment") (machines (list web-server db-server))) Then run the following from your git checkout: ./pre-inst-env guix deploy spawn /path/to/deployment.scm One caveat: Make sure the file name uses an absolute path for now. I haven't cleaned up the code enough to deal with relative file names. If the command is successful, you will see 2 QEMU windows open up, one for the web server and one for the database server. Pretty neat, eh? :) Now, there's still much work to be done. Spawning local, temporary VMs has gotten me over some initial hurdles, but now we need to write a platform adapter for something more serious so that we can determine the requirements for "real world" deployment scenarios. Perhaps we should look into writing an OpenStack adapter. There's also unanswered questions like: How should we keep track of state? How do we reconfigure already deployed machines? How do we shut down a deployment and unprovision the resources it used? Basically, how many hooks does the record type need to cover everything? Thoughts and help very much wanted! -- David Thompson GPG Key: 0FF1D807