Parent: [f7632f] (diff)

Child: [c21d4a] (diff)

Download this file

readme.md    141 lines (81 with data), 4.1 kB

ERROR! The markdown supplied could not be parsed correctly. Did you forget to surround a code snippet with "~~~~"?

## 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:

1. Folder which contains the source of the Bundle

2. The components which will be included in the service bundle

3. Component front end of the service

4. Deployment manifest

5. Service manifest

6. File with the generated zip

7. Folder containing scripts to automatically build, verify adn deploy the service

8. Build script

9. Deploy scritp to local-stamp

10. 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"