-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: master
Are you sure you want to change the base?
Conversation
src/firecrest/compute/models.py
Outdated
@@ -23,7 +23,7 @@ class PostJobSubmitRequest(JobSubmitRequestModel): | |||
"examples": [ | |||
{ | |||
"job": { | |||
"name": "Count to 100", | |||
"name": "Example with script string", |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
script_path
)script
now is optionalscript_path
is provided in system that is configured to use the API, then it checks that also thescript
is provided. If not, then the submission is not possible