File | Date | Author | Commit |
---|---|---|---|
bundles-src | 2018-01-09 | Daniel Machancoses | [c62b00] Updated documentation and building the service |
scripts | 2018-01-09 | Daniel Machancoses | [c62b00] Updated documentation and building the service |
readme.md | 2018-01-09 | Daniel Machancoses | [c62b00] Updated documentation and building the service |
Read Me
JOBEX SERVICE
The service-builder.sh script obtains the sources and creates the bundles to register/deploy into Ecloud
The service-builder.sh takes one parameter, which must be the configuration file:
Usage: service-builder.sh service-builder-config config File containing component arguments and script variables
config file must define variables that the script uses.
Usage: COMPONENT=" -source=[git|folder|ftp|file] [-git-tag=] [-git-branch=] [-ftp-bundle=] [-folder-path=] [-file-path=]" -source= Method to get the component from. Must be one of following: ftp Get bundle from FTP. Requires '-ftp-bundle' git Get bundle from GIT. Requires '-git-path' and '-git-branch|-git-tag' file Get bundle from a local file. Requires '-file-path' folder Get component source code from local folder. Requires '-folder-path' -ftp-bundle Bundle file name -git-tag Tag in the GIT repository -git-branch Branch in the GIT repository -git-path Path in the GIT repository -folder-path Path to the component folder -file-path Path to the component bundle file "
This repository contains all neccesary code and scripts to create a Test Service with the following components:
- JOB
- TASK EXECUTOR
- MARIADB WRAPPER
- DSSQL
- FRONT-END
BUILD THE SERVICE
In order to build and download the service, the script ./script/jobex-builder.sh has been created, which is a reduced copy of the original service-builder.sh, and you can find a complete documentation about this script in the branch service-builder (https://opensourceprojects.eu/p/c2net/tests/?branch=ref%2Fservice-builder)
To execute it, you will have to complete credentials to the GIT (OPS_USER, OPS_PASSWORD) and FTP Server (FTP_HOST, FTP_USER, FTP_PASSWD), which for security have not been included in the sources.
Once these variables are filled, execute:
./script/jobex-builder.sh
The script will detect inconsistencies with the service manifest and the config file.
DEPLOY THE SERVICE TO LOCAL-STAMP
Upload the bundle into you local-stamp, using curl is straight forward:
curl http://localhost:8090/admission/bundles -F bundlesZip=@.zip
SERVICE API
Once the service is deployed into local-stamp, you can access the Front End Component, which is listening in path '/jobex' and the port provided in deployment, which is usually 9000
Test the service is running
curl "http://localhost:9000/jobex/ping"
and you should get
{ "success":true, "message":"PONG" }
Job Component
Following operations are supported by Job Component:
Create a Job
curl "http://localhost:9000/jobex/jobs?algorithmCode=AO_BC_M_PSE_1&dbName=C2&requestCode=launchOptimizationJob" curl "http://localhost:9000/jobex/jobs?algorithmCode=AH_MCU_S_MRP_1&dbName=C1&requestCode=launchOptimizationJob"
response :
{ "success": true, "code": "JOB_CREATED", "message": "Create Job Completed", "response": { "idJob": "27306731", "status": "CREATED" } }
List of Queued tasks
curl "http://localhost:9000/jobex/jobs?action=TASKS"
response :
{ "success": true, "code": "TASKS_RESPONSE", "message": "Filter Tasks Response", "response": [] }
List of Executors
curl "http://localhost:9000/jobex/jobs?action=EXECUTORS"
response :
{ "success": true, "code": "EXECUTORS_RESPONSE", "message": "Filter Executors Response", "response": [ { "iid": "taskexecutor_3", "status": "READY", "algorithms": [ "AH_LL_S_MRP_1", "AH_MCT_S_MRP_1", "AH_MCU_S_MRP_1", "AH_SM_S_MRP_1", "AH_XX_SM_MRPPP_1", "AO_BC_D_DP_2", "AO_BC_M_PSC_1", "AO_BC_M_PSE_1", "AO_BC_M_PSE_11", "AO_BC_M_PSE_13_v3" ], "idTask": null }, { "iid": "taskexecutor_4", "status": "READY", "algorithms": [ "AH_LL_S_MRP_1", "AH_MCT_S_MRP_1", "AH_MCU_S_MRP_1", "AH_SM_S_MRP_1", "AH_XX_SM_MRPPP_1", "AO_BC_D_DP_2", "AO_BC_M_PSC_1", "AO_BC_M_PSE_1", "AO_BC_M_PSE_11", "AO_BC_M_PSE_13_v3" ], "idTask": null } ] }
List of Algorithms
curl "http://localhost:9000/jobex/jobs?action=ALGORITHMS"
response :
{ "success": true, "code": "ALGORITHMS_RESPONSE", "message": "Installed Algorithms List", "response": { "algorithms": [ "AH_LL_S_MRP_1", "AH_MCT_S_MRP_1", "AH_MCU_S_MRP_1", "AH_SM_S_MRP_1", "AH_XX_SM_MRPPP_1", "AO_BC_D_DP_2", "AO_BC_M_PSC_1", "AO_BC_M_PSE_1", "AO_BC_M_PSE_11", "AO_BC_M_PSE_13_v3" ] } }
Cancel Job_
curl "http://localhost:9000/jobex/jobs?action=CANCEL"
response :
{ "success": true, "code": "ALGORITHMS_RESPONSE", "message": "Installed Algorithms List", "response": { "algorithms": [ "AH_LL_S_MRP_1", "AH_MCT_S_MRP_1", "AH_MCU_S_MRP_1", "AH_SM_S_MRP_1", "AH_XX_SM_MRPPP_1", "AO_BC_D_DP_2", "AO_BC_M_PSC_1", "AO_BC_M_PSE_1", "AO_BC_M_PSE_11", "AO_BC_M_PSE_13_v3" ] } }
Cancel a Job (Not implemented yet)curl "http://localhost:9000/jobex/jobsApi?action=cancel&idJob=DG34543F"-->
Task Executor Component
It is recomended to access TaskExecutor using the JOBS interface. However, you can invoke the TaskExecutor using the path
curl http://localhost:9000/jobex/task?code=...
where code can be:
RUN_TASK_REQUEST CANCEL_TASK_REQUEST EXECUTOR_STATUS_REQUEST
References:
* Algorithms_Characterisation