Mount system Python binaries and libraries for generic image #256
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After #248 the new
:latestimage (as opposed to the:latest-pydis) image was in a broken state as the default Python symlinked to/usr/local/binwhich was then not mounted in nsjail.This PR fixes that by mounting the system Python interpreter to the container and mounting
/usr/local/lib(which in sneakbox images still only contains Python libraries and system-level dependencies).This will of course change the
:latest-pydisimage in that the system Python will now be available in the jail (whereas before it was only the specific versions we were adding), though I think this poses little problem for us as it's not going to be called by any of the calls frompython-discord/botand doesn't give any additional powers or capabilities. We could toggle this mounting off with a feature flag/config option somewhere but I think the gain is so minimal it's not worth it.The custom user base still stores additional dependencies that users may wish to add and is still looked at by the system Python when an evaluation is triggered.
Closes #255