-
Notifications
You must be signed in to change notification settings - Fork 17
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
Static REST endpoint mode for invoking CLI tasks #217
base: master
Are you sure you want to change the base?
Conversation
This changes the ingestion process for tasks. Rather than parsing the CLI specs on the server, the client can use a script to parse them locally and send up the output to the server.
5cfb997
to
9d90439
Compare
9d90439
to
e9bbe44
Compare
slicer_cli_web/docker_resource.py
Outdated
@@ -62,7 +65,35 @@ def __init__(self, name): | |||
|
|||
self.route('GET', ('path_match', ), self.getMatchingResource) | |||
|
|||
self._generateAllItemEndPoints() | |||
if os.environ.get('GIRDER_STATIC_REST_ONLY'): | |||
self.route('POST', (':id', 'run'), self.runCli) |
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.
The endpoints that are generated elsewhere are self.route('POST', ('cli', ':id', 'run'), self.runCli)
. I think the tests are passing because when we upload or refresh a CLI, it is still invoking addRestEndpoints
which adds these.
Further, some CLIs can expose an point like POST cli/:id/datalist/:key
which also need to be handled (this endpoint is used, for instance, by the MONAI label CLI docker to fetch names of available segmentation models).
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.
Good catch, thanks!
It's true that this is not yet tested.
1cbaad9
to
d5a93a5
Compare
This branch is deployed here https://histomics-demo.com/api/v1#/slicer95cli95web |
This provides an off-by-default mode for Slicer CLI web with an alternate mode of supporting CLI task execution in share-nothing deployments. By setting
GIRDER_STATIC_REST_ONLY=true
in the environment, this mode is enabled. As written, it has the following limitations:datalist
operation.With this change, the web server will now be able to execute newly-added Slicer CLI task items without the need for a manual server restart.