Git Product home page Git Product logo

codejailservice's People

Contributors

ericfab179 avatar henrrypg avatar johanseto avatar juandavidbuitrago avatar mafermazu avatar mariajgrimaldi avatar moisesgsalas avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

codejailservice's Issues

Adjust versioning scheme

This web service is tied to the tutor-contrib-codejail and at the moment it follows the tutor versioning scheme (each major version reflects an openedx release, starting with 10->Juniper).

The main problem is that each tag in the tutor plugins must hava a mirror in the codejailservice repository, because that's how code for the image is retrieved.

I propose instead that we use something more akin to the way tutor plugins and IDAs map. IDAs (like edx_notes_api, cs_comments_service) use the open-release/<release-name>.<tag-number> for versioning and their plugins keep an additional variable that points to the open-release tag while retaining the tutor versioning system.

I think the redwood upgrade is a good opportunity for this. We can probably start using release/redwood.1 taking into account the renaming of release branches for sumac (see: Should we rename the release branches?)

["BUG"] Import Error while importing a python library .STDERR ,STDOUT

I have installed a stack of OpexEDX platform using Tutor and installed OpexEdx "Codejail" plugin using below link

pip install git+https://github.com/edunext/tutor-contrib-codejail

https://github.com/eduNEXT/tutor-contrib-codejail

I am facing a problem during working on the code jail while importing python matplotlib library.

importing the same library inside codejail container is working fine. the only problem is import through OpnexEdx code block. > advance black > problem.
I have already installed the Codejail and Matplotlib on docker.

I have to run this code. which gives error

<problem>
<script type="loncapa/python">
import matplotlib
</script>
</problem>

import os works fine
but getting error while
import matplotlib

detail of current stack:

  • open edx version : openedx-mfe:14.0.1
  • code jail version : codejailservice:14.1.0
  • please see the error message below

cannot create LoncapaProblem block-v1:VUP+Math101+2022+type@problem+block@3319c4e42da64a74b0e40f048e3f2599: Error while executing script code: Couldn't execute jailed code: stdout: b'', stderr: b'Traceback (most recent call last):\n File &#34;jailed_code&#34;, line 19, in <module>\n exec(code, g_dict)\n File &#34;<string>&#34;, line 66, in <module>\n File &#34;/sandbox/venv/lib/python3.8/site-packages/matplotlib/__init__.py&#34;, line 921, in <module>\n dict.update(rcParams, rc_params_in_file(matplotlib_fname()))\n File &#34;/sandbox/venv/lib/python3.8/site-packages/matplotlib/__init__.py&#34;, line 602, in matplotlib_fname\n for fname in gen_candidates():\n File &#34;/sandbox/venv/lib/python3.8/site-packages/matplotlib/__init__.py&#34;, line 599, in gen_candidates\n yield os.path.join(get_configdir(), \'matplotlibrc\')\n File &#34;/sandbox/venv/lib/python3.8/site-packages/matplotlib/__init__.py&#34;, line 239, in wrapper\n ret = func(**kwargs)\n File &#34;/sandbox/venv/lib/python3.8/site-packages/matplotlib/__init__.py&#34;, line 502, in get_configdir\n return get_config_or_cache_dir(_get_xdg_config_dir())\n File &#34;/sandbox/venv/lib/python3.8/site-packages/matplotlib/__init__.py&#34;, line 474, in get_config_or_cache_dir\n tempfile.mkdtemp(prefix=&#34;matplotlib-&#34;)\n File &#34;/opt/pyenv/versions/3.8.6_sandbox/lib/python3.8/tempfile.py&#34;, line 347, in mkdtemp\n prefix, suffix, dir, output_type = sanitize_params(prefix, suffix, dir)\n File &#34;/opt/pyenv/versions/3.8.6_sandbox/lib/python3.8/tempfile.py&#34;, line 117, in sanitize_params\n dir = gettempdir()\n File &#34;/opt/pyenv/versions/3.8.6_sandbox/lib/python3.8/tempfile.py&#34;, line 286, in gettempdir\n tempdir = get_default_tempdir()\n File &#34;/opt/pyenv/versions/3.8.6_sandbox/lib/python3.8/tempfile.py&#34;, line 218, in _get_default_tempdir\n raise FileNotFoundError(_errno.ENOENT,\nFileNotFoundError: [Errno 2] No usable temporary directory found in [\'/tmp\', \'/var/tmp\', \'/usr/tmp\', \'/tmp/codejail-lbfd69da\']\n' with status code: 1. For more information check Codejail Service logs.

Codejail service logs are as follows:

{"log":"[pid: 6|app: 0|req: 20/39] 172.18.0.10 () {36 vars in 483 bytes} [Tue Nov 22 11:24:59 2022] POST /api/v0/code-exec =\u003e generated 1978 bytes in 742 msecs (HTTP/1.1 200) 2 headers in 73 bytes (1 switches on core 0)\n","stream":"stderr","time":"2022-11-22T11:25:00.151315626Z"} {"log":"2022-11-22 11:26:23,304 INFO 9 [codejailservice.app] code_exec_service.py:52 - Running problem_id:53fbaa04859f41989ab967c15a12c013 jailed code for course_id:course-v1:VUP+Math101+2022 ...\n","stream":"stderr","time":"2022-11-22T11:26:23.30489438Z"} {"log":"2022-11-22 11:26:23,343 INFO 9 [codejailservice.app] code_exec_service.py:73 - Jailed code was executed in 0.03849988000001758 seconds.\n","stream":"stderr","time":"2022-11-22T11:26:23.343618965Z"} {"log":"[pid: 9|app: 0|req: 20/40] 172.18.0.10 () {36 vars in 483 bytes} [Tue Nov 22 11:26:23 2022] POST /api/v0/code-exec =\u003e generated 73 bytes in 40 msecs (HTTP/1.1 200) 2 headers in 71 bytes (1 switches on core 0)\n","stream":"stderr","time":"2022-11-22T11:26:23.344178308Z"} {"log":"2022-11-23 04:15:24,786 INFO 6 [codejailservice.app] code_exec_service.py:52 - Running problem_id:3319c4e42da64a74b0e40f048e3f2599 jailed code for course_id:course-v1:VUP+Math101+2022 ...\n","stream":"stderr","time":"2022-11-23T04:15:24.786287416Z"} {"log":"2022-11-23 04:15:25,582 ERROR 6 [codejailservice.app] code_exec_service.py:70 - Error found while executing jailed code.\n","stream":"stderr","time":"2022-11-23T04:15:25.582527974Z"} {"log":"[pid: 6|app: 0|req: 21/41] 172.18.0.10 () {36 vars in 483 bytes} [Wed Nov 23 04:15:24 2022] POST /api/v0/code-exec =\u003e generated 1978 bytes in 798 msecs (HTTP/1.1 200) 2 headers in 73 bytes (1 switches on core 0)\n","stream":"stderr","time":"2022-11-23T04:15:25.583132326Z"} {"log":"2022-11-23 06:00:15,150 INFO 9 [codejailservice.app] code_exec_service.py:52 - Running problem_id:3319c4e42da64a74b0e40f048e3f2599 jailed code for course_id:course-v1:VUP+Math101+2022 ...\n","stream":"stderr","time":"2022-11-23T06:00:15.15073834Z"} {"log":"2022-11-23 06:00:15,891 ERROR 9 [codejailservice.app] code_exec_service.py:70 - Error found while executing jailed code.\n","stream":"stderr","time":"2022-11-23T06:00:15.8916806Z"} {"log":"[pid: 9|app: 0|req: 21/42] 172.18.0.10 () {36 vars in 483 bytes} [Wed Nov 23 06:00:15 2022] POST /api/v0/code-exec =\u003e generated 1978 bytes in 742 msecs (HTTP/1.1 200) 2 headers in 73 bytes (1 switches on core 0)\n","stream":"stderr","time":"2022-11-23T06:00:15.892225441Z"}

["FEAT"] Support for K8s deployments

Is your feature request related to a problem? Please describe.
Codejail plugin currently does not work out of the box in K8s deployments because it requires the apparmor profiles to be set in the nodes

Describe the solution you'd like
I would like the plugin to set the apparmor profiles in the K8s nodes transparently for the user.

Describe alternatives you've considered
There is a previous discussion in the old Tutor forum.
The Kubernets documentation mentions three alternatives to address this problem.
The DaemonSet approach seems to be the most appropriate for this case.

Additional context
As nodes depend on the underlying infrastructure, it can be a challenge to make something general.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.