Skip to content

Commit 8500d47

Browse files
committed
Stop using MRAN
- remove cutoff for picking RSPM, always use it - remove now-redundant r4.0-mran test - shift base R 3.6 snapshot date to after October 2017, when rspm snapshots seem to have started - update docs to point to RSPM
1 parent e8eab15 commit 8500d47

File tree

11 files changed

+9
-67
lines changed

11 files changed

+9
-67
lines changed

docs/source/config_files.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ with ``REQUIRE`` and ``environment.yml``, visit
118118
================================================
119119

120120
This is used to install R libraries pinned to a specific snapshot on
121-
`MRAN <https://mran.microsoft.com/documents/rro/reproducibility>`_.
121+
`Posit Package Manager <https://mran.microsoft.com/documents/rro/reproducibility>`_.
122122
To set the date of the snapshot add a runtime.txt_.
123123
For an example ``install.R`` file, visit our `example install.R file <https://github.com/binder-examples/r/blob/HEAD/install.R>`_.
124124

@@ -207,7 +207,7 @@ For these cases, we have a special file, ``runtime.txt``.
207207
Have ``python-x.y`` in ``runtime.txt`` to run the repository with Python version x.y.
208208
See our `Python2 example repository <https://github.com/binder-examples/python2_runtime/blob/HEAD/runtime.txt>`_.
209209

210-
Have ``r-<RVERSION>-<YYYY>-<MM>-<DD>`` in ``runtime.txt`` to run the repository with R version RVERSION and libraries from a YYYY-MM-DD snapshot of `MRAN <https://mran.microsoft.com/documents/rro/reproducibility>`_.
210+
Have ``r-<RVERSION>-<YYYY>-<MM>-<DD>`` in ``runtime.txt`` to run the repository with R version RVERSION and libraries from a YYYY-MM-DD snapshot of `Posit Package Manager <https://packagemanager.posit.co/client/#/repos/2/overview>`__.
211211
RVERSION can be set to 3.4, 3.5, 3.6, or to patch releases for the 3.5 and 3.6 series.
212212
If you do not specify a version, the latest release will be used (currently R 3.6).
213213
See our `R example repository <https://github.com/binder-examples/r/blob/HEAD/runtime.txt>`_.

docs/source/howto/languages.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,14 @@ to install libraries from on the given date. You can install more R packages fro
6565
by adding a :ref:`install.R<install.R>` file to your repo. RStudio and IRKernel are
6666
installed by default for all R versions.
6767

68-
If you request R 4.1 or later, or specify a snapshot date newer than
69-
``2022-01-01``, `packagemanager.posit.co <https://packagemanager.posit.co/client/#/>`_
68+
`packagemanager.posit.co <https://packagemanager.posit.co/client/#/>`_
7069
will be used to provide much faster installations via `binary packages <https://www.rstudio.com/blog/package-manager-v1-1-no-interruptions/>`_.
7170
For *some* packages, this might require you install underlying system libraries
7271
using :ref:`apt.txt` - look at the page for the CRAN package you are interested in at
7372
`packagemanager.posit.co <https://packagemanager.posit.co/client/#/>`_ to find
7473
a list.
7574

76-
For older R versions with an older snapshot date, `MRAN <https://mran.microsoft.com/>`_
77-
is used as source of packages. This purely provides source packages, and you should
78-
migrate away from this if possible.
75+
repo2docker stopped using the Microsoft mirror MRAN for older R versions after its shutdown in July, 2023.
7976

8077

8178
Julia

repo2docker/buildpacks/r.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -229,30 +229,10 @@ def get_rspm_snapshot_url(self, snapshot_date, max_days_prior=7):
229229
)
230230
)
231231

232-
@lru_cache()
233-
def get_mran_snapshot_url(self, snapshot_date, max_days_prior=7):
234-
for i in range(max_days_prior):
235-
try_date = snapshot_date - datetime.timedelta(days=i)
236-
# Fall back to MRAN if packagemanager.posit.co doesn't have it
237-
url = f"https://mran.microsoft.com/snapshot/{try_date.isoformat()}"
238-
r = requests.head(url)
239-
if r.ok:
240-
return url
241-
raise ValueError(
242-
"No snapshot found for {} or {} days prior in mran.microsoft.com".format(
243-
snapshot_date.strftime("%Y-%m-%d"), max_days_prior
244-
)
245-
)
246-
247232
@lru_cache()
248233
def get_cran_mirror_url(self, snapshot_date):
249234
# Date after which we will use rspm + binary packages instead of MRAN + source packages
250-
rspm_cutoff_date = datetime.date(2022, 1, 1)
251-
252-
if snapshot_date >= rspm_cutoff_date or self.r_version >= V("4.1"):
253-
return self.get_rspm_snapshot_url(snapshot_date)
254-
else:
255-
return self.get_mran_snapshot_url(snapshot_date)
235+
return self.get_rspm_snapshot_url(snapshot_date)
256236

257237
@lru_cache()
258238
def get_devtools_snapshot_url(self):

tests/r/r3.6-mran/runtime.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

tests/r/r3.6-rspm/runtime.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
r-3.6-2017-11-01

tests/r/r3.6-mran/verify renamed to tests/r/r3.6-rspm/verify

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if (!(version$major == "3" && as.double(version$minor) >= 6 && as.double(version
77
quit("yes", 1)
88
}
99

10-
# Fail if MRAN isn't the configured CRAN mirror
11-
if (!(startsWith(options()$repos["CRAN"], "https://mran.microsoft.com"))) {
10+
# Fail if RSPM isn't the configured CRAN mirror
11+
if (!(startsWith(options()$repos["CRAN"], "https://packagemanager.posit.co"))) {
1212
quit("yes", 1)
1313
}

tests/r/r4.0-mran/install.R

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/r/r4.0-mran/runtime.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/r/r4.0-mran/verify

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)