diff mbox series

[bug#48435] Start enabling substitutes from bayfront.

Message ID 20210515100822.11784-1-mail@cbaines.net
State Accepted
Headers show
Series [bug#48435] Start enabling substitutes from bayfront. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Christopher Baines May 15, 2021, 10:08 a.m. UTC
In addition to substitutes from ci.guix.gnu.org.  There are more changes that
can be made in the future, but these changes seem like a good start.

* etc/substitutes/bayfront.guix.gnu.org.pub: New file.
* Makefile.am (dist_pkgdata_DATA): Add it.
* config-daemon.ac (guix_substitute_urls): Add https://bayfront.guix.gnu.org.
* guix/scripts/substitute.scm (%default-substitute-urls): Add
http://bayfront.guix.gnu.org.
* guix/store.scm (%default-substitute-urls): Add bayfront.guix.gnu.org.
---
 Makefile.am                               | 3 ++-
 config-daemon.ac                          | 2 +-
 etc/substitutes/bayfront.guix.gnu.org.pub | 6 ++++++
 guix/scripts/substitute.scm               | 3 ++-
 guix/store.scm                            | 3 ++-
 5 files changed, 13 insertions(+), 4 deletions(-)
 create mode 100644 etc/substitutes/bayfront.guix.gnu.org.pub

Comments

Mathieu Othacehe May 15, 2021, 11:01 a.m. UTC | #1
Hello Chris,

> +  guix_substitute_urls="https://ci.guix.gnu.org https://bayfront.guix.gnu.org"

What is the rationale behind adding a new substitution server? I feel
like having two substitute servers will make things more complex in term
of maintenance.

Having both servers compute the same set of substitutes is also not
great from an energetic and resource saving point of view.

Thanks,

Mathieu
Christopher Baines May 15, 2021, 12:20 p.m. UTC | #2
Mathieu Othacehe <othacehe@gnu.org> writes:

> Hello Chris,
>
>> +  guix_substitute_urls="https://ci.guix.gnu.org https://bayfront.guix.gnu.org"
>
> What is the rationale behind adding a new substitution server? I feel
> like having two substitute servers will make things more complex in term
> of maintenance.
>
> Having both servers compute the same set of substitutes is also not
> great from an energetic and resource saving point of view.

Hey,

I should have probably written a cover letter, but this patch is me
starting to try and work out the changes involved in getting substitutes
from bayfront to general Guix users, but the discussion has been
happening in this thread [1].

1: https://lists.gnu.org/archive/html/guix-devel/2021-05/msg00241.html

Bayfront has been around for a while, and has been serving substitutes,
although I'm not sure it's provided much value to users in that time. I
hope that can change with switching to using the Guix Build Coordinator
though, that happened around a month ago, and it's slowly building
things and catching up.

I guess there's a greater need to maintain it if starts getting used by
more users, so I do think the maintenance involved is something to
consider.

Personally, I see the arguments for having multiple substitute servers
getting stronger over time. Multiple independent substitute servers
would provide more reliability than a single source, as well as enabling
things like K of N trust in substitutes [2].

2: https://lists.gnu.org/archive/html/guix-devel/2020-06/msg00179.html

In terms of energy and resources, currently there are 5 machines in use,
most of which were mostly idle before being put to use building things
for substitutes. While having them build things does use more power than
having them idle, I think the value provided, even if that's providing
exactly the same bytes as ci.guix.gnu.org, is worth the cost, for the
reasons I give above.

Thanks,

Chris
diff mbox series

Patch

diff --git a/Makefile.am b/Makefile.am
index 4cbef5a6e6..bad17e59fd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -584,7 +584,8 @@  check-system: $(GOBJECTS)
 dist_pkgdata_DATA =				\
   etc/substitutes/berlin.guix.gnu.org.pub	\
   etc/substitutes/ci.guix.gnu.org.pub		\
-  etc/substitutes/ci.guix.info.pub
+  etc/substitutes/ci.guix.info.pub		\
+  etc/substitutes/bayfront.guix.gnu.org.pub
 
 # Bash completion file.
 dist_bashcompletion_DATA = etc/completion/bash/guix	\
diff --git a/config-daemon.ac b/config-daemon.ac
index 85caee269b..ee2ffbff42 100644
--- a/config-daemon.ac
+++ b/config-daemon.ac
@@ -117,7 +117,7 @@  if test "x$guix_build_daemon" = "xyes"; then
 
   dnl Determine the appropriate default list of substitute URLs (GnuTLS
   dnl is required so we can default to 'https'.)
-  guix_substitute_urls="https://ci.guix.gnu.org"
+  guix_substitute_urls="https://ci.guix.gnu.org https://bayfront.guix.gnu.org"
 
   AC_MSG_CHECKING([for default substitute URLs])
   AC_MSG_RESULT([$guix_substitute_urls])
diff --git a/etc/substitutes/bayfront.guix.gnu.org.pub b/etc/substitutes/bayfront.guix.gnu.org.pub
new file mode 100644
index 0000000000..0092301e5a
--- /dev/null
+++ b/etc/substitutes/bayfront.guix.gnu.org.pub
@@ -0,0 +1,6 @@ 
+(public-key 
+ (ecc 
+  (curve Ed25519)
+  (q #7D602902D3A2DBB83F8A0FB98602A754C5493B0B778C8D1DD4E0F41DE14DE34F#)
+  )
+ )
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 8e4eae00b3..2fa2b1e219 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -638,7 +638,8 @@  found."
     (#f
      ;; This can only happen when this script is not invoked by the
      ;; daemon.
-     '("http://ci.guix.gnu.org"))))
+     '("http://ci.guix.gnu.org"
+       "http://bayfront.guix.gnu.org"))))
 
 ;; In order to prevent using large number of discovered local substitute
 ;; servers, limit the local substitute urls list size.
diff --git a/guix/store.scm b/guix/store.scm
index 9d706ae590..8fca37283f 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -783,7 +783,8 @@  encoding conversion errors."
   (map (if (false-if-exception (resolve-interface '(gnutls)))
            (cut string-append "https://" <>)
            (cut string-append "http://" <>))
-       '("ci.guix.gnu.org")))
+       '("ci.guix.gnu.org"
+         "bayfront.guix.gnu.org")))
 
 (define (current-user-name)
   "Return the name of the calling user."