Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run checks #397

Merged
merged 49 commits into from
May 6, 2024
Merged

Run checks #397

merged 49 commits into from
May 6, 2024

Conversation

Topvennie
Copy link
Contributor

@Topvennie Topvennie commented May 2, 2024

DELETE YOUR .env FILE
DELETE YOUR DATABASE
RUN ./development -c

Route Changes

  • Removed
    • POST /api/projects (you should use POST /api/courses/<id>/projects/
    • POST & PUT & PATCH & DELETE /api/submissions/<id>/
  • Moved
    • PUT & PATCH /api/courses/<id>/projects to /api/projects/<id>/
    • PUT & PATCH /api/projects/<id>/structure-checks to /api/structure-checks/<id>/

Submissions

A submission is zipped upon receiving.
No matter the content received.
This can lead to a zip inside a zip but no problem!

Zip Parsing

  • Supports blocked extensions.
    • Precede the extension with a - to make it a blocked extension.
      • For example the file test.-py will result in the blocked extension py.

Checks

Extra checks are run after structure checks and only if the structure checks succeed.
Teachers / assistans have the ability to trigger the desired error message by exiting their bash script with the right exit code.

Type Checking

For the chad VSCode Pylance users, the amount of typing errors decreased drastically 🎉

Models

  • Checks

    • Moved FileExtensions to checks.py
  • Submission

    • Added the zip field, Replaces the SubmissionFile model.
  • Check Result

    • Added
      • FILE_DIR_NOT_FOUND
        • An obligated file or directory during the structure check wasn't found
      • CHECK_ERROR
        • Can only be thrown by a teacher / assistant during an extra check
        • Should be used to signal that a custom check failed (equivalent of the Dodona checks)
      • FAILED_STRUCTURE_CHECK
        • Error message used by ExtraCheckResult to indicate that it didn't run because the structure checks didn't succeed.
      • DOCKER_IMAGE_ERROR
        • The docker image that was selected to use for the extra check isn't ready yet (should never be possible).
    • Removed
      • OBLIGATED_DIRECTORY_NOT_FOUND
      • UNASKED_DIRECTORY
      • OUTPUTLIMIT
      • INTERNALERROR
    • Renamed
      • TIMELIMIT -> TIME_LIMIT
      • MEMORYLIMIT -> MEMORY_LIMIT
      • CHECKERROR -> CHECK_ERROR
      • RUNTIMEERROR -> RUNTIME_ERROR
  • StructureCheck

    • Renamed
      • Name -> Path
  • Docker Image

    • Added the field state. Can be one of the following:
      • Queued
      • Building
      • Ready
      • Error
  • Extra Check

    • Added
      • Name
      • Memory_limit
        • Maximum amount of ram a docker container can use in MB.
        • Default is 128 MB. Can be increased to 1024 MB.
        • Should not be used by a teacher / assistant to limit the amount of ram a submission can use as it will force stop the entire container.
    • Renamed
      • Timeout -> time_limit
        • Maximum time a docker container can run in seconds.
        • Default is 30 seconds. Can be increased to 1000.
        • Goal is to stop infinite loops as quickly as possible.
        • Should not be used by a teacher / assistant to time a submission as it will force stop the entire container.

@Topvennie Topvennie added this to the Final milestone milestone May 2, 2024
@Topvennie Topvennie self-assigned this May 2, 2024
Copy link
Contributor

@DeLany123 DeLany123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of the change to the structureCheckModel, the fixtures do not work anymore (and seeder probably too). It would be nice if these worked first so the frontend developers do not experience errors.

@DeLany123
Copy link
Contributor

DeLany123 commented May 3, 2024

Could it be possible to make a working example?
By this I mean making it possible to to add a submission where there are working extra checks on the background. This should include a working docker-image, working dockerfile (check from the teacher) and a working submissionfile which we can use to test a submission. In 5f176ab I've tried to make this work myself where you can find the files that I tried making under backend/api/fixtures/data. This Branch also includes a data_dump with the data I've tried it on.

@Topvennie Topvennie marked this pull request as draft May 4, 2024 15:29
Topvennie and others added 2 commits May 6, 2024 15:27
# Conflicts:
#	backend/api/locale/en/LC_MESSAGES/django.po
#	backend/api/locale/nl/LC_MESSAGES/django.po
#	backend/api/logic/check_folder_structure.py
#	backend/api/logic/get_file_path.py
#	backend/api/models/submission.py
#	backend/api/serializers/checks_serializer.py
#	backend/api/serializers/project_serializer.py
#	backend/api/signals.py
#	backend/api/tasks/extra_check.py
#	backend/api/tests/helpers.py
#	backend/api/tests/test_file_structure.py
#	backend/api/views/checks_view.py
#	backend/api/views/project_view.py
#	backend/api/views/submission_view.py
@DeLany123
Copy link
Contributor

Changes requested here!

@Topvennie Topvennie marked this pull request as ready for review May 6, 2024 13:47
@Topvennie
Copy link
Contributor Author

Changes requested here!

👍

@DeLany123 DeLany123 closed this May 6, 2024
@DeLany123 DeLany123 reopened this May 6, 2024
@DeLany123 DeLany123 merged commit 6755a59 into development May 6, 2024
6 checks passed
@bsilkyn bsilkyn deleted the run_checks branch May 9, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants