Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use isolate's temporary directory rules #1005

Open
gollux opened this issue Aug 27, 2018 · 3 comments
Open

Use isolate's temporary directory rules #1005

gollux opened this issue Aug 27, 2018 · 3 comments

Comments

@gollux
Copy link
Contributor

gollux commented Aug 27, 2018

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
Copy link
Contributor Author

gollux commented Aug 27, 2018

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.

@stefano-maggiolo
Copy link
Member

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.

@gollux
Copy link
Contributor Author

gollux commented Aug 9, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants