Hello community, I have a question.
Have you had a problem loading the codejail settings in async tasks?
For some tasks it is required to run code in edxapp-sandbox through codejail and the settings are read with the middleware, but in edxapp async the middlewares are not run and it uses the default settings and in my case it is very little, this happens because example in the rescore of a loncapa problem.
I got this PR with an idea: wip: Load codejail configuration on-demand instead of on-initializtaion by kdmccormick · Pull Request #98 · openedx/codejail · GitHub
However I am not quite sure how to continue that work or if there is another way or a better approach to solve this problem.
How to replicate the problem:
- Have a course with an loncapa problem (such as advance problem > python-evaluated input)
- Have celery workers running in the devstack
Taken from the following pr: fix: xblock-poll's export to CSV feature is not working [TNL-8370] [MNG-2273] by bradenmacdonald · Pull Request #28019 · openedx/edx-platform · GitHub
It took me a while to figure out how to run celery workers on the docker devstack - am I missing some documentation?
make lms-shellthen edit
/edx/etc/lms.yml. Make sure
CELERY_QUEUESis as follows:
CELERY_QUEUES: - edx.lms.core.default - edx.lms.core.high - edx.lms.core.high_mem
(for some reason, on my devstack, these all had wrong values like
CELERY_DEFAULT_QUEUEhad a correct value, resulting in the worker never seeing the tasks)
Second, add this to
CELERY_ALWAYS_EAGER = False BROKER_URL = 'redis://:firstname.lastname@example.org:6379/'
Third, start Redis with
Fourth, restart the LMS.
make lms-shell, start a celery worker with
DJANGO_SETTINGS_MODULE=lms.envs.devstack_with_worker celery worker --app=lms.celery:APP
- Put a print in codejail plugin
codejail/jail_code.py at master · openedx/codejail · GitHub
- Do a rescore in Instructor > Student Admin and see that changes in devstack.py or common.py don’t change the codejail settings