Merge pull request #1119 from yuvipanda/delete-tmp

Delete /tmp/downloaded_packages after running install.R
pull/1122/head
Min RK 2022-01-26 09:02:27 +01:00 zatwierdzone przez GitHub
commit e3d0a9ae8e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -387,7 +387,10 @@ class RBuildPack(PythonBuildPack):
scripts += [
(
"${NB_USER}",
"Rscript %s && touch /tmp/.preassembled || true" % installR_path,
# Delete /tmp/downloaded_packages only if install.R fails, as the second
# invocation of install.R might be able to reuse them
"Rscript %s && touch /tmp/.preassembled || true && rm -rf /tmp/downloaded_packages"
% installR_path,
)
]
@ -403,7 +406,8 @@ class RBuildPack(PythonBuildPack):
(
"${NB_USER}",
# only run install.R if the pre-assembly failed
"if [ ! -f /tmp/.preassembled ]; then Rscript {}; fi".format(
# Delete any downloaded packages in /tmp, as they aren't reused by R
"""if [ ! -f /tmp/.preassembled ]; then Rscript {}; rm -rf /tmp/downloaded_packages; fi""".format(
installR_path
),
)