[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guix "ops"
From: |
Ludovic Courtès |
Subject: |
Re: Guix "ops" |
Date: |
Fri, 22 May 2015 18:06:52 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
David Thompson <address@hidden> skribis:
> 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
Woow, that’s very nice. The declarations are straightforward and
immediately understandable, I think, which is cool.
Perhaps one addition eventually would be to allow IPs to be
automatically allocated and have host name lookup DTRT in each VM.
> 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.
As discussed on IRC, I was unsure about OpenStack, but I’ll trust your
judgment. Maybe Cyril can comment?
Thanks,
Ludo’.