-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[BD-13] refactor: deprecates ModuleSystem properties related to code sandboxing #29260
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
Conversation
|
Thanks for the pull request, @pomegranited! I've created BLENDED-1005 to keep track of it in Jira. More details are on the BD-13 project page. When this pull request is ready, tag your edX technical lead. |
3871b27 to
6fc4322
Compare
|
jenkins run python |
7cf3455 to
c82aab0
Compare
|
jenkins run python |
7cb3749 to
914b809
Compare
d3757da to
3352024
Compare
de362ec to
d30e673
Compare
|
jenkins run python |
9e51a7e to
d8e32e5
Compare
|
Hi @ormsbee , are you able to review and merge this OSPR? CC @symbolist The test failure looks unrelated (and intermittant): but I don't know how to trigger a re-run of these unit tests? |
|
@pomegranited: I'm re-running the tests. I might not get to review this until tomorrow though. Is this blocking other BD-13 work? |
|
Thank you @ormsbee ! Nope, this isn't blocking other BD-13 work, so tomorrow is perfectly fine. |
ormsbee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks fine to me. I think this mostly comes down to how we want to test it before trying to merge it in.
@pdpinch: Any thoughts on this? This is refactoring work so it's not supposed to result in user-facing changes, but it's code sandboxing, which means that if there is a regression, it's very likely to hit advanced MIT content first. 😛
|
@ormsbee @pdpinch You're welcome to use the sandbox server for testing, it's running the current version of this branch:
It has the usual demo users on it, so you can use There's a working custom python problem, and one that demonstrates a PermissionDenied error, but you're welcome to add more courses/units and test however you need. |
|
Would it be possible to enable the python_lib.zip feature? I thought that the most thorough way to test this would be to run the demo course in https://github.com/mitodl/mitx-grading-library but it looks like the course can't find the python library (for example). |
|
Your PR has finished running tests. There were no failures. |
|
@pdpinch CC @ormsbee @Agrendalath I've resolved conflicts created when the other BD-13 PRs merged, and deployed a new sandbox server using the latest code. Could you please verify that your MITx Grading Library problems are working correctly, and let me know if anything needs to be fixed before this can be merged? |
|
Nudge @pdpinch CC @ormsbee @Agrendalath :) |
|
So sorry that I lost track of this. I'm finding that the first problem in the MITx Grading Library test course isn't behaving as advertised. I'm going to continue testing today/tomorrow to try to come up with an explanation, and also review other problems, but I didn't want to hold up this key bit of feedback any longer. |
|
I tested up through formula grader, but I need to take a break. I'm really not sure what's up with the first problem. Most everything else is working, except:
I'll test these on edge as a comparison point. |
|
Hi @pdpinch , thanks for testing your custom problems on edge too. I don't think this change would have caused the kind of issues you're seeing -- basically, either codejail would work or it wouldn't work -- but we need to be sure before merging. |
|
@pomegranited sorry again for being slow to follow up. I've gone through the entire MITx Graders course now. I reviewed the first problem again and now it seems to be working. The most likely explanation is I misunderstood the directions. The other issues I noted are still there:
I confirmed this is a pre-existing issue by testing on edge.edx.org
The behavior here is different on the sandbox from edX. Since this a problem that uses sampling, I imagine it might be some subtle difference between the sandbox and edge. I'll consult with someone who knows more about the inner workings, but I don't think this, by itself, should stop you from proceeding with this PR. |
|
I think that means we're good to go, but please don't merge until tomorrow (Jan 19). It's my understanding that edX is being extra careful about release today. FYI @jristau1984, @doctoryes, @connorhaugh, @kenclary |
|
Out of an abundance of caution, I also tested to make sure that python_lib.zip is not available via an unauthorized or unauthenticated browser request. I'm relieved to say that it is not and the following URL returned a 404 as expected: https://pr29260.sandbox.opencraft.hosting/asset-v1:MITx+demo+3T2021+type@asset+block@python_lib.zip |
|
Looks like there are some pylint failures. I'll try running the tests again. |
Looks like pylint has changed its mind about some import ordering.. Hopefully this fix will sort it. |
|
... and it has! |
|
@pomegranited this passed tests. Do you want to squash it? |
…cache * Deprecates ModuleSystem can_execute_unsafe_code, get_python_lib_zip and cache properties * Adds a new CacheService and SandboxService to provide the deprecated property * Adds tests for the added CacheService and SandboxService * Updates the ModuleSystemShim tests in Lms and Studio
so that both tests succeed on local devstack and in CI.
b8e8f8a to
23a0d9f
Compare
|
Thanks @pdpinch -- squashed and rebased. |
|
@pomegranited since this touches a sensitive area of the code base on edx.org, I'm making sure that we have someone monitoring the deployment and available to do a rollback if necessary. Question for you: are there any concerns about rolling this back, if it is necessary? I don't see anything myself, but is there anything we should know, perhaps about caching? |
|
@pdpinch Nope, it should roll back cleanly if there are any issues in production. |
|
@pomegranited 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
Thanks @pomegranited! |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
|
Woo hoo!! Thank you so much for testing this thorougly @pdpinch , and for getting it merged! |
Description
Builds on the shim added by https://github.com/edx/edx-platform/pull/29190 to deprecate the following
ModuleSystemattributes which are only used by CAPA problems:cache: deprecated in favour of the added CacheServicecan_execute_unsafe_code,get_python_lib_zip: deprecated in favour of the added SandboxServiceAlso fixes the
safe_exec.tests.TestSafeOrNot.test_cant_do_something_forbiddentest , which was failing on my devstack with latest master. But since Jenkins and the github CI don't run in a virtualenv, this test is skipped, so this issue had gone unnoticed.This change is only a refactoring, and should not affect Learners, Course Authors, or anyone else using edx-platform.
Supporting information
Testing instructions
LMS:
honor@example.com/edx)Regression testing:
Studio:
staff@example.com/edx)safe_exec:
In your devstack's
lms-shell, run the following command, and ensure all tests pass.Deadline
None