Skip to content

Grading environments for UNCode. Here are found the containers in charge of grading students' submissions for UNCode.

License

Notifications You must be signed in to change notification settings

JuezUN/INGInious-containers

 
 

Repository files navigation

UNCode containers

Build Status License Contributors GitHub issues Codacy Badge CLA assistant Gitter

This repository contains all different grading containers for UNCode which are available on Docker Hub.

Not all the containers are used for UNCode, some of them where created for INGInious-containers, thus, only the ones we have developed and use are explained here.

Containers:

The image below shows the hierarchy of the different containers:

containers hierarchy diagram

The code related to this container is in the main repository. This container contains all the logic to run the submissions and send back the feedback to the student.

This container is not directly in charge of evaluating a student's submission, it contains code that all the other containers use to evaluate the submission in the correct environment. The code is in grading/uncode. This container also contains the translations for different grading containers

This container is in charge of evaluating C/C++, Java 7/8 and Python3 submissions as well as custom input executions. Here are accepted either single code submission or file project submissions. The code is in grading/multilang.

As this container inherits from the multilang container, it does not add any different way to evaluate the submission, the difference of this container is that it allows submission that uses python modules commonly used in data science, such as Pandas, Numpy, among others. The Dockerfile is in grading/data_science.

Container in charge of grading notebook submissions, for that, it receives a .ipynb file with the student's code. Thus, this is a different grading environment which can be selected in the task settings on UNCode. The code is located in grading/notebook.

Submissions with Verilog and VHDL code are graded inside this container. The code is in grading/hdl.

Getting started

Built with

Each mentioned grading environment is developed with Python (with pip) 3.5+.

Build containers

To build a container to test changes, run the next command:

docker build -t <container_tag> ./grading/<container_path>

Utility Scripts

In order to facilitate testing, development and deployment, there are several different ways to build and manage the images on this repository. If you want to clean build an image (deleting the image if it exists before build) use clean-build-container.sh

./clean-build-container.sh <container-folder-name>

If you want to clean build all main images of uncode (uncode-base, multilang, hdl, notebook, data science)(deleting the images if they exists before build) use clean-build-main-containers.sh

./clean-build-main-containers.sh

If you want to manage the images in order to manipulate the registries in DockerHub, run the following scripts:

To pull all the grading images with the specified tag (if flag -t i not passed the default tag is latest):

./pull-registry-images.sh -t <tag>

To tag all the grading images with the specified tag (if flag -t i not passed the default tag is latest):

./tag-registry-images.sh -t <tag>

To push all the grading images with the specified tag to unjudge registry on DockerHub(if flag -t i not passed the default tag is latest):

./push-registry-images.sh -t <tag>

Run tests

Tests have been developed for the multilang container, in case you they have changed, you can run them as follows:

docker run -v <absolute_path_to_multilang>/grading/:/python_lib/grading \
    -v <absolute_path_to_multilang>/tests/:/python_lib/tests \
    ingi/inginious-c-multilang /bin/sh -c "mkdir -p /task/student; export PYTHONPATH=/python_lib:$PYTHONPATH; cd /python_lib && pip3 install pytest && pytest tests"

Where <absolute_path_to_multilang> is the absolute path the multilang container code, for instance: /home/user/Desktop/INGInious-containers/grading/multilang. It must be the absolute path, otherwise it will fail to start.

Translate messages

It is possible to translate the messages returned from the containers. This adds support for internationalization (i18n). This is quite similar to the way it is done in the frontend. This is done using the module gettext which installs the function _() in python to make it accessible in all the code, also, the messages are extracted and compiled using pybabel. The i18n related files per language, are located in grading/uncode/lang/.

Note: Every time a Pull Request is done to master, an automatic check is done to verify that the i18n files are up to date.

1. Mark a message as translatable

To mark a message as translatable, use the function _("Message to translate"), which encloses the string to translate.

2. Extract marked messages

To extract the marked messages as translatable from the files, run the next command.

pybabel extract -o messages.pot .

3. Update messages

To update the messages files for each language, run the next command. After that, you can add translate the messages in the language you want to translate in grading/uncode/lang/.

pybabel update -i messages.pot -d grading/uncode/lang/

4. Compile messages

Finally, the messages need to be compiled to correctly load the translations, run the next command:

pybabel compile  -d grading/uncode/lang/

Documentation

For additional documentation, please refer to the Wiki.

Roadmap

See the UNCode GitHub Project for a list of proposed features for UNCode, known issues and how they are being tackled.

Contributing

Go to CONTRIBUTING to see the guidelines and how to start contributing to UNCode.

License

Distributed under the AGPL-3.0 License. See LICENSE for more information.

Contact

In case of technical questions, please use the gitter communication channel.

In case you want to host your course on our deployment, email us on: [email protected]

UNCode: https://uncode.unal.edu.co

Project page: https://juezun.github.io/

About

Grading environments for UNCode. Here are found the containers in charge of grading students' submissions for UNCode.

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Java 81.8%
  • Python 15.1%
  • Dockerfile 1.3%
  • Shell 0.9%
  • Makefile 0.5%
  • C++ 0.2%
  • C 0.2%