`/Shared/` API (e.g. for server-side scripting)
Created by: Quazgar
THIS PROPOSAL IS NOT SPECIFIED IN FULL DETAIL (YET).
Goals
- "Progress bar"
- asynchronous execution
- semi-persistent, fail-save results which do not get lost when the internet connection fails
- logging for debugging #3 (closed)
Idea
Change the protocol for the invocation of server-side scripts such that the server responds immediately with a cryptographic token which can be used together with a new server resource to fetch status information, error reports and results.
sequenceDiagram
participant C as Client
participant S as Server
C->>+S: Invoke 'script.py'
S->>C: Return 'ABC123'
loop Until terminated
C->>S: Status 'ABC123'
S->>C: Return 'RUNNING, 29%'
end
C->>S: Status 'ABC123'
S->>-C: Return 'TERMINATED 0'
C->>S: Fetch 'ABC123'
S->>C: Return results
Implementation
-
./scripting/bin
directory for the executables -
./scripting/working
directory where the server creates temporary working directories and executes the scripts -
new
./shared
directory where the server creates directories with cryptographic names where the scripts can store data and where the server stores the stdin, stdout dumps and leaves progress information. The directories under this directory can be accessed by theTempDir
resource withGET
request andDELETE
requests. E.g. -
GET https://host/Shared/ABC123
returns the status, progress, return code, stdin, stout, created files, if available and applicable. -
GET https://host/Shared/ABC123/path
returns the file at the path. -
Other resource implementations could implement this without an actual directory on the file system.
Imported comments:
By Henrik tom Wörden on 2020-05-05T09:00:36.394Z
changed the description
By Quazgar on 2020-02-17T12:34:55.515Z
changed the description
By Quazgar on 2020-02-17T12:31:08.678Z
changed milestone to %4
By Quazgar on 2020-02-17T12:28:30.992Z
changed the description
By Quazgar on 2020-02-17T12:27:51.453Z
changed title from Version 0.4 Server-side-scripting to {+/Shared/
API (e.g. for server-side scripting)+}
By Quazgar on 2020-02-17T11:41:26.898Z
mentioned in issue #59 (closed)
By Alexander Schlemmer on 2020-01-08T13:22:07.955Z
Proposal:
DELETE https://host/Shared/ABC123
cancels the job
POST https://host/Shared/ABC123
<body>
sends body as a message to interactive user input of the script
By Alexander Schlemmer on 2019-12-10T12:36:34.510Z
Currently it is difficult to monitor the status of several processes within CaosDB, e.g.:
- loadFiles
- queries
- scripting
@quazgar Can we come to an estimate of the approximate timescale when this issue will be implemented? If it is not in reach for the near future, can we maybe think about very pragmatic extensions, that would allow for at least some feedback on the progress of processes?
By Alexander Schlemmer on 2019-12-10T12:34:01.906Z
changed due date to January 17, 2020
By Timm Fitschen on 2019-09-11T15:03:37.127Z
changed due date to September 18, 2019
By Timm Fitschen on 2019-09-03T06:31:18.930Z
changed due date to September 11, 2019
By Timm Fitschen on 2019-08-30T06:42:05.395Z
changed due date to September 04, 2019
By Timm Fitschen on 2019-08-29T09:41:59.277Z
mentioned in issue #3 (closed)
By Timm Fitschen on 2019-08-29T09:40:21.653Z
changed the description
By Quazgar on 2019-08-13T09:55:20.567Z
assigned to @timm.fitschen and unassigned @quazgar
By Quazgar on 2019-08-13T09:55:20.255Z
Mentioning @salexan @henrik_indiscale as well.
By Quazgar on 2019-07-31T10:59:06.428Z
changed the description
By Timm Fitschen on 2019-07-31T10:59:06 (imported from GitLab project)
By Quazgar on 2019-07-31T10:58:49.344Z
changed the description
By Timm Fitschen on 2019-07-31T10:58:49 (imported from GitLab project)
By Quazgar on 2019-07-31T09:17:33.020Z
changed the description
By Timm Fitschen on 2019-07-31T09:17:33 (imported from GitLab project)
By Quazgar on 2019-07-31T09:15:54.780Z
changed due date to August 06, 2019
By Timm Fitschen on 2019-07-31T09:15:54 (imported from GitLab project)