From 8e48ffb2885b693a28f75054d8454f54074083c5 Mon Sep 17 00:00:00 2001 From: Maria Fernanda Magallanes Zubillaga Date: Wed, 15 Nov 2023 16:57:24 -0500 Subject: [PATCH 1/2] feat: allows you to add extra pip requirements to your codejail sandbox --- tutorcodejail/templates/codejail/build/codejail/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tutorcodejail/templates/codejail/build/codejail/Dockerfile b/tutorcodejail/templates/codejail/build/codejail/Dockerfile index d2ce8c1..8d8edb2 100644 --- a/tutorcodejail/templates/codejail/build/codejail/Dockerfile +++ b/tutorcodejail/templates/codejail/build/codejail/Dockerfile @@ -54,6 +54,12 @@ RUN mkdir -p common/lib/ COPY --from={{ DOCKER_IMAGE_OPENEDX }} /openedx/edx-platform/requirements/edx-sandbox/py38.txt py38.txt RUN pip3 install -r py38.txt +# Allows you to add extra pip requirements to your codejail sandbox. +{% if CODEJAIL_EXTRA_PIP_REQUIREMENTS is defined %} +{% for extra_requirements in CODEJAIL_EXTRA_PIP_REQUIREMENTS %}RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip,sharing=shared {% endif %}pip install '{{ extra_requirements }}' +{% endfor %} +{% endif %} + ##### Prod image FROM minimal as production From 335fcfc026201bdd1530978fe1f78939c7792e05 Mon Sep 17 00:00:00 2001 From: Maria Fernanda Magallanes Zubillaga Date: Sat, 18 Nov 2023 12:38:44 -0500 Subject: [PATCH 2/2] docs: update the readme to add the new feature --- README.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.rst b/README.rst index 92e058e..4d3640a 100644 --- a/README.rst +++ b/README.rst @@ -43,6 +43,13 @@ Configuration - ``CODEJAIL_ENABLE_K8S_DAEMONSET`` (default: ``False``) - ``CODEJAIL_SKIP_INIT`` (default: ``False``) - ``CODEJAIL_SANDBOX_PYTHON_VERSION`` (default: ``3.8.6``) +- ``CODEJAIL_EXTRA_PIP_REQUIREMENTS`` (optional) A list of pip requirements to add to your sandbox. + + .. code-block:: yaml + + CODEJAIL_EXTRA_PIP_REQUIREMENTS: + - pybryt + Compatibility -------------