unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Yarl Baudig <yarl-baudig@mailoo.org>
Cc: 59845@debbugs.gnu.org
Subject: [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System)
Date: Tue, 20 Dec 2022 16:13:13 +0100	[thread overview]
Message-ID: <87tu1q5cs6.fsf_-_@gnu.org> (raw)
In-Reply-To: <20221209115349.5821-4-yarl-baudig@mailoo.org> (Yarl Baudig's message of "Fri, 9 Dec 2022 12:53:49 +0100")

Yarl Baudig <yarl-baudig@mailoo.org> skribis:

> doc/guix.texi (System Configuration, Services): Add Integrated Library System Services section.
> doc/guix.texi (System Configuration, Services, Integrated Library System Services): Add PMB.

Neat!  Note that this should go in the same commit that adds the
service.

Likewise, we also expect system tests for each new service.  This should
also come in the same commit.  Here the system test would check that the
web server is up and running and that PMB correctly responds to basic
HTTP requests.  See ‘gnu/tests’ for example and do not hesitate to ask
on IRC if you have any questions.

> +@node Integrated Library System Services
> +@subsection Integrated Library System Services
> +
> +@cindex PMB Service
> +@subsubheading PMB Service
> +

Please add a couple of introductory sentences to give context.

> +@defvr {Scheme Variable} pmb-service-type
> +Service type for the @uref{https://www.sigb.net/,PMB} Integrated Library System.
> +The value for this service type is a @code{<pmb-configuration>} record.
> +
> +The PMB service needs a web server, @code{mariadb}/@code{mysql}, @code{php} and
> +is only responsible for copying and changing ownership of files from the
> +@code{pmb} package.
> +@end defvr
> +
> +Let's start with a demonstration. Here is a sample system configuration (@file{pmb.scm}):
> +
> +@lisp
> +(use-modules (gnu))
> +(use-service-modules ils web networking databases)
> +(use-package-modules databases)
> +
> +(operating-system
> +  (host-name "pmb")

I think we shouldn’t have to provide full OS declarations to illustrate
use of the service.  But as I wrote in a previous message, it we can
boil down configuration to (service pmb-service-type), then the example
will be much more concise.

> +We import the @code{mariadb} package so that we will have access to the program
> +@command{mysql}. This will be useful to set the password of the database's

Please leave two spaces after end-of-sentence periods (this gives a hint
to Texinfo and to Emacs).

> +Now let's run @command{guix system container -N pmb.scm} (@pxref{Invoking guix system}).
> +Run the resulting @file{/gnu/store/...run-container}.
> +Note that we want to keep the state of the database and the php files (because during
> +the application setup (see below), the php files will be slightly modified. That is also why
> +the PMB files need to be copied (and chowned) outside the store), we need to create
> +two folders, say @file{/mnt/data/pmb} and @file{/mnt/data/mysql} and pass @option{--share}
> +two times. @command{nsenter} into it to set the database's administrator password.
> +
> +@example
> +# mkdir /mnt/data/mysql /mnt/data/pmb
> +# /gnu/store/...run-container --share=/mnt/data/pmb=/srv/http/pmb \
> +--share=/mnt/data/mysql=/var/lib/mysql
> +# nsenter -a -t <replace-with-pid>
> +# mysql
> +> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('guixisgreat');
> +@end example

Neat.  We should clarify that this is in case one wants to run it in a
container (there’s no obligation; one might want to run it on the bare
metal).

WDYT?

Ludo’.




  reply	other threads:[~2022-12-20 15:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 21:48 [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) Yarl Baudig
2022-12-05 21:52 ` [bug#59845] [PATCH 1/4] gnu: php: Add '--enable-soap' configure option Yarl Baudig
2022-12-05 21:52   ` [bug#59845] [PATCH 2/4] gnu: Add PMB Yarl Baudig
2022-12-05 21:52   ` [bug#59845] [PATCH 3/4] gnu: Add PMB service Yarl Baudig
2022-12-05 21:52   ` [bug#59845] [PATCH 4/4] doc: Add Integrated Library System section Yarl Baudig
2022-12-09 11:52 ` [bug#59845] V2 yarl baudig
2022-12-09 11:53 ` [bug#59845] [PATCH v2 1/4] gnu: php: Add '--enable-soap' configure option Yarl Baudig
2022-12-09 11:53   ` [bug#59845] [PATCH v2 2/4] gnu: Add PMB Yarl Baudig
2022-12-20 14:56     ` [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) Ludovic Courtès
2022-12-09 11:53   ` [bug#59845] [PATCH v2 3/4] gnu: Add PMB service Yarl Baudig
2022-12-20 15:03     ` [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) Ludovic Courtès
2022-12-09 11:53   ` [bug#59845] [PATCH v2 4/4] doc: Add Integrated Library System section Yarl Baudig
2022-12-20 15:13     ` Ludovic Courtès [this message]
2022-12-22 17:18 ` [bug#59845] [PATCH 0/4] Add PMB (Integrated Library System) yarl baudig
2022-12-22 22:40   ` Ludovic Courtès
2022-12-23  8:17     ` yarl baudig
2022-12-25 17:26       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tu1q5cs6.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=59845@debbugs.gnu.org \
    --cc=yarl-baudig@mailoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).