File | Date | Author | Commit |
---|---|---|---|
bundle | 2016-11-24 | Daniel Machancoses | [9551c5] new version of JOBS, TASK-EXECUTOR |
scripts | 2016-11-25 | Daniel Machancoses | [497166] Added new scritps |
readme.md | 2016-11-24 | Daniel Machancoses | [8a1e1a] Fixed format |
Read Me
TEST SERVICE
This repository contains all neccesary code and scripts to create a Test Service with the following components:
- JOB
- TASK EXECUTOR
- MARIADB WRAPPER
- FRONT-END
INSTRUCTIONS
Clone the component repositories to the same folder. We refer to this folder as C2NET_HOME. So, from the C2NET_HOME folder execute:
git clone https://{USER}@opensourceprojects.eu/git/p/c2net/tests c2net-tests git clone https://{USER}@opensourceprojects.eu/git/p/c2net/cpl/paas4man/jex/jobs/code c2net-cpl-paas4man-jex-jobs-code git clone https://{USER}@opensourceprojects.eu/git/p/c2net/cpl/paas4man/jex/taskexecutor/code c2net-cpl-paas4man-jex-taskexecutor-code git clone https://{USER}@opensourceprojects.eu/git/p/c2net/cpl/paas4man/dst/mariadbwrapper/code c2net-cpl-paas4man-dst-mariadbwrapper-code
And you should get the following folder structure:
C2NET_HOME . ├── c2net-cpl-paas4man-dst-mariadbwrapper-code ├── c2net-cpl-paas4man-jex-jobs-code ├── c2net-cpl-paas4man-jex-taskexecutor-code ... ├── c2net-tests
The folder contains now all 3 components and this test service itself. The c2net-test contains also a Front-End Component which will be used in this service to test via HTTP API as we will see in the following sections.
Build the service
./C2NET_HOME/c2net-tests/scripts/build_service.sh
Verify manifests in the service
./C2NET_HOME/c2net-tests/scripts/validate.sh
Deploy to local-stamp (start local stamp before..)
./C2NET_HOME/c2net-tests/scripts/deploy_local_stamp.sh
Test the service is running
curl "http://localhost:9000/opc/ping"
and you should get
{ "success":true, "message":"PONG" }
DESCRIPTION OF CONTENT
The folder structure of this service is as follows:
. ├── bundle (1) │ ├── components (2) │ │ └── optFE (3) │ ├── deployment │ │ └── Manifest.json (4) │ ├── service │ │ └── Manifest.json (5) │ └── service_bundle.zip (6) ├── scripts (7) │ ├── build_service.sh (8) │ ├── deploy_local_stamp.sh (9) │ └── validate.sh (10) └── readme.md
Where:
-
Folder which contains the source of the Bundle
-
The components which will be included in the service bundle
-
Component front end of the service
-
Deployment manifest
-
Service manifest
-
File with the generated zip
-
Folder containing scripts to automatically build, verify adn deploy the service
-
Build script
-
Deploy scritp to local-stamp
-
Validates manifests
SERVICE API
Once the service is deployed into local-stamp, you can access the Front End Component, which is listening in path '/opc' and the port provided in deployment, which is usually 9000
Job Component
Following operations are supported by Job Component:
Create a Job
curl "https://localhost:9000/opc/jobsApi?action=create&idAlgorithm=AH_MCU_S_MRP_1&idPlan=C2"
Check Job Queue
curl "http://localhost:9000/opc/jobsApi?action=query"
Cancel a Job (Not implemented yet)
curl "http://localhost:9000/opc/jobsApi?action=cancel&idJob=DG34543F"
Task Executor Component
Only for testing purposes, Task Executor Component will be available only from the Job Component, but the Component Front End of this test service can access Task Executor with following operaions:
Execute a Task
curl "http://localhost:9000/opc/taskApi?action=execute&idAlgorithm=AH_MCU_S_MRP_1&idPlan=C2..."
Read configuration such as algorithms installed
curl "http://localhost:9000/opc/taskApi?action=configuration"
Check executor status
curl "http://localhost:9000/opc/taskApi?action=available"
Cancel current execution (Not implemented yet)
curl "http://localhost:9000/opc/taskApi?action=cancel"