Task Manager¶
- Microservices system mode
- Download
- Software requirements
- Installation
- Licenses
- Logging
- Configuration
- Running the server
- API documentation
- Demo site
Task Manager provides the possibility of scheduling special long lasting tasks for the following web services.
-
1DB Web Services
-
1Calculations Web Services
-
1Structure Checker Web Services
This documentation describes installation, administration and usage of Task Manager.
Task Manager application is available as part of a microservices system.
Microservices system mode¶
In microservices system mode the Task Manager runs together with Config service, Discovery service, Gateway service. These three services are mandatory and optionally other services can also be part of the system. All configuration must be done in the Config module.
DB Web Service and/or Calculations Web Services and/or Structure Checker Web Services must also run according to the tasks planned to be created, executed.
The default configuration applies to the microservices system mode.
The web application runs on host
Download¶
See here.
Software requirements¶
See here
Installation¶
See here.
Module is installed into folder: jws/jws-taskmanager
Licenses¶
See here.
" JChem Microservices DB " and/or " JChem Microservices Structure Checker " and/or " JChem Microservices Calculations " licenses are needed.
Logging¶
See here.
Configuration¶
**Default configuration: **
| application.properties | |
|---|---|
| server.port=8068 | |
| logging.file.name=../logs/jws-taskmanager.log | |
| eureka.client.enabled=true |
| bootstrap.properties |
|---|
| spring.cloud.config.failFast=true spring.cloud.config.uri=${CONFIG_SERVER_URI:http://localhost:8888/} spring.cloud.config.retry.initialInterval=3000 spring.cloud.config.retry.multiplier=1.2 spring.cloud.config.retry.maxInterval=60000 spring.cloud.config.retry.maxAttempts=100 |
For more settings possibilities see spring documentation page.
Retry mechanism¶
Task manager and the services it communicates with have a retry mechanism implemented in them when they call out to each other. This is adjustable with these two properties in all of these services, in their application.properties file
BackOffPeriod is the time in milliseconds the service waits between two attempts to send the request to the other service again if no response was given.
MaxAttempts is the maximum number of attempts. Note, that it also contains the very first call.
With the above written default values the service tries to get a response for about 3 minutes.
Running the server¶
Prerequisites in case of microservices system mode:
-
Config service is running
-
Discovery service is running
-
Gateway service is running
Run the service in command line in folder jws/jws-taskmanager:
jws-taskmanager-service start (on Windows)
jws-taskmanager-service start (on Linux)
or
run-jws-taskmanager.exe (on Windows)
run-jws-tarkmanager (on Linux)
API documentation¶
Find and try out the API on the Swagger UI.
| Mode | URL of Swagger UI | Default URL of Swagger UI |
|---|---|---|
| microservices system | <serverhost>:<gateway-port>/jws-taskmanager/API/ | localhost:8080/jws-taskmanager/API/ |
| standalone web application mode | <serverhost>:<server-port>/API/ | localhost:8068/API/ |
Demo site¶
For detailed description check out the JWS Task Manager demo site:
https://jchem-microservices.chemaxon.com/jws-taskmanager/api/index.html
Usage¶
The guidelines, examples on the Demo site or on the Swagger UI API documentation of your installed module display the methods and syntax implemented for reaching the functionalities of the Task Manager toolkit.
Basic endpoints¶
- create task (see taskId in the response)
- add/upload molecules to the task referenced by taskId
- manage (Start) the task referenced by taskId
All available endpoints¶
- create task
- delete task referenced by taskId
- list all tasks
- add structures to task referenced by taskId
- upload structures from file to task referenced by taskId
- modify structures referenced by structureID of a task referenced by taskId
- remove structures referenced by structureID from task referenced by taskId
- get structure referenced by structureID from a task referenced by taskId
- delete structure referenced by structureID from a task referenced by taskId
- get all structures of a task referenced by taskId
- manage task (Start) referenced by taskId
- get the state of a task referenced by taskId
JWSDB tasks¶
Task manager can be applied for importing structures into an already existing table. The table must be created at the endpoint /rest-v1/db/additional/createTable/{tableName} of DB Web Services.
The structures can be added or can be uploaded from file.
The structures will have ID data in the table. If the structures to be imported have their own IDproperty, this IDproperty can be set as ID in the table.
** Example1 **
/rest-v1/work-queue/task
/rest-v1/work-queue/task/{taskId}
/rest-v1/work-queue/task/{taskId}/manage
/rest-v1/work-queue/task/{taskId}/results
The results of the given task can be found in the file shown by the Download file link in the response.
** Example2 **
/rest-v1/work-queue/task
/rest-v1/work-queue/task/{taskId}
/rest-v1/work-queue/task/{taskId}/manage
/rest-v1/work-queue/task/{taskId}/results
The results of the given task can be found in the file shown by the Download file link in the response.
** Example3 **
/rest-v1/work-queue/task
/rest-v1/work-queue/task/{taskId}/upload
Upload the the structures from file.
/rest-v1/work-queue/task/{taskId}/manage
/rest-v1/work-queue/task/{taskId}/results
The results of the given task can be found in the file shown by the Download file link in the response.
JWS-CALCULATIONS tasks¶
Use similar syntax like at /rest-v1/calculator/calculate endpoint of Calculations Web Services with the exception of "structure" and "inputFormat".
Do not add the structures to be calculated in the 'Create task' step. The structures must be added in the 'Add structures' step.
** Example1 **
/rest-v1/work-queue/task
/rest-v1/work-queue/task/{taskId}
/rest-v1/work-queue/task/{taskId}/manage
/rest-v1/work-queue/task/{taskId}/results
The results of the given task can be found in the file shown by the Download file link in the response.
** Example2 **
/rest-v1/work-queue/task
/rest-v1/work-queue/task/{taskId}
/rest-v1/work-queue/task/{taskId}/manage
/rest-v1/work-queue/task/{taskId}/results
The results of the given task can be found in the file shown by the Download file link in the response.
JWS-CHECKER-FIXER tasks¶
Use similar syntax like at /rest-v1/checker-fixer/ endpoint of Structure Checker Web Services with the exception of "structure".
Do not add the structures to be checked/fixed in the 'Create task' step. The structures must be added in the 'Add structures' step.
** Example1 **
/rest-v1/work-queue/task
/rest-v1/work-queue/task/{taskId}
/rest-v1/work-queue/task/{taskId}/manage
/rest-v1/work-queue/task/{taskId}/results
The results of the given task can be found in the file shown by the Download file link in the response.
** Example2 **
/rest-v1/work-queue/task
/rest-v1/work-queue/task/{taskId}
/rest-v1/work-queue/task/{taskId}/manage
/rest-v1/work-queue/task/{taskId}/results
The results of the given task can be found in the file shown by the Download file link in the response.