teatimeguest / setup-texlive-action

A GitHub Action to set up TeX Live
https://github.com/marketplace/actions/setup-texlive-action
MIT License
41 stars 2 forks source link

Proper CTAN mirror selection #250

Open teatimeguest opened 1 year ago

teatimeguest commented 1 year ago

When installing the latest TL, one of the CTAN mirrors is automatically selected and used, which can cause problems immediately after a new version of TL is released (see #248). So, it is desirable to have some workaround in place before the next version release.

teatimeguest commented 1 year ago

I am currently considering incorporating @muzimuzhi's idea:

I think the delay between release and sync is the crux of this issue, but I have no idea of an effective workaround for it.

CTAN has a master host (https://ctan.org/mirrors, right column) and every mirror is set to sync with it. Perhaps in the first few days of a new texlive release, the master host can be used as a fallback, if the auto chosen CTAN mirror is not in sync yet.

Originally posted by @muzimuzhi in https://github.com/teatimeguest/setup-texlive-action/issues/248#issuecomment-1478937971

teatimeguest commented 1 year ago

If CTAN can be queried to tell ages of each mirror, things will be easier and more flexible I think.

Originally posted by @muzimuzhi in https://github.com/teatimeguest/setup-texlive-action/issues/248#issuecomment-1487379739

Data can be retrieved from this page, but no API seems to be provided.

muzimuzhi commented 1 year ago

If CTAN can be queried to tell ages of each mirror, things will be easier and more flexible I think. Originally posted by @muzimuzhi in #248 (comment)

Data can be retrieved from this page, but no API seems to be provided.

Contact CTAN?

teatimeguest commented 1 year ago

No. The public APIs are listed on this page and no such functionality is described. It is not known if there is a private API, but this seems unlikely as the monitoring page is statically generated by mirmon.

muzimuzhi commented 1 year ago

Another aspect: it's better to stick to a specific CTAN mirror once automatically redirected at the first time (when downloading install-tl.zip or install-tl-unx.tar.gz). I'm not sure if the redirected url is retrievable.

Once retrieved, the setting part is feasible. install-tl has a -repository url|path option and tlmgr can be configured by tlmgr option repository url.

Using this way, at least one won't encounter the problem that when installing TeX Live itself and installing packages, two different mirrors providing different TeX Live versions are redirected.

teatimeguest commented 9 months ago

In preparation for TeX Live 2024, I have made some improvements in v3.0.2. The current behavior is as follows:

Such fallbacks are likely to occur frequently in the first few days after the release, but should have little impact on CI execution time.

teatimeguest commented 7 months ago

I monitored several mirrors and websites for TL2024. Below are the records, all times are in UTC:

2024-03-13

2024-03-14

koppor commented 7 months ago

CTAN checks the mirrors each hour. I also have issues with mirrors, but I wonder why.

Here the status page: https://ctan.org/mirrors/mirmon

koppor commented 7 months ago

There is another approach to list active TeXlive mirrors. The resulting json is available at https://zauguin.github.io/texlive-mirrors/mirrors.json.

Beginning of the list:


  "North America": {
    "Costa Rica": {
      "https://mirrors.ucr.ac.cr/CTAN/systems/texlive/tlnet/": {
        "status": "Alive",
        "texlive_version": 2024,
        "revision": 70877
      }
    },
    "USA": {
      "https://us.mirrors.cicku.me/ctan/systems/texlive/tlnet/": {
        "status": "Alive",
        "texlive_version": 2024,
        "revision": 70884
      },

It is updated regularly via following workflow: https://github.com/zauguin/texlive-mirrors/blob/trunk/.github/workflows/pages.yaml

The source for https://github.com/zauguin/texlive-mirrors/pkgs/container/get-tl-mirror-status is available at https://github.com/zauguin/texlive-mirrors/tree/get-tl-mirror-status.


Maybe, this information can be used in this script, too?

Example code to use the data to select a good mirror is provided at https://github.com/zauguin/install-texlive/blob/085918ba6384a0243a7c785c1d42641a66c5c229/src/main.ts#L112.

teatimeguest commented 7 months ago

@koppor Thanks for sharing the info!

There is another approach to list active TeXlive mirrors. The resulting json is available at https://zauguin.github.io/texlive-mirrors/mirrors.json.

I did not know this. I will consider using it for repository selection.


By the way, I found that the raw mirmon data is available at rsync://dante.ctan.org/MirMon/mirmon.state (sample here), but for some reasons it is not used in this action at the moment. I am also considering integrating this in the future.

koppor commented 7 months ago

@teatimeguest Thank you for sharing the links. I am thinking of rebuilding the mirrormon page using the json file. Mirrormon itself is unmaintained - and I like that the JSON contains the TeXLive revision (what mirrormon does not. Which could lead to package downgrades in some situation).

test-erik commented 4 months ago

Hi guys,

It wasn't necessary to guess who gets the updates and when. You could have asked CTAN directly. I wasn't aware there was a problem with the TeXlive release. The Updates of the mirrors can be added to the mirroring script. This would still need a polling mechanism, but it could run more frequently than the rsyncs of individual mirrors. CTAN doesn't have direct control over their frequency.