[PATCH] installer: checks the availability of the mirror

  • Done
  • quality assurance status badge
Details
5 participants
  • aleksandr barakin
  • Andrew Tropin
  • Julien Lepiller
  • unwox
  • Mathieu Othacehe
Owner
unassigned
Submitted by
aleksandr barakin
Severity
normal
A
A
aleksandr barakin wrote on 3 Oct 2022 15:55
(address . guix-patches@gnu.org)
20221003135547.z4a6ocs7dijgb3nh@barak.in
checks the availability of the mirror bordeaux.guix.gnu.org.

this allows you to start the installation if the ci.guix.gnu.org
is unavailable.
---
gnu/installer/newt/network.scm | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

Toggle diff (30 lines)
diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm
index 0477a489be..b11a55cb1f 100644
--- a/gnu/installer/newt/network.scm
+++ b/gnu/installer/newt/network.scm
@@ -122,10 +122,15 @@ FULL-VALUE tentatives, spaced by 1 second."
(lambda _ #f))
(alarm 3))
(lambda ()
- (false-if-exception
- (= (response-code
- (http-request "https://ci.guix.gnu.org"))
- 200)))
+ (or
+ (false-if-exception
+ (= (response-code
+ (http-request "https://ci.guix.gnu.org"))
+ 200))
+ (false-if-exception
+ (= (response-code
+ (http-request "https://bordeaux.guix.gnu.org"))
+ 200))))
(lambda ()
(alarm 0))))
--
2.30.2


--
wbr, aleksandr barakin aka sash-kan.
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQTy+QZ2YvBaypi4qLpb8Ov2Kx8BwAUCYzrp4wAKCRBb8Ov2Kx8B
wGTCAJ42Utdm/dYgOhCFOASYC7rzzEq3MQCdFLz+4n2Hk5Q8Vws6eW3e0qXpJFU=
=2K2F
-----END PGP SIGNATURE-----


U
U
unwox wrote on 5 Oct 2022 12:39
(address . 58273@debbugs.gnu.org)
CNDXBG1K4R1F.3LZ853DLYTMHZ@pc
+1 for this. It would make guix installation via graphical installer
possible in Russia since ci.guix.gnu.org is not accessible from there
without using proxy.
J
J
Julien Lepiller wrote on 14 Oct 2022 07:55
(name . aleksandr barakin)(address . alex@barak.in)(address . 58273@debbugs.gnu.org)
20221014075525.5e68aae6@sybil.lepiller.eu
Le Mon, 3 Oct 2022 16:55:49 +0300,
aleksandr barakin <alex@barak.in> a écrit :

Toggle quote (5 lines)
> checks the availability of the mirror bordeaux.guix.gnu.org.
>
> this allows you to start the installation if the ci.guix.gnu.org
> is unavailable.

This sounds useful, but I don't know how to test. The patch looks good
and fairly simple to me :)
A
A
Andrew Tropin wrote on 17 Oct 2022 07:33
87o7ub815u.fsf@trop.in
On 2022-10-03 16:55, aleksandr barakin wrote:

Toggle quote (35 lines)
> checks the availability of the mirror bordeaux.guix.gnu.org.
>
> this allows you to start the installation if the ci.guix.gnu.org
> is unavailable.
> ---
> gnu/installer/newt/network.scm | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm
> index 0477a489be..b11a55cb1f 100644
> --- a/gnu/installer/newt/network.scm
> +++ b/gnu/installer/newt/network.scm
> @@ -122,10 +122,15 @@ FULL-VALUE tentatives, spaced by 1 second."
> (lambda _ #f))
> (alarm 3))
> (lambda ()
> - (false-if-exception
> - (= (response-code
> - (http-request "https://ci.guix.gnu.org"))
> - 200)))
> + (or
> + (false-if-exception
> + (= (response-code
> + (http-request "https://ci.guix.gnu.org"))
> + 200))
> + (false-if-exception
> + (= (response-code
> + (http-request "https://bordeaux.guix.gnu.org"))
> + 200))))
> (lambda ()
> (alarm 0))))
>
> --
> 2.30.2

Ideally we should not hardcode exact mirror urls, because the image can
be built with different substitute urls. Another possible soultion is
to add an ability to skip the check via TUI, as
/tmp/installer-assume-online probably not well-known and this step can
stop people without access to ci.guix.gnu.org from using Guix System,
seems especially true for newcommers.

Anyway, I find this patch useful and good enough to solve the problem at
least for some people (who don't have access to ci, but have it to
bordeaux), adjusted the wording and commit message, applied.

--
Best regards,
Andrew Tropin
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmNM6R0ACgkQIgjSCVjB
3rDxdhAAjhXk94Uz+l1TC3tKqkf60e7eiPQwzRuwJ/fDVfgvRodXHQUqvKSEPyyx
Hm/+LUrVmYVf6ERJUURqm7sqRvmYFryLQIcWqARuzeN0z5EeLkBG2nxrAkWz8v7g
aQ7rcLLQTIRE4eOwHI4L1ifxsiGKbuCNB/tLy7DDJD4YbQ3/JLYv2h+S0yc2QeD8
3oAz3TrGnI3kwiiDBEC2QpAkDCw74DDQrXzwj60HgE36XpLBzSsNuYA8gH9Y45vH
XR7XhFEAGAPmfAXMnLkHItzHbeXeaX8CNoCyFOE95eohCv+68/7my0vyVlDxO8LP
v9gMCaAF5hJbTtqqPelEnG8ZLJLSG1YVc4eF6gkiEH5ee8N+roZndyef4MJIzZR9
QB6B+UQ6lvfmSQ5vHrvlKPyqOHvldctmqT4Kz56gB26w68uVPSlNofPON203NGim
spY06S6kr+fx1DkTsjMwgzfTdbjaSL29LC+L5upKVFg0RKh2saUcsoxlXbo/aINM
V2sYer4hVpOEpSae89b9DKsKTBCUXqp9n89L7i6h8oXBPPM79DId6/DwMVk9q7mU
U+gx8ZwsiJqJs+D8aZzhIUOxFJWp1vvhFrZ8vV1TcysTCRz0gSOPCh9oC+2S3BOr
oBLHi5eXn7Xfw8U3hs9m/+LgOasfg5uazOyJpBx4VcyYZtdUXvM=
=Od9Q
-----END PGP SIGNATURE-----

A
A
Andrew Tropin wrote on 17 Oct 2022 07:34
Applied
(address . control@debbugs.gnu.org)
87k04z814e.fsf@trop.in
close 58273
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmNM6VEACgkQIgjSCVjB
3rD6PA/+L1UKWrY/gZEJp84d3WX43CaR5eXZux5oeVf/2sZyv94aqYw2piTxMdad
0g+JYyw1gUYzISNLz0mL3U3pFetq8LK42TtWLSlJOhLzi+3m+SvVip66yND0VCNJ
7Pj/EXpBuy9B8fAYGas/KhcgkFGGISUj2tqZRinHIy9MlzPwQT/OQJ330JKcl6DG
Oz8NCiofX968fU2DKfAfaEXnWq5ijgcpJpAZdcU4boaiFLHNWWhAX7ijg034LVXL
qiAjAE+H21saCBgpjy5lmsmnMPSxtkRGJ6rvAsEupReyeJ8N9WTtAtbtFCqXfaW6
+hnOVRMXX0JDyuXWF6fFC6OQze8xpYsY3OeFIY3gO7QjcXhjoVnnYtfwJtRDNnFY
EWpVaO0eJppG9QcJVFlnT0pW4tSjuhJ6u9MQBF8tpTISCYhj50iTDHPNU8YUvwHi
UZaO3h0Hxo4qzXywMROZ8WA3KOzFH9I9nVs8oDDC4926nyfqL1WAmzVbX5RDYv2u
K3jKvJBN0yJQCQzMhFIWhTXWF4vMeZxKYe+UROtpR7GyilDDfLAt01v64MU4YLvP
v0iV8xlKu8j1YOg09mxCYKkZmlnmEb61ld13iXBQ1kub1VKg9v1p9niHkOA/GW23
OduC5g3R2zrgeW10biYmkbNdn1kuCg0pdgXynV9uDSn+0gODRkY=
=rwSm
-----END PGP SIGNATURE-----

M
M
Mathieu Othacehe wrote on 17 Oct 2022 09:39
Re: bug#58273: [PATCH] installer: checks the availability of the mirror
(name . Andrew Tropin)(address . andrew@trop.in)
87tu42nbk9.fsf_-_@gnu.org
Hello Andrew,

Toggle quote (9 lines)
>> + (false-if-exception
>> + (= (response-code
>> + (http-request "https://ci.guix.gnu.org"))
>> + 200))
>> + (false-if-exception
>> + (= (response-code
>> + (http-request "https://bordeaux.guix.gnu.org"))
>> + 200))))

Thanks for taking care of this patch. I think the following part could
be factorized:

(define (url-alive? url)
(false-if-exception
(= (response-code
(http-request url))
200)))

also, the indentation is wrong. Could you please fix it?

Thanks,

Mathieu
A
A
Andrew Tropin wrote on 17 Oct 2022 14:51
(name . Mathieu Othacehe)(address . othacehe@gnu.org)
8735bmpq9s.fsf@trop.in
On 2022-10-17 09:39, Mathieu Othacehe wrote:

Toggle quote (22 lines)
> Hello Andrew,
>
>>> + (false-if-exception
>>> + (= (response-code
>>> + (http-request "https://ci.guix.gnu.org"))
>>> + 200))
>>> + (false-if-exception
>>> + (= (response-code
>>> + (http-request "https://bordeaux.guix.gnu.org"))
>>> + 200))))
>
> Thanks for taking care of this patch. I think the following part could
> be factorized:
>
> (define (url-alive? url)
> (false-if-exception
> (= (response-code
> (http-request url))
> 200)))
>
> also, the indentation is wrong. Could you please fix it?

Thank you for the idea, pushed the change.

--
Best regards,
Andrew Tropin
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmNNT78ACgkQIgjSCVjB
3rDVlxAAhNTbG/0aIiF8pTvT5ZoJzuNcFEg8x1ubh7mC81AWwFIkza25qNRmmnl4
sMQMxdY18By2cXfZdmIE4wjTjAvkx3Sav/bfVsOaajb7kJE3WrCjtyOHUCPMJ0R1
QAVfA1oFfEGPTDjstyKtjvIL4EE5wyS2qI0g5vlbo+j4mQkjJOcunji1Bz44uwDN
LYx8WSc9RNmIw2J5FDKrJDDN/OBCeV3+2zsvg1CZoqK0HPoU3TsUP4rBTYMdsAVZ
NERDx9s9nPyrYmy0iUv7CCJZL7EtazDOpKqyIuiqehW0aRPn1p2huXdwwcmjyoL1
KBpSH4I0oFDaqL1osyOSVUo2nhQEq/5uSLXm2ELM30pKSi66Rozyg/IORnO1Vzw0
j4/ovaGr+YL5K926SoPGjL707ThRIh9RXfhnmRW22DrkkZ6pmkFKQBdEY2RoOX2r
YYek3N/bkmEzobG9dMvnpMludMl8FSoakkrsU+SmnGdQtK9xhAYsVL/omWqQZPHp
QHA0VHSRX05CjjXP1K8/sGcoQCuA+1TAucVFfv55L+9EOqvj3RZTBBX9vMZwCFLJ
ZaltEF2cDXNDqPdP6Eql0IL7j7IDdymw9IO+EWMyU1kDC884bz57uCuc+O1PiN4m
I1FFg03qO0jbAc5sg+mucDMUz02g5/rYH5JBn3UvRHJWqw7rwXI=
=QQcb
-----END PGP SIGNATURE-----

?