cms icon indicating copy to clipboard operation
cms copied to clipboard

Use isolate's temporary directory rules

Open gollux opened this issue 6 years ago • 3 comments

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.

gollux avatar Aug 27 '18 21:08 gollux

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.

gollux avatar Aug 27 '18 21:08 gollux

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:

  1. we keep as is (CMS calls a chmod a+rwx -R /tmp before cleanup to allow the external user to issue the rmtree)
  2. we use your patch, move our /tmp to /workspace, assume no compiler will write undeletable files in /workspace, and change the chmod to a rm -rf /tmp/* inside isolate.
  3. if we change isolate's cleanup to also delete the content of /tmp, CMS can get rid of both chmod and rm.

stefano-maggiolo avatar Aug 29 '18 15:08 stefano-maggiolo

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)?

gollux avatar Aug 09 '22 17:08 gollux