GNU bug report logs - #44900
[PATCH] services: unattended-upgrade: Add 'search-paths' field.

Previous Next

Package: guix-patches;

Reported by: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>

Date: Fri, 27 Nov 2020 08:47:01 UTC

Severity: normal

Tags: patch, wontfix

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 44900 in the body.
You can then email your comments to 44900 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#44900; Package guix-patches. (Fri, 27 Nov 2020 08:47:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lars-Dominik Braun <ldb <at> leibniz-psychology.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 27 Nov 2020 08:47:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
To: guix-patches <at> gnu.org
Subject: [PATCH] services: unattended-upgrade: Add 'search-paths' field.
Date: Fri, 27 Nov 2020 09:46:32 +0100
[Message part 1 (text/plain, inline)]
Hi,

I’m using a modular machine configuration, i.e. the scheme file returning the
operating system definition imports several other custom modules with service
definitions etc in the same directory. This does not work well with unattended
upgrades. The attached patch allows adding search paths to the unattended
upgrade service. I’m not sure this is the best solution though. Maybe the
preferred way to add these modules is to a custom channel?

The second patch changes the default channels to #f, i.e. the system default
(/etc/guix/channels.scm), which feels more natural to me.

Cheers,
Lars

-- 
Lars-Dominik Braun
Wissenschaftlicher Mitarbeiter/Research Associate

www.leibniz-psychology.org
ZPID - Leibniz-Institut für Psychologie /
ZPID - Leibniz Institute for Psychology
Universitätsring 15
D-54296 Trier - Germany
Tel.: +49–651–201-4964
[0001-services-unattended-upgrade-Add-search-paths-field.patch (text/x-diff, attachment)]
[0002-services-unattended-upgrade-Change-default-for-chann.patch (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#44900; Package guix-patches. (Sat, 28 Nov 2020 10:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 44900 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
Cc: 44900 <at> debbugs.gnu.org
Subject: Re: [bug#44900] [PATCH] services: unattended-upgrade: Add
 'search-paths' field.
Date: Sat, 28 Nov 2020 11:33:55 +0100
Hi,

Lars-Dominik Braun <ldb <at> leibniz-psychology.org> skribis:

> I’m using a modular machine configuration, i.e. the scheme file returning the
> operating system definition imports several other custom modules with service
> definitions etc in the same directory. This does not work well with unattended
> upgrades. The attached patch allows adding search paths to the unattended
> upgrade service. I’m not sure this is the best solution though. Maybe the
> preferred way to add these modules is to a custom channel?

Did you see (info "(guix) Unattended Upgrades"):

          There are cases, though, where referring to
          ‘/run/current-system/configuration.scm’ is not enough, for
          instance because that file refers to extra files (SSH public
          keys, extra configuration files, etc.)  via ‘local-file’ and
          similar constructs.  For those cases, we recommend something
          along these lines:

               (unattended-upgrade-configuration
                 (operating-system-file
                   (file-append (local-file "." "config-dir" #:recursive? #t)
                                "/config.scm")))

          The effect here is to import all of the current directory into
          the store, and to refer to ‘config.scm’ within that directory.
          Therefore, uses of ‘local-file’ within ‘config.scm’ will work
          as expected.  *Note G-Expressions::, for information about
          ‘local-file’ and ‘file-append’.

I can see several options:

  1. Use the trick above and add (say):

       (add-to-load-path (dirname (current-filename)))

     in your config file.  Not pretty.

  2. Turn your modules into a channel.  Nice because there’s no need for
     a special case, modules are automatically updated at each upgrade,
     etc., but OTOH requires more paperwork.

  3. What you propose.  Easy to use but a bit low-level and users could
     be tempted to pass local file names instead of using ‘local-file’,
     in which case the process becomes more brittle (depends on things
     outside the store).

> The second patch changes the default channels to #f, i.e. the system default
> (/etc/guix/channels.scm), which feels more natural to me.

I prefer being explicit here and keep ‘unattended-upgrade-configuration’
self-contained (/etc/guix/channels.scm could be modified behind our
back).

WDYT?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#44900; Package guix-patches. (Mon, 30 Nov 2020 08:19:01 GMT) Full text and rfc822 format available.

Message #11 received at 44900 <at> debbugs.gnu.org (full text, mbox):

From: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 44900 <at> debbugs.gnu.org
Subject: Re: [bug#44900] [PATCH] services: unattended-upgrade: Add
 'search-paths' field.
Date: Mon, 30 Nov 2020 09:18:42 +0100
[Message part 1 (text/plain, inline)]
Hi Ludo,

> Did you see (info "(guix) Unattended Upgrades"):
>   1. Use the trick above and add (say):
> 
>        (add-to-load-path (dirname (current-filename)))
> 
>      in your config file.  Not pretty.
yes, saw it, but I wasn’t sure how to load modules from that directory. And I
agree, it’s not pretty, but probably better than option 3, because everything
is in the store.

>   2. Turn your modules into a channel.  Nice because there’s no need for
>      a special case, modules are automatically updated at each upgrade,
>      etc., but OTOH requires more paperwork.
I feel this might be the best option and I’ll give it a try.

> I prefer being explicit here and keep ‘unattended-upgrade-configuration’
> self-contained (/etc/guix/channels.scm could be modified behind our
> back).
Okay, I can see that, but I’d like to use the same list of channels in that
service and channels.scm. Since creating an etc-service for
/etc/guix/channels.scm does not work, I was left with the other option, i.e.
using that file for unattended upgrades. Are there any other options?

Cheers,
Lars

-- 
Lars-Dominik Braun
Wissenschaftlicher Mitarbeiter/Research Associate

www.leibniz-psychology.org
ZPID - Leibniz-Institut für Psychologie /
ZPID - Leibniz Institute for Psychology
Universitätsring 15
D-54296 Trier - Germany
Tel.: +49–651–201-4964
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#44900; Package guix-patches. (Mon, 30 Nov 2020 13:55:01 GMT) Full text and rfc822 format available.

Message #14 received at 44900 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
Cc: 44900 <at> debbugs.gnu.org
Subject: Re: [bug#44900] [PATCH] services: unattended-upgrade: Add
 'search-paths' field.
Date: Mon, 30 Nov 2020 14:54:42 +0100
Hi!

Lars-Dominik Braun <ldb <at> leibniz-psychology.org> skribis:

>> I prefer being explicit here and keep ‘unattended-upgrade-configuration’
>> self-contained (/etc/guix/channels.scm could be modified behind our
>> back).
> Okay, I can see that, but I’d like to use the same list of channels in that
> service and channels.scm. Since creating an etc-service for
> /etc/guix/channels.scm does not work, I was left with the other option, i.e.
> using that file for unattended upgrades. Are there any other options?

I’d say that specifying the ‘channels’ field of
‘unattended-upgrade-configuration’ gives you that, no?

Also, what doesn’t it work to populate /etc/guix/channels.scm via
‘etc-service-type’?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#44900; Package guix-patches. (Thu, 03 Dec 2020 08:37:02 GMT) Full text and rfc822 format available.

Message #17 received at 44900 <at> debbugs.gnu.org (full text, mbox):

From: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 44900 <at> debbugs.gnu.org
Subject: Re: [bug#44900] [PATCH] services: unattended-upgrade: Add
 'search-paths' field.
Date: Thu, 3 Dec 2020 09:36:46 +0100
[Message part 1 (text/plain, inline)]
Hi,

> > Okay, I can see that, but I’d like to use the same list of channels in that
> > service and channels.scm. Since creating an etc-service for
> > /etc/guix/channels.scm does not work, I was left with the other option, i.e.
> > using that file for unattended upgrades. Are there any other options?
> I’d say that specifying the ‘channels’ field of
> ‘unattended-upgrade-configuration’ gives you that, no?
no, /etc/guix/channels.scm also functions as a default channel list for every
users’ `guix pull`, which I also want to have.

> Also, what doesn’t it work to populate /etc/guix/channels.scm via
> ‘etc-service-type’?
This snippet:

---snip---
(simple-service 'guix-channels etc-service-type
   (list `("guix/channels.scm" , (scheme-file "channels.scm" %guix-channels))))
---snap---

Causes this error when reconfiguring:

---snip---
activating system...
The following derivation will be built:
   /gnu/store/qqp3vz7r6i6fa7wckzdxs1613gvww4b6-switch-to-system.scm.drv

building /gnu/store/qqp3vz7r6i6fa7wckzdxs1613gvww4b6-switch-to-system.scm.drv...
making '/gnu/store/ykfn25vpvgmjkq4l8xygs7fwabgkgp2s-system' the current system...
setting up setuid programs in '/run/setuid-programs'...
populating /etc from /gnu/store/mdpbph8cpgwydy3hwfq0q6sk44bfbk93-etc...
guix system: error: symlink: File exists: "/etc/guix"
---snap---

/gnu/store/mdpbph8cpgwydy3hwfq0q6sk44bfbk93-etc looks correct to me, i.e. it
has a guix subdirectory with a correct channels.scm file in it.

Cheers,
Lars

-- 
Lars-Dominik Braun
Wissenschaftlicher Mitarbeiter/Research Associate

www.leibniz-psychology.org
ZPID - Leibniz-Institut für Psychologie /
ZPID - Leibniz Institute for Psychology
Universitätsring 15
D-54296 Trier - Germany
Tel.: +49–651–201-4964
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#44900; Package guix-patches. (Mon, 07 Dec 2020 21:00:02 GMT) Full text and rfc822 format available.

Message #20 received at 44900 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
Cc: 44900 <at> debbugs.gnu.org
Subject: Re: [bug#44900] [PATCH] services: unattended-upgrade: Add
 'search-paths' field.
Date: Mon, 07 Dec 2020 21:58:47 +0100
Hi,

Lars-Dominik Braun <ldb <at> leibniz-psychology.org> skribis:

> This snippet:
>
> ---snip---
> (simple-service 'guix-channels etc-service-type
>    (list `("guix/channels.scm" , (scheme-file "channels.scm" %guix-channels))))
> ---snap---
>
> Causes this error when reconfiguring:
>
> ---snip---
> activating system...
> The following derivation will be built:
>    /gnu/store/qqp3vz7r6i6fa7wckzdxs1613gvww4b6-switch-to-system.scm.drv
>
> building /gnu/store/qqp3vz7r6i6fa7wckzdxs1613gvww4b6-switch-to-system.scm.drv...
> making '/gnu/store/ykfn25vpvgmjkq4l8xygs7fwabgkgp2s-system' the current system...
> setting up setuid programs in '/run/setuid-programs'...
> populating /etc from /gnu/store/mdpbph8cpgwydy3hwfq0q6sk44bfbk93-etc...
> guix system: error: symlink: File exists: "/etc/guix"
> ---snap---
>
> /gnu/store/mdpbph8cpgwydy3hwfq0q6sk44bfbk93-etc looks correct to me, i.e. it
> has a guix subdirectory with a correct channels.scm file in it.

Yes, somebody else reported that problem recently (and proposed a
solution I think, was it on guix-devel?).  The issue here is that
/etc/guix is also partly stateful, so there’s ‘activation-service-type’,
‘etc-service-type’, and manual changes say to /etc/guix/machines.scm,
are conflicting.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#44900; Package guix-patches. (Tue, 15 Dec 2020 08:18:01 GMT) Full text and rfc822 format available.

Message #23 received at 44900 <at> debbugs.gnu.org (full text, mbox):

From: Lars-Dominik Braun <ldb <at> leibniz-psychology.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 44900 <at> debbugs.gnu.org
Subject: Re: [bug#44900] [PATCH] services: unattended-upgrade: Add
 'search-paths' field.
Date: Tue, 15 Dec 2020 09:17:13 +0100
[Message part 1 (text/plain, inline)]
Hi,

> >   2. Turn your modules into a channel.  Nice because there’s no need for
> >      a special case, modules are automatically updated at each upgrade,
> >      etc., but OTOH requires more paperwork.
> I feel this might be the best option and I’ll give it a try.
I’ve implemented this now and it is indeed a very good solution. For anyone
stumbling on this issue, I’m using the following service configuration:

---snip---
(unattended-upgrade-configuration
(channels #~(cons* (channel
					(name 'psychnotebook-deploy)
					(url "https://github.com/leibniz-psychology/psychnotebook-deploy.git")
					(introduction
					 (make-channel-introduction
					  "02ae8f9f647ab9650bc9211e728841931f25792c"
					  (openpgp-fingerprint
					   "CA4F 8CF4 37D7 478F DA05  5FD4 4213 7701 1A37 8446"))))
			 %default-channels))
 (operating-system-file
  (scheme-file "config.scm"
	#~(@ (zpid machines yamunanagar os) yamunanagar-os)))
 (schedule "55 13 * * *")
 (services-to-restart '(nginx ntpd guix-publish ssh-daemon mcron)))
---snap---

So, I’m fine with closing this as wontfix.

Cheers,
Lars

-- 
Lars-Dominik Braun
Wissenschaftlicher Mitarbeiter/Research Associate

www.leibniz-psychology.org
ZPID - Leibniz-Institut für Psychologie /
ZPID - Leibniz Institute for Psychology
Universitätsring 15
D-54296 Trier - Germany
Tel.: +49–651–201-4964
[signature.asc (application/pgp-signature, inline)]

Added tag(s) wontfix. Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 23 Dec 2020 15:58:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 44900 <at> debbugs.gnu.org and Lars-Dominik Braun <ldb <at> leibniz-psychology.org> Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 23 Dec 2020 15:58:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 21 Jan 2021 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 89 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.