File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -387,7 +387,10 @@ def get_preassemble_scripts(self):
387387 scripts += [
388388 (
389389 "${NB_USER}" ,
390- "Rscript %s && touch /tmp/.preassembled || true" % installR_path ,
390+ # Delete /tmp/downloaded_packages only if install.R fails, as the second
391+ # invocation of install.R might be able to reuse them
392+ "Rscript %s && touch /tmp/.preassembled || true && rm -rf /tmp/downloaded_packages"
393+ % installR_path ,
391394 )
392395 ]
393396
@@ -403,7 +406,8 @@ def get_assemble_scripts(self):
403406 (
404407 "${NB_USER}" ,
405408 # only run install.R if the pre-assembly failed
406- "if [ ! -f /tmp/.preassembled ]; then Rscript {}; fi" .format (
409+ # Delete any downloaded packages in /tmp, as they aren't reused by R
410+ """if [ ! -f /tmp/.preassembled ]; then Rscript {}; rm -rf /tmp/downloaded_packages; fi""" .format (
407411 installR_path
408412 ),
409413 )
You can’t perform that action at this time.
0 commit comments