Skip to content

Commit

Permalink
feat: allows you to add extra pip requirements to your codejail sandb…
Browse files Browse the repository at this point in the history
…ox DS-697 (#42)

* feat: allows you to add extra pip requirements to your codejail sandbox

* docs: update the readme to add the new feature
  • Loading branch information
MaferMazu authored Nov 18, 2023
1 parent ede19c8 commit ec78ac6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------
Expand Down
6 changes: 6 additions & 0 deletions tutorcodejail/templates/codejail/build/codejail/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ec78ac6

Please sign in to comment.