Skip to content

Added script_path to submit jobs #63

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jpdorsch
Copy link
Collaborator

  • Job submission via CLI can be done now pointing to a path in the remote cluster ( script_path)
  • Parameter script now is optional
  • If script_path is provided in system that is configured to use the API, then it checks that also the script is provided. If not, then the submission is not possible

@jpdorsch jpdorsch self-assigned this Apr 30, 2025
@jpdorsch jpdorsch requested a review from theely May 5, 2025 15:09
@@ -23,7 +23,7 @@ class PostJobSubmitRequest(JobSubmitRequestModel):
"examples": [
{
"job": {
"name": "Count to 100",
"name": "Example with script string",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we call this "Example with inline script"?


# if `script_path`` is set and `script` is not provided,
# then this cannot be submitted with SLURM API
if job_description.script_path and not job_description.script:
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we aim to abstract the scheduler type and its behaviour, should we transparently handle this case?
Instead of returning an error, we could force the use of the slurm_cli_client.py
To do so, change the scheduler client dependency to: Depends(SchedulerClientDependency(force_cli_client=True)), on the post job route

The flip side is that job submission via Slurm REST API will never be called. At least until Slurm implements the ability to provide a script path also via REST API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was thinking about that idea.
My main concern here is that this is only possible with SLURM. What if the scheduler used as API doesn't provide a CLI version installed in the same system?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed, the current implementation is not ideal.
With force_cli_client=True, it is the route function that implements the logic of using the CLI or the REST API. Instead, this decision should be delegated to the SchedulerClientDependency class or the Slurm clint class.

I would proceed as follows:

  • for the time being, use: Depends(SchedulerClientDependency(force_cli_client=True))
  • open an issue to remove the force_cli_client parameter. Instead, we should create a new Slurm client that integrates both the CLI and the REST clients and "automatically" routes the requests via the correct channel.

@jpdorsch jpdorsch requested a review from theely May 12, 2025 09:30
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