Skip to content

Adding possibility for jobs not linked to a task or course#1110

Open
AlexandreDoneux wants to merge 9 commits into
INGInious:mainfrom
AlexandreDoneux:jplag_1
Open

Adding possibility for jobs not linked to a task or course#1110
AlexandreDoneux wants to merge 9 commits into
INGInious:mainfrom
AlexandreDoneux:jplag_1

Conversation

@AlexandreDoneux
Copy link
Copy Markdown
Contributor

This PR modifies code to be able to handle container jobs that are not linked to a course and task. Meaning you don't need to provide a course and task id.

This is not yet a fully implemented feature and will be followed by other PRs that allow unique jobs to be used for a reworked jplag plugin.

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Apr 24, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 12 complexity · 2 duplication

Metric Results
Complexity 12
Duplication 2

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Copy link
Copy Markdown
Member

@anthonygego anthonygego left a comment

Choose a reason for hiding this comment

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

This PR is not very clean. You should read your diff before submitting it.

Globally it seems good, but I'd rather rewrite the client.new_job method so that it becomes agnostic of whether we are launching a task or not. I'd modify this so that submission_manager` unpacks the task data and call this method with the appropriate arguments, and that a plugin or another component would call the this method using its own environment definition and inputdata.

This way the signature would be less confusing and the code would not need to handle different cases with default code.

Comment thread inginious/agent/docker_agent/__init__.py Outdated
Comment thread inginious/agent/docker_agent/__init__.py Outdated
Comment thread inginious/agent/docker_agent/__init__.py Outdated
Comment thread inginious/agent/docker_agent/__init__.py Outdated
Comment thread inginious/agent/docker_agent/__init__.py Outdated
Comment thread inginious/backend/backend.py Outdated
Comment thread inginious/client/client.py Outdated
Comment thread inginious/client/client.py Outdated
Comment thread inginious/client/client.py Outdated
Comment thread inginious/client/client.py
Jobs that are not related to a task/course are not submissions and should not be placed in the submission manager. The Call to Client.new_job() and ClientSync.new_job() can be directly made where it is needed.
Comment thread inginious/frontend/submission_manager.py Outdated
@AlexandreDoneux
Copy link
Copy Markdown
Contributor Author

Sorry for the errors that slipped in the code. I worked on another branch on multiple features at once before importing the code I thought was relevant. It is clearly not the most efficient/foolproof way of working.

I fixed those and ran a courseless/taskless job by calling a synchronous job. However this is not yet possible in the current state of INGInious. Do you have in mind a way for you or other reviewers to check the feature is working as expected.

I also had another question :

  • While creating a ClientNewJob message in client.py, should the task problems dictionary passed be a None or an empty dict ? Both work opposed to the environment parameters that have to be a dict.

@anthonygego
Copy link
Copy Markdown
Member

  • While creating a ClientNewJob message in client.py, should the task problems dictionary passed be a None or an empty dict ? Both work opposed to the environment parameters that have to be a dict.

It's probably safer to default to an empty dictionary and maybe enforce it. The getinput API at the end is not meant to handle a None object.

Comment thread inginious/client/client.py Outdated
@anthonygego
Copy link
Copy Markdown
Member

Well well well, I realize by testing the code that empty /task and /course/common folders are still mounted. This may become confuse as if you put your run file in /task/ or /course/common/ it won't be accessible.

There is a choice to be made here:

  • Either not mounting those useless folders but in this case it's worth making sure they exists in the base container to avoid breaking the other scripts. I'm not sure how much it impacts existing code.
  • Either documenting it. I think it would be OK at this stage.

In both cases it's worth adding docs under a Developers documentation/Extensions/Taskless jobs section. This should specify the valid paths for the entrypoints and how to use the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants