-
Notifications
You must be signed in to change notification settings - Fork 79
Description
Description
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 for example in the rescore of a loncapa problem.
I got this PR with an idea to solve the problem: #98
📌 But 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] openedx-platform#28019
It took me a while to figure out how to run celery workers on the docker devstack - am I missing some documentation?
First, use make lms-shell then edit /edx/etc/lms.yml . Make sure CELERY_QUEUES is 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 edx.lms.core.defaultedx.lms.core. , while CELERY_DEFAULT_QUEUE had a correct value, resulting in the worker never seeing the tasks)
Second, add this to lms/envs/private.py :
CELERY_ALWAYS_EAGER = False BROKER_URL = 'redis://:password@edx.devstack.redis:6379/'Third, start Redis with make
redis-upFourth, restart the LMS.
Fifth: from
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
https://github.com/openedx/codejail/blob/master/codejail/jail_code.py#L293
print("#"*30)
print(effective_limits)- Do a rescore in Instructor > Student Admin and see that changes in devstack.py or common.py don’t change the codejail settings
Other info
Discuss: https://discuss.openedx.org/t/problem-loading-the-codejail-settings-in-async-tasks/6545