Eos-rankmirrors ranks mirrors by default now

This one, I don’t understand though. If someone wants auto-ranking it would make sense to directly replace the endeavouros-mirrorlist file :man_shrugging: (it still makes a backup of the old one I guess?)

Is my eos-rankmirros doing what it should be doing?
Checked the new .pacnew file and it was very different from the previous one.
It was very similar to what Dalto posted above.

eos-rankmirrors
$ eos-rankmirrors
Fetching the latest available endeavouros-mirrorlist ...
Ranking EndeavourOS mirrors, please wait ...
====> Fail: https://ftp.acc.umu.se/mirror/endeavouros/repo/$repo/$arch
====> Fail: https://mirrors.tuna.tsinghua.edu.cn/endeavouros/repo/$repo/$arch
######################################################
####                                              ####
###        EndeavourOS Repository Mirrorlist       ###
####                                              ####
######################################################
#### Entry in file /etc/pacman.conf:
###     [endeavouros]
###     SigLevel = PackageRequired
###     Include = /etc/pacman.d/endeavouros-mirrorlist
######################################################
### Tip: Use the 'eos-rankimirrors' program to rank
###      these mirrors or re-order them manually.
######################################################

## Germany
#Server = https://mirror.alpix.eu/endeavouros/repo/$repo/$arch
#Server = https://de.freedif.org/EndeavourOS/repo/$repo/$arch
#Server = https://mirror.moson.org/endeavouros/repo/$repo/$arch

## Sweden
#Server = https://ftp.acc.umu.se/mirror/endeavouros/repo/$repo/$arch
#Server = https://mirror.linux.pizza/endeavouros/repo/$repo/$arch

## Canada
#Server = https://ca.gate.endeavouros.com/endeavouros/repo/$repo/$arch

## China
#Server = https://mirrors.tuna.tsinghua.edu.cn/endeavouros/repo/$repo/$arch

## Singapore
#Server = https://mirror.jingk.ai/endeavouros/repo/$repo/$arch
#Server = http://mirror.jingk.ai/endeavouros/repo/$repo/$arch

## France
#Server = https://endeavour.remi.lu/repo/$repo/$arch

## South Korea
#Server = https://mirror.funami.tech/endeavouros/repo/$repo/$arch

# Results of mirror ranking at (UTC) 06/01/2022 15:53:59:
# The following fields are shown for each mirror:
#   mirror:          The mirror address
#   update-level:    Ordinal number of the latest update (larger is newer)
#   fetch-time:      Measures the speed of the mirror (smaller is faster)
#
# mirror                                                        update-level  fetch-time
# ~~~~~~                                                        ~~~~~~~~~~~~  ~~~~~~~~~~
# https://mirror.alpix.eu/endeavouros/repo/$repo/$arch          1177          0.937770
# https://ca.gate.endeavouros.com/endeavouros/repo/$repo/$arch  1177          1.709192
# https://endeavour.remi.lu/repo/$repo/$arch                    1177          1.773540
# https://mirror.linux.pizza/endeavouros/repo/$repo/$arch       1177          1.873963
# https://mirror.moson.org/endeavouros/repo/$repo/$arch         1177          1.917772
# https://de.freedif.org/EndeavourOS/repo/$repo/$arch           1177          1.959291
# https://mirror.jingk.ai/endeavouros/repo/$repo/$arch          1176          1.040137
# https://mirror.funami.tech/endeavouros/repo/$repo/$arch       1176          1.395198
# http://mirror.jingk.ai/endeavouros/repo/$repo/$arch           1176          1.497887

# EndeavourOS mirrorlist:
Server = https://mirror.alpix.eu/endeavouros/repo/$repo/$arch
Server = https://ca.gate.endeavouros.com/endeavouros/repo/$repo/$arch
Server = https://endeavour.remi.lu/repo/$repo/$arch
Server = https://mirror.linux.pizza/endeavouros/repo/$repo/$arch
Server = https://mirror.moson.org/endeavouros/repo/$repo/$arch
Server = https://de.freedif.org/EndeavourOS/repo/$repo/$arch
Server = https://mirror.jingk.ai/endeavouros/repo/$repo/$arch
Server = https://mirror.funami.tech/endeavouros/repo/$repo/$arch
Server = http://mirror.jingk.ai/endeavouros/repo/$repo/$arch

Moving old mirrorlist to /etc/pacman.d/endeavouros-mirrorlist.2022.01.06-12.53.59.
Writing new mirrorlist to /etc/pacman.d/endeavouros-mirrorlist.

That seems a reasonable scenario. The autoranking feature should now (with these new changes) be disabled by default, but currently it is enabled.

Will do some more changes, and disable auto-ranking by default.

Note: this means that all who want to have auto-ranking enabled, will have to re-enable it manually in file /etc/eos-rankmirrors.conf after the next update of package
eos-rankmirrors.

2 Likes

Looks OK to me (although currently the layout in the post is not easy to read… :wink:).

2 Likes

sorry
Just fixed, but if it’s ok, it’s okay then
Thanx :slight_smile:

Just to be clear, I didn’t mean to suggest that auto-ranking should be disabled by default.
It probably does make sense for most of the users.

My only concern was with the commented #backup line, it would always overwrite the list with the un-ranked default one. So for those who choose to disable auto-ranking and manually manage their list, that would be bad… the auto-rankers wouldn’t care of course.

There is only one file, endeavouros-mirrorlist. And that can’t be both auto-ranked and customized (without some really high level AI :wink:).
So the easy and working solution is to do like Arch does, not to overwrite by default.

And now it is possible to enable auto-ranking in the configuration file.

Well yeah, that’s clear.

I think it was a good idea to have it switched on by default.

1 Like

So did I. But I realize it seems to divide people, some want to enable and some disable it by default. I still think most people would consider it good to enable auto-ranking by default, especially the ones who are new to Arch way of doing stuff.
And more experienced users can easily disable it if wanted.

All in all, EndeavourOS mirrorlist is currently quite small, so it is quite easily manageable by users, even manually. When it gets larger in the future, the situation may change, and auto-ranking could be needed already by default.

But let’s see if the current way of disabling it by default is the way to go.

Maybe someone could create a poll? :wink:

1 Like

You could have it prompt users
Replace endeavoros-mirrorlist? Y/n
And then have an optional flag people could use to bypass user prompt
eos-rankmirrors --replace-mirrorlist=1
or something like that maybe?

Thank you both @westandskif and @manuel.

I’m very happy with this direction of development!

I just updated my system to get the latest rate-mirrors-bin from the endeavouros repo and ran:

rate-mirrors endeavouros | sudo tee /etc/pacman.d/endeavouros-mirrorlist

followed by

sudo pacman -Syyu

Worked like a charm. :slightly_smiling_face: :ok_hand:

1 Like

Regarding auto-ranking being enabled by default, you probably know my view on that, but I’ll just clarify it.

As much as I hate automation that does stuff behind my back (and changes my config), I do think it is a good idea to have an option of automatic mirror ranking, and I don’t particularly care whether it is enabled by default. What I don’t like is inconsistency between EndeavourOS and Arch. I think there ought not be a division in how these two mirrorlists are treated. And if Arch mirrorlist is not ranked automatically, neither should EndeavourOS list be, and if there is an option to automate one, there should also be the option to automate the other, and the process ought to be identical.

I wouldn’t even mind a Manjaro-style service that ranks mirrors, even though I would be the first one to disable it, of course :slight_smile:

Arch has a philosophy of not enabling system services by default. I think some departure from that on EndeavourOS can be tolerated, and on EndeavourOS we need not be so strict about it, but it should be clear to the user which services are enabled.

What I really don’t like is inventing the wheel and doing it differently than Arch does it, because that just makes exceptions to how the system is maintained. Every Arch user knows about .pacnew files, so that’s the way to introduce changes to config files like mirror lists. Or if you want it automatised, you can use .pacsave file, that’s fine, too. As long as it is consistent with how stuff is done on Arch, and there is no EndeavourOS specific system maintenance.

1 Like

@Kresimir
Unless I’m misunderstanding. We’re not talking about auto ranking being enabled by default. We’re talking about the auto rank tool eos-rankmirrors ranking mirrors and replacing the eos mirrorlist by default. And if that’s the case, If someone is using an auto rank tool I would think the expectation would be update the list when it is run.

I don’t care either way really as I don’t use that tool. I use rate-mirrors instead with this script :stuck_out_tongue:

#!/bin/bash
export TMPFILE1="$(mktemp)"; \
export TMPFILE2="$(mktemp)";  \
    sudo true; \
    rate-mirrors --save=$TMPFILE1 arch --max-delay=21600 \
      && sudo mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist-backup \
      && sudo mv $TMPFILE1 /etc/pacman.d/mirrorlist \
    && rate-mirrors --save=$TMPFILE2 endeavouros \
      && sudo mv /etc/pacman.d/endeavouros-mirrorlist /etc/pacman.d/endeavouros-mirrorlist-backup \
      && sudo mv $TMPFILE2 /etc/pacman.d/endeavouros-mirrorlist

Why all the temporary files and moving? There’s no need to that, just use sudo tee, like this:

#!/bin/sh

# if you want backup:
sudo mv -f /etc/pacman.d/endeavouros-mirrorlist /etc/pacman.d/endeavouros-mirrorlist-backup
sudo mv -f /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist-backup

# rate mirrors:
rate-mirrors endeavouros | sudo tee /etc/pacman.d/endeavouros-mirrorlist
rate-mirrors arch --max-delay=21600 | sudo tee /etc/pacman.d/mirrorlist

Yeah, probably. When I started using rate-mirrors I just used westandskif’s example from his GitHub page and haven’t bothered to change it.

1 Like

Hi Kresimir,
cc @KDen

Let me add my two cents to this :slight_smile:

/tmp ❯❯❯ echo "abc" > cde
/tmp ❯❯❯ false | tee cde
/tmp ❯❯❯ cat cde

The above prints nothing, so when used with tee only, the moment rate-mirrors fails to fetch mirrors or any other epic fail happens, non-zero exit code won’t prevent tee from overwriting the mirrors file. That’s why I keep suggesting the tmp file approach.

But should I be concerned if my mirror lists get overwritten? I think the answer is: no.

Thus, I don’t even make a backup when running rate-mirrors.

Let’s see, in what cases could rate-mirrors fail… I can think of three situations: there is an internet outage, there is an update to rate-mirrors that breaks it, and all the mirror servers are unresponsive. Well, in the last case, I have bigger problems than losing my mirror lists (probably the world has ended or something :rofl:).

Let’s assume there is a temporary internet outage (or the disaster scenario where all mirror servers are temporarily unresponsive), I run rate-mirrors with sudo tee and I destroy my mirror lists. So now I’m in a pickle? Well not really… Once the internet is working, I just run the same command again and now I have good mirror lists again, and everything is fine.

So, the only way I could get screwed is if there was an update to rate-mirrors that broke it, and I run it without knowing it’s broken. If it comes to that (which I find unlikely), I would have to restore my mirror lists from an alternative source,1 and would probably waste two or three minutes doing so – in any case much less than it took to write this long post…

1For Arch mirrors, I could just run reflector, or look up the list of mirrors on the Arch webpage, for EndeavourOS, there is the git repo. Not a big deal in any case.

3 Likes

After the latest update today is this how the eos-rankmirrors.conf should look like? It defaults to no now instead of yes ?

###############################################
# eos-rankmirrors.conf
###############################################

# EOS_AUTO_MIRROR_RANKING determines whether the
# ranked EndeavourOS mirror list will overwrite the existing
# mirror list or simply be stored as a .pacnew file.
# Supported values:
#   "yes"     overwrite the existing EndeavourOS mirror list
#   "no"      save new mirror list as a .pacnew file
#
EOS_AUTO_MIRROR_RANKING=no

# EOS_AUTORANK_TIMEOUT specifies the maximum time (in seconds)
# for each mirror to return the full answer.
#
EOS_AUTORANK_TIMEOUT=30

Here’s a brief update log of the latest version warning of pacnew, which I think is the behavior you want:

:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Package (1)                  Old Version  New Version  Net Change  Download Size

endeavouros/eos-rankmirrors  2.1.2-1      2.1.3-1        0.00 MiB       0.02 MiB

Total Download Size:   0.02 MiB
Total Installed Size:  0.01 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 eos-rankmirrors-...    17.2 KiB   156 KiB/s 00:00 [-----------------------] 100%
(1/1) checking keys in keyring                     [-----------------------] 100%
(1/1) checking package integrity                   [-----------------------] 100%
(1/1) loading package files                        [-----------------------] 100%
(1/1) checking for file conflicts                  [-----------------------] 100%
(1/1) checking available disk space                [-----------------------] 100%
:: Processing package changes...
(1/1) upgrading eos-rankmirrors                    [-----------------------] 100%
warning: /etc/eos-rankmirrors.conf installed as /etc/eos-rankmirrors.conf.pacnew
:: Running post-transaction hooks...

Yes. This is the default because it is more like the Arch way to handle such configurations.

And if there will be updates to this config file, they will be stored as a .pacnew file. The changes can be merged with e.g. eos-pacdiff or manually.

This way user’s possible own settings will not be overwritten.

3 Likes

Thank you for this!! I like this option much better!

3 Likes