Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
MoisesGSalas committed Dec 2, 2024
1 parent 29784bb commit 4a86cbb
Showing 1 changed file with 3 additions and 72 deletions.
75 changes: 3 additions & 72 deletions tutorcodejail/templates/codejail/build/codejail/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt install -y \
build-essential \
curl \
git \
language-pack-en \
llvm
language-pack-en
ENV LC_ALL=en_US.UTF-8

# Install python with pyenv in /opt/pyenv and create virtualenv in /openedx/venv

FROM minimal AS python
# https://github.com/pyenv/pyenv/wiki/Common-build-problems#prerequisites
RUN apt update && \
Expand All @@ -31,7 +27,6 @@ RUN apt update && \
python3-openssl \
subversion \
tk-dev \
wget \
xz-utils \
zlib1g-dev

Expand All @@ -49,7 +44,7 @@ RUN VERSION_ALIAS="{{ CODEJAIL_SANDBOX_PYTHON_VERSION }}_sandbox" \
RUN "$PYENV_ROOT/versions/$CODEJAILSERVICE_PYTHON_VERSION/bin/python" -m venv --copies /openedx/venv
RUN "$PYENV_ROOT/versions/"$SANDBOX_PYTHON_VERSION"_sandbox/bin/python" -m venv --copies /sandbox/venv

###### Codejail service code
# Codejail service code
FROM scratch AS codejail-code
ADD --keep-git-dir=true "{{ CODEJAIL_SERVICE_REPOSITORY }}#{{ CODEJAIL_SERVICE_VERSION }}" .

Expand Down Expand Up @@ -83,7 +78,6 @@ RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install '{{
{% endfor %}
{% endif %}


FROM minimal AS production
RUN apt update && \
apt install -y sudo
Expand All @@ -110,70 +104,7 @@ CMD [ "uwsgi" , \
"--thunder-lock", \
"--single-interpreter", \
"--enable-threads", \
"--processes=${UWSGI_WORKERS:-2}", \
"--processes=2", \
"--buffer-size=8192", \
"--max-requests=1000", \
"--wsgi-file=/openedx/codejailservice/wsgi.py" ]

# ###### Install python requirements in virtualenv
# FROM python AS codejailservice-python-requirements
#
# ENV PATH="/openedx/venv/bin:${PATH}"
# ENV VIRTUAL_ENV=/openedx/venv/
#
# COPY --from=code /openedx/codejailservice /openedx/codejailservice
# WORKDIR /openedx/codejailservice
# RUN pip3 install -r requirements/base.txt
# RUN pip3 install uwsgi==2.0.21
#
# ###### Install python requirements in virtualenv
# FROM python AS sandbox-python-requirements
#
# ARG EDX_PLATFORM_REPOSITORY="{{ EDX_PLATFORM_REPOSITORY }}"
# ARG EDX_PLATFORM_VERSION="{{ EDX_PLATFORM_VERSION }}"
#
# ENV PATH="/sandbox/venv/bin:${PATH}"
# ENV VIRTUAL_ENV=/sandbox/venv/
#
# WORKDIR /var/tmp
# RUN mkdir -p common/lib/
#
# ADD $EDX_PLATFORM_REPOSITORY#$EDX_PLATFORM_VERSION:requirements/edx-sandbox/releases .
# RUN pip3 install -r sumac.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 --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install '{{ extra_requirements }}'
# {% endfor %}
# {% endif %}
#
# ##### Prod image
# FROM minimal as production
#
# # Install system requirements
# RUN apt update && \
# apt install -y sudo
#
# COPY --from=code /openedx/codejailservice /openedx/codejailservice
# COPY --from=python /opt/pyenv /opt/pyenv
# COPY --from=codejailservice-python-requirements /openedx/venv /openedx/venv
# COPY --from=sandbox-python-requirements /sandbox/venv /sandbox/venv
#
# # Setup sandbox
# ENV SANDBOX_ENV=/sandbox/venv
# RUN groupadd -r sandbox && useradd -m -r -g sandbox sandbox && chown -R sandbox:sandbox /sandbox
#
# ENV PATH=/openedx/venv/bin:${PATH}
# ENV VIRTUAL_ENV=/openedx/venv/
# WORKDIR /openedx/codejailservice
#
# EXPOSE 8550
# CMD [ uwsgi, \
# "--http=0.0.0.0:8550", \
# "--thunder-lock", \
# "--single-interpreter", \
# "--enable-threads", \
# "--processes=${UWSGI_WORKERS:-2}", \
# "--buffer-size=8192", \
# "--max-requests=1000", \
# "--wsgi-file=/openedx/codejailservice/wsgi.py" ]

0 comments on commit 4a86cbb

Please sign in to comment.