tuna / issues

Code Unrelated Issues
351 stars 28 forks source link

希望保留 Bioconductor 源的历史版本 #1969

Closed Nickier0510 closed 1 month ago

Nickier0510 commented 1 month ago

先决条件 (Prerequisites)

发生了什么(What happened)

Bioconductor 是R语言中生物信息学研究用到的R包仓库,官方链接:https://www.bioconductor.org/。目前更新到了 3.19 版本,devel 是 3.20 。在R语言R=4.3版本中,如果当前使用的 Bioconductor 版本为 3.18,使用 一下代码安装 R包时,可以安装

if(!require("BiocManager")) install.packages("BiocManager")
BiocManager::install("DESeq2")

但是该方法是从官方源安装,国内速度较慢,切换为清华镜像之后,无法安装

options("repos"=c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN"))
options(BioC_mirror="https://mirrors.tuna.tsinghua.edu.cn/bioconductor")
if(!require("BiocManager")) install.packages("BiocManager")
BiocManager::install("DESeq2")

报错信息如下:

Warning: unable to access index for repository https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.18/bioc/src/contrib:
  cannot open URL 'https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.18/bioc/src/contrib/PACKAGES'
Warning: unable to access index for repository https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.18/data/annotation/src/contrib:
  cannot open URL 'https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.18/data/annotation/src/contrib/PACKAGES'
Warning: unable to access index for repository https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.18/data/experiment/src/contrib:
  cannot open URL 'https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.18/data/experiment/src/contrib/PACKAGES'
Warning: unable to access index for repository https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.18/workflows/src/contrib:
  cannot open URL 'https://mirrors.tuna.tsinghua.edu.cn/bioconductor/packages/3.18/workflows/src/contrib/PACKAGES'

之前有人提过这个 issue #1614,但是没有得到有效的解决。Bioconductor 上游删除旧版本的R包但是通过Bioconductor官方源是可以正常安装的,但是清华的 Bioconductor源就不行,这应该是清华在同步该镜像源的时候,没有保留历史版本导致的。

相反,西湖大学的 Bioconductor 源就有历史版本,通过下面R语言代码可以安装

options(BioC_mirror="https://mirrors.westlake.edu.cn/bioconductor")
if(!require("BiocManager")) install.packages("BiocManager")
BiocManager::install("DESeq2")

对比了一下,西湖大学的 Bioconductor 源保留的 src文件夹,但是清华源没有: 69d3ab27addc3be95be6f00ce81ac2d

用户普遍使用清华源,现在很多人反馈这个问题,无法安装历史版本对许多用户造成不小的困扰。希望清华源可以保留 Bioconductor 历史版本。

期望的现象(What you expected to happen)

希望保留 Bioconductor 源的历史版本,让用户在基于 Bioconductor 3.18 或低于 3.18 时,可以继续用清华镜像安装R包

options("repos"=c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN"))
options(BioC_mirror="https://mirrors.tuna.tsinghua.edu.cn/bioconductor")
if(!require("BiocManager")) install.packages("BiocManager")
BiocManager::install("DESeq2")

如何重现此问题(How to reproduce it)

首先安装 R 语言 4.3 版本,参考:https://mirrors.tuna.tsinghua.edu.cn/CRAN/ 然后在 R 4.3 环境中,运行

options("repos"=c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN"))
options(BioC_mirror="https://mirrors.tuna.tsinghua.edu.cn/bioconductor")
if(!require("BiocManager")) install.packages("BiocManager")
BiocManager::install("DESeq2")

操作系统(OS Version)

Linux,macOS,Windows 10 & 11

浏览器(如果适用)(Browser version, if applicable)

暂无

其他环境(Other environments)

No response

其他需要说明的事项(Anything else we need to know)

No response

shankerwangmiao commented 1 month ago

您好,根据 Bioconductor 的安排,在 5 月 15 日,3.18 及此前版本的相关数据已经被归档,并从其同步来源中被移除。为节约镜像站磁盘空间,我们也相应移除了这些文件。该操作是不可逆的,我们无法重新找回在归档中的文件。

Nickier0510 commented 1 month ago

但是西湖大学的 3.18 及此前版本依然保留着:https://mirrors.westlake.edu.cn/bioconductor/packages/3.18/bioc/src/contrib/ 。 所以,清华源应该也可以实现这个操作,至少清华源应该保留 3.18 的版本,这需要的磁盘空间大概几百G,清华源有这个条件实现的。

Harry-Chen commented 1 month ago

但是西湖大学的 3.18 及此前版本依然保留着:https://mirrors.westlake.edu.cn/bioconductor/packages/3.18/bioc/src/contrib/ 。 所以,清华源应该也可以实现这个操作,至少清华源应该保留 3.18 的版本,这需要的磁盘空间大概几百G,清华源有这个条件实现的。

正如上面所说的,bioconductor 官方虽然 HTTP 上游可能还存在您所述的文件,但 rsync 上游已经移除了 /3.18/bioc/src/ 目录,我们无法再次获取。我们的同步跟随 rsync 上游变化,无论上游增加、删除文件,都会反映在镜像中。

如确实有需要,请使用您所述的西湖大学的镜像源。

zhangjy859 commented 1 month ago

但是西湖大学的 3.18 及此前版本依然保留着:https://mirrors.westlake.edu.cn/bioconductor/packages/3.18/bioc/src/contrib/ 。 所以,清华源应该也可以实现这个操作,至少清华源应该保留 3.18 的版本,这需要的磁盘空间大概几百G,清华源有这个条件实现的。

Bioconductor 的归档反映在HTTP上面是一个302重定向,文件是被重定向到其他的第三方网站的,不清楚Bioconductor这样做的策略,可能是为了降低成本,但是在特殊的网络环境下可能确实会有问题。

shankerwangmiao commented 1 month ago

是的,归档存储实际上是在对象存储中,而其它文件是直接存储在服务器上的。这也就是无法同步归档存储中的文件的原因。

zhangjy859 commented 1 month ago

是的,归档存储实际上是在对象存储中,而其它文件是直接存储在服务器上的。这也就是无法同步归档存储中的文件的原因。

遗憾的是,一方面它对象存储的域名在国内部分地区是无法正常访问的,另一方面,BiocManager 和R版本的匹配机制在镜像站移除了旧版本存档之后,在无法升级R和BiocManager的环境中会导致一些问题,所以某种程度上@Nickier0510 的意见也是有道理的,或者至少设法跟随上游源的302重定向。

Nickier0510 commented 1 month ago

image

taoky commented 1 month ago

或者至少设法跟随上游源的302重定向。

rsync 没有所谓的「302 重定向」这一说。另外在 bioc 的邮件列表中的邮件:

Syncing to legacy releases of Bioconductor is not allowed and wasted effort as once Bioconductor freezes a release, no maintainer is allowed to make changes to that Bioconductor branch ever.

If you have set up your rsync to use numerical indications and/or with the --delete flag, you may need to adjust your rsync commands to keep a legacy version of Bioconductor and not have it completely removed. Please make any adjustment by May 15th.

这需要管理员手动介入来让旧版本不被删除,但是除非有非常迫切的需求,有很多镜像的镜像站点没有动力去自发地保留已经不受支持的旧版本的镜像,特别是在磁盘空间没有那么充裕的情况下。就算之后决定保留一定数量的 bioc 旧版本,已经被归档删除的版本也不可能再同步回来了。

我也支持有不受支持版本需求的用户使用例如西湖大学这样的镜像,期望一个镜像站解决用户所有问题是不现实的。

zhangjy859 commented 1 month ago

302重定向

抱歉没有明确表达我的意思,我的看法是用户最终访问镜像站的方式还是http,这一步似乎可以有一些操作的空间,例如将旧版本重新定向会官方的http链接,这样至少可以避免部分用户设置镜像源后,在BiocManager更新后遇到突然的报错。虽然这个方案看起来也很脏。

事实上,我在工作中经常推荐用户设置清华源等镜像站以解决Bioc的访问问题,但是每次BiocManager及其大版本更新后都会遇到大量用户的抱怨BiocManager 遇到404错误 unable to access index for repository

当然,这是我个人意见,清华源作为免费的服务,我尊重清华源最终的决定和技术方案。