Giter Club home page Giter Club logo

jobeinabox's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jobeinabox's Issues

Numpy installation: failed to map segment from shared object

Hi!

I ran into the following error while trying to import numpy. import numpy works inside the python3 interactive session from cli inside the docker. Might be related to this issue ?

Error:

***Error***
Traceback (most recent call last):
  File "__tester__.python3", line 1, in <module>
    import numpy as np
  File "/usr/local/lib/python3.6/dist-packages/numpy/__init__.py", line 152, in <module>
    from . import random
  File "/usr/local/lib/python3.6/dist-packages/numpy/random/__init__.py", line 181, in <module>
    from . import _pickle
  File "/usr/local/lib/python3.6/dist-packages/numpy/random/_pickle.py", line 1, in <module>
    from .mtrand import RandomState
  File "_bit_generator.pxd", line 14, in init numpy.random.mtrand
ImportError: /usr/local/lib/python3.6/dist-packages/numpy/random/_bit_generator.cpython-36m-x86_64-linux-gnu.so: failed to map segment from shared object

cannot start `sh': Resource temporarily unavailable

Hello, we are using JOBE for some year now, now we are switching to a new (virtual) Server. I start the JOBE Docker container like on the old Server!

But launching a Code Runner Question i've got the following error-message:

/var/www/html/jobe/application/libraries/../../runguard/runguard: cannot start `sh': Resource temporarily unavailable
Try `/var/www/html/jobe/application/libraries/../../runguard/runguard --help' for more information.

Did you have any idea what could go wrong ?

best regards

jtuttas

buster problem

hi,
I'm running jobeinabox in a debian buster host and a strange error of permission arise:

Syntax Error(s)
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.6/py_compile.py", line 186, in <module>
    sys.exit(main())
  File "/usr/lib/python3.6/py_compile.py", line 178, in main
    compile(filename, doraise=True)
  File "/usr/lib/python3.6/py_compile.py", line 136, in compile
    os.makedirs(dirname)
  File "/usr/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '__pycache__'

same for C program: linker can't write output file.
same box running in test environment on my macos mojave gives no problems.
could you help me?
max

Make container runnable as non root user

Hi there,

as I want to move the jobe container in to our Kubernetes cluster, the container needs to run as non root user.
Would it be possible to change the image, to be run as non root?

matplotlib Warning About Temporary Files in /tmp

We have been playing with jobinabox, everything has been going well so far, so a big thanks!

We had a minor issue with matplotlib complaining about the tmp location:

Matplotlib created a temporary config/cache directory at /tmp/matplotlib-79ubm2uq because the default path (/home/jobe00/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.

I dropped into the docker container and added /home/jobe00 and set it as writable for the user jobe00 which did resolve the warning message. When a questions get processed, it does create some tmp files as expected. I'm guessing this isn't the optimal solution here as we ideally want each runguard job to run without any cached files.

I thought I might be able to set export MPLCONFIGDIR=/tmp in bashrc or profile.d but this doesn't get picked when the runguard user jobe00 processes the job.

Any guidance would be great, cheers!

Vulnerable openjdk-16-jdk Ubuntu package without patch

Jobeinabox relies on Ubuntu 20.04's openjdk-16-jdk package, which is vulnerable to multiple CVEs as described at https://openjdk.java.net/groups/vulnerability/advisories/2021-07-20 -CVE-2021-2388, CVE-2021-2369, and CVE-2021-2341. Ubuntu does not seem to be patching these CVEs, even though they are from July. Specifically the openjdk-16-jdk release utilized in jobeinabox does not appear in their security tracker for any of the referenced CVEs. (See https://ubuntu.com/security/cve-2021-2388, https://ubuntu.com/security/cve-2021-2369, and https://ubuntu.com/security/cve-2021-2341 .) These Medium priority security issues seem to be never addressed in a timely manner. These CVEs do show up in security scanning software suites quite frequently, and a freshly built container today contains these vulnerabilities.

I've made a pull request that addresses the issue by utilizing the Docker openjdk:16-jdk image as a layer instead of the built-in Ubuntu package. This is better maintained for security, and bumps the version to 16.0.2 which addresses these vulnerabilities. The Dockerfile now utilizes a multi-layer approach for building the image. See #10

I did basic testing of the system and it seems to be working correctly with this change in my instance, but please perform some additional testing before merging this.

Submission problem in container environment

Hi,
I installed a containerized version of moodle provided by bitnami (moodle 4.0.3 + mysql containers).
I added to this environment jobeinabox container.
I get a problem when try to check my code by coderunner plugin.
Here some details:
the file
/bitnami/moodle/question/type/coderunner/classes/jobesandbox.php
run on moodle container
shows this message:
http://172.19.0.1:4000/jobe/index.php/restapi/runs/
headers: array (
0 => 'User-Agent: CodeRunner',
1 => 'Content-Type: application/json; charset=utf-8',
2 => 'Accept-Charset: utf-8',
3 => 'Accept: application/json',
4 => 'X-CodeRunner-Job-Id: 1b20e7eb',
)
resource: 'runs'
body: '{"run_spec":{"language_id":"python3","sourcecode":"def sqr(n):\r\n return n\n\n__student_answer__ = \"\"\"def sqr(n):\r\n return n\"\"\"\n\nSEPARATOR = \"#<ab@17943918#@>#\"\n\nprint(sqr(-5))\nprint(SEPARATOR)\nprint(sqr(-7))\n","sourcefilename":"tester.python3","input":"\n","file_list":[],"parameters":[]}}'
URL http://172.19.0.1:4000/jobe/index.php/restapi/runs/
response: 'The URL is blocked.'

As you can see the response is 'The URL is blocked.
But if I run the testsubmit.py script on the same moodle container: all seems OK

root@4fc0375b2cd4:/# python3 testsubmit.py
Supported languages:
/jobe/index.php/restapi/languages
{'Content-type': 'application/json; charset=utf-8', 'Accept': 'application/json', 'X-API-KEY': '2AAA7A5415B4A9B394B54BF1D2E9D'}
None
c: 9.4.0
cpp: 9.4.0
java: 16.0.1
nodejs: 10.19.0
octave: 5.2.0
pascal: 3.0.4
php: 7.4.3
python3: 3.8.10

/jobe/index.php/restapi/runs/
{'Content-type': 'application/json; charset=utf-8', 'Accept': 'application/json', 'X-API-KEY': '2AAA7A5415B4A9B394B54BF1D2E9D'}
{"run_spec": {"language_id": "python3", "sourcecode": "print("Hello world!")\n", "sourcefilename": "test.py"}}
Valid Python3 OK
/jobe/index.php/restapi/runs/
{'Content-type': 'application/json; charset=utf-8', 'Accept': 'application/json', 'X-API-KEY': '2AAA7A5415B4A9B394B54BF1D2E9D'}
{"run_spec": {"language_id": "python3", "sourcecode": "print(input())\nprint(input())\n", "input": "Line1\nLine2\n", "sourcefilename": "test.py"}}
Python3 with stdin OK

here the conf of my docker environment:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ede7964e517a localhost/jobe "/usr/sbin/apache2ct…" 22 hours ago Up 57 minutes (healthy) 0.0.0.0:4000->80/tcp, :::4000->80/tcp jobe
4fc0375b2cd4 moodle_moodle "/opt/bitnami/script…" 25 hours ago Up 57 minutes 0.0.0.0:80->8080/tcp, :::80->8080/tcp, 0.0.0.0:443->8443/tcp, :::443->8443/tcp moodle
73e3ee3b6057 bitnami/mariadb:10.6 "/opt/bitnami/script…" 25 hours ago Up 57 minutes 3306/tcp mysql

many thxs

Andrea

Some pip3 packages not found by Jobe but working in Python3

Hello again!

I've forked this repository and added some pip3 packages that we use here to teach AI / Data Science. You can see our Dockerfile from here.

The problem I am currently facing is that most of the pip libraries do work, but some of them do not work. These libraries are giving me the "ModuleNotFoundError" when trying to run my code from the CodeRunner Moodle plugin: spacy, pillow, skimage, pandas. The weird thing is that if I login into my running docker container and run python3 and try importing the libraries, they all get imported without problems. The same thing goes when I even login to user jobe00 / jobe01, start Python3 and try importing these libraries. They work from there, but not when trying to import through the CodeRunner Moodle plugin.

Exact error messages when trying to import are here:

import spacy
***Run error***
Traceback (most recent call last):
  File "__tester__.python3", line 1, in <module>
    import spacy
ModuleNotFoundError: No module named 'spacy'
from PIL import Image
***Run error***
Traceback (most recent call last):
  File "__tester__.python3", line 4, in <module>
    from PIL import Image
ModuleNotFoundError: No module named 'PIL'
import skimage
***Run error***
Traceback (most recent call last):
   File "__tester__.python3", line 4, in <module>
      import skimage
ModuleNotFoundError: No module named 'skimage'
--
import pandas as pd
***Run error***
Traceback (most recent call last):
  File "__tester__.python3", line 2, in <module>
    import pandas as pd
ModuleNotFoundError: No module named 'pandas'

Any ideas? :)

PHP Error

The new image of jobe server is throwing PHP error

image

Trying to make sure I understand dependencies

Hello, I'm building a jobe server docker container to use with some tools for programming classes I teach. Since I only need certain languages I'm looking at stripping down the packages installed into the container. As part of that (and to generally try to understand things better) I'm trying to categorize the packages currently installed. This is what I came up with. Does it this look right?

Used by server at run time

These packages seem like things that are required by the jobe server at run time.

acl                -- Something permissions.
apache2            -- The Apache server.
libapache2-mod-php -- Integrate PHP into Apache.
php                -- PHP
php-cli            -- PHP command line, I assume. Needed at run time?
php-mbstring       -- Deal with multi-byte strings in PHP.
sqlite3            -- Used by server.
sudo               -- Used by server.

Used during installation

These packages, as far as I can tell, are used during installation but are not needed after that and could be removed after the install script has been run unless they are also needed for a language you want to support.

build-essential    -- gcc is used by the install script to build runguard.
git                -- Used during docker container build to fetch jobe itself. Otherwise?
python3            -- Install and test scripts are in python.
python3-pip        -- Used at container build time to install `pylint`. (Is pylint used by jobs?)

Used by languages

I assume these packages can be skipped (or removed after installation) if you don't want to support jobs in that language. Is that correct?

build-essential    -- Needed to support C and C++ jobs. Needed otherwise at run time?
default-jdk        -- Needed to support Java jobs.
fp-compiler        -- Needed to support Pascal jobs.
nodejs             -- Needed to support Node jobs.
octave             -- Needed to support Octave jobs.
python3            -- Needed to support Python jobs.
python3-pip        -- Used at container build time. Maybe for Python jobs?

Not listed in jobe README but in Dockerfile

These are installed into the container but are not mentioned in the README from the main jobe repo. I couldn't figure out what they were used for.

python3-setuptools -- use to build Python packages. Is this needed for Python jobs?
tzdata             -- Not sure where this is needed.
unzip              -- Not sure where this is needed.

Worked 3/4 days ago, now unable to fork..?

One of our teachers reported this urgent issue. She has an exam in tomorrow morning but Moodle's CodeRunner suddenly broke.

CodeRunner started to give the error "the sandbox may be down". I see there was a new version from Dockerhub 4 days ago.

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.