Subject: Re: [bug#43494] [PATCH 3/4] services: guix: Add guix-build-coordinator-agent-service-type.

From: Christopher Baines <[email-masked]>
Date: Sat, 19 Sep 2020 10:49:04 +0100

Ludovic Courtès <[email-masked]> writes:

> Christopher Baines <[email-masked]> skribis:
>
>> * gnu/services/guix.scm (<guix-build-coordinator-agent-configuration>): New
>> record type.
>> (guix-build-coordinator-agent-configuration,
>> guix-build-coordinator-agent-configuration?,
>> guix-build-coordinator-agent-configuration-package,
>> guix-build-coordinator-agent-configuration-user,
>> guix-build-coordinator-agent-configuration-coordinator,
>> guix-build-coordinator-agent-configuration-uuid),
>> guix-build-coordinator-agent-configuration-password,
>> guix-build-coordinator-agent-configuration-password-file,
>> guix-build-coordinator-agent-configuration-systems,
>> guix-build-coordinator-agent-configuration-max-parallel-builds,
>> guix-build-coordinator-agent-configuration-derivation-substitute-urls,
>> guix-build-coordinator-agent-configuration-non-derivation-substitute-urls,
>> guix-build-coordinator-agent-shepherd-services,
>> guix-build-coordinator-agent-activation,
>> guix-build-coordinator-agent-account): New procedures.
>> (guix-build-coordinator-agent-service-type): New variable.
>> * doc/guix.texi (Guix Services): Document it.
>
> [...]
>
>> +@defvar {Scheme Variable} guix-build-coordinator-agent-service-type
>> +Service type for a Guix Build Coordinator agent.  Its value must be a
>
> Perhaps “coordinator” and “agent” should be defined in a few sentences
> above to clarify what this is about.

I've added a bit more information, I want to at some point actually give
a workable minimal example configuration, but I need to do some more
thinking about that.

>> +@item @code{derivation-substitute-urls} (default: @code{1})
>> +URLs from which to attempt to fetch substitutes for derivations, if the
>> +derivations aren't already available.
>> +
>> +@item @code{non-derivation-substitute-urls} (default: @code{1})
>> +URLs from which to attempt to fetch substitutes for build inputs, if the
>> +input store items aren't already available.
>
> This is interesting, I wonder how you can distinguish between the two in
> code.  You have to open different sessions, right?  Or to call
> ‘set-build-options’ again?

Yeah, it's not strictly necessary to have some separation. In fact, I
can't remember exactly, but I think it should be possible to deploy the
coordinator and agents without explicit configuration of the substitute
URLs, but I need to check that.

These options were added mostly because it useful if you have two
seperate sources of substitutes, one for just derivations (say an
instance of the Guix Data Service), and one just for build outputs (say
populated by one of the hooks) [1].

1: https://git.cbaines.net/guix/build-coordinator/commit/?id=bda7d58853ed4fba976cac92a70c4dc68db263aa

>> +   (description
>> +    "Run an instance of the Guix Build Coordinator.")))
>
> + “agent”
>
> Otherwise LGTM!

Thanks!