Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Run the initialization jobs to install the required AppArmor profile on your hos
.. code-block:: bash

tutor config save
tutor local do init --limit codejail

Finally, the platform can be run as usual:

Expand Down Expand Up @@ -78,7 +77,7 @@ In most cases, you can work with the provided Docker image for the release. Howe

. Additional requirements are included in the sandbox via ``CODEJAIL_EXTRA_PIP_REQUIREMENTS``.
- A different version of Python is set for the sandbox environment via ``CODEJAIL_SANDBOX_PYTHON_VERSION``.
- The custom version of edx-platform that changes the contents of requirements/edx-sandbox.
- You are using a custom version of edx-platform that changes the contents of requirements/edx-sandbox.

Create a new image running:

Expand Down Expand Up @@ -162,24 +161,6 @@ Once the course is imported, go to any section and select an exercise (`section

In this case, the section's content will render correctly and work as specified in the instructions of the problem.

Possible failure case
~~~~~~~~~~~~~~~~~~~~~

In case you forget to run ``tutor local do init --limit codejail`` for AppArmor profile, this error in
``Studio`` will arise::

Error formatting HTML for the problem:
cannot create LoncapaProblem block-v1:edX+DemoX+Demo_Course+type@problem+block@integral1: Error while
executing script code: Codejail API Service is unavailable. Please try again in a few minutes.

.. image:: ./docs/resources/Codejailfail.png
:width: 750px
:align: center
:alt: Example when codejail is not working

This indicates that the Codejail service is either not turned on or not working properly. Please ensure to follow
the steps outlined in the usage section to prevent this issue.

How to Contribute
-----------------

Expand Down
21 changes: 0 additions & 21 deletions tutorcodejail/patches/k8s-jobs

This file was deleted.

9 changes: 0 additions & 9 deletions tutorcodejail/patches/local-docker-compose-jobs-services

This file was deleted.

15 changes: 15 additions & 0 deletions tutorcodejail/patches/local-docker-compose-services
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,18 @@ codejailservice:
- ../plugins/codejail/apps/config/tutor.py:/openedx/codejailservice/codejailservice/tutor.py:ro
- ../../data/codejail:/openedx/data
restart: unless-stopped
depends_on:
- codejail-apparmor-loader

codejail-apparmor-loader:
image: {{ CODEJAIL_APPARMOR_DOCKER_IMAGE }}
privileged: true
command:
- /usr/bin/loader
- -logtostderr
- -v=2
- /profiles
volumes:
- ../plugins/codejail/apps/profiles/docker-edx-sandbox:/profiles/docker-edx-sandbox:ro
- /sys:/sys
- /etc/apparmor.d:/etc/apparmor.d
20 changes: 0 additions & 20 deletions tutorcodejail/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,6 @@ def get_apparmor_abi():
]
)

# To add a custom initialization task, create a bash script template under:
# tutorcodejail/templates/codejail/tasks/
# and then add it to the MY_INIT_TASKS list. Each task is in the format:
# ("<service>", ("<path>", "<to>", "<script>", "<template>"))
MY_INIT_TASKS: list[tuple[str, tuple[str, ...], int]] = [
("codejail-apparmor", ("codejail", "tasks", "codejail-apparmor", "init"), hooks.priorities.HIGH),
]


# For each task added to MY_INIT_TASKS, we load the task template
# and add it to the CLI_DO_INIT_TASKS filter, which tells Tutor to
# run it as part of the `init` job.
for service, template_path, priority in MY_INIT_TASKS:
full_path: str = str(
importlib_resources.files("tutorcodejail") / os.path.join("templates", *template_path)
)
with open(full_path, encoding="utf-8") as init_task_file:
init_task: str = init_task_file.read()
hooks.Filters.CLI_DO_INIT_TASKS.add_item((service, init_task), priority=priority)


hooks.Filters.IMAGES_BUILD.add_item((
"codejail",
Expand Down
Empty file.

This file was deleted.