Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper CTAN mirror selection #250

Open
teatimeguest opened this issue Mar 30, 2023 · 11 comments
Open

Proper CTAN mirror selection #250

teatimeguest opened this issue Mar 30, 2023 · 11 comments
Labels
enhancement New feature or request

Comments

@teatimeguest
Copy link
Owner

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 teatimeguest added the enhancement New feature or request label Mar 30, 2023
@teatimeguest
Copy link
Owner Author

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 #248 (comment)

@teatimeguest
Copy link
Owner Author

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.

@muzimuzhi
Copy link
Contributor

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
Copy link
Owner Author

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
Copy link
Contributor

muzimuzhi commented Apr 12, 2023

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
Copy link
Owner Author

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

  • First, the action will always try to setup with a mirror.

  • Fallback to master in the following cases:

    • Unable to download install-tl.
    • Unable to load texlive.tlpdb.
    • install-tl and texlive.tlpdb versions are inconsistent.

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
Copy link
Owner Author

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

2024-03-13

  • 16:40 – TL2023 appears on tug.org/historic (historic master).

    I did not check if it was in usable state, but at least install-tl-unx.tar.gz was there.

  • 17:37 – TL2024 is released on dante.ctan.org (master).

  • 18:25tlpretest is removed from ftp.math.utah.edu.

    Now removed from all mirrors.

  • 19:53 – Some mirrors have been upgraded to TL2024.

    In particular, mirror.math.princeton.edu was synchronized quickly, so it was changed to be used instead of master as a fallback and v3.2.0 was released.

  • 22:18 – The homepage is updated.

  • 22:20ctan.math.utah.edu is upgraded.

2024-03-14

  • 03:10 – TL2023 appears on ftp.math.utah.edu.

    Now synced to all mirrors.

  • 06:36CTAN is updated.

@koppor
Copy link

koppor commented Apr 8, 2024

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
Copy link

koppor commented Apr 8, 2024

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
Copy link
Owner Author

@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
Copy link

koppor commented Apr 8, 2024

@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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants