cms
cms copied to clipboard
Use isolate's temporary directory rules
As previously discusse with @stefano-maggiolo in PR #992, I taught isolate to create temporary directories on request, and /tmp by default. It would be nice to use it in CMS.
Sorry, I forgot to mention that it is not yet in any release of isolate, but once you are happy with the feature, I will release it quickly.
I haven't tested it yet, but let's see if we are synced.
The problem we have is that, to preserve space, we want to delete all files involved in compilations and evaluations. Usually we just rmtree the temp directory we use for the operation (and that we map inside isolate's environment on /tmp). Some compilers though create subdirectories and files therein that are impossible to delete as the regular user running isolate (as they are created as the user running within isolate).
With this change, we could map our temp directory to something else than /tmp, say /workspace, and ask isolate to create a temp directory to be mapped to /tmp. This will probably "solve" the problem of not being able to delete /workspace, (I'd guess the files created by the compilers are created in /tmp, not in ./), but those files will still not be cleaned up automatically - actually, we'd have an additional directory whose content we need to delete manually :)
I see three alternatives:
- we keep as is (CMS calls a
chmod a+rwx -R /tmp
before cleanup to allow the external user to issue the rmtree) - we use your patch, move our /tmp to /workspace, assume no compiler will write undeletable files in /workspace, and change the
chmod
to arm -rf /tmp/*
inside isolate. - if we change isolate's cleanup to also delete the content of /tmp, CMS can get rid of both
chmod
andrm
.
Sorry for letting it sleep for so long...
Is it necessary to create the files in a separate workspace instead of the /box
directory provided by Isolate (where file owners are handled by Isolate, so that no undeletable files should ever arise)?