Parent: [ca7ca9] (diff)

Child: [4a2007] (diff)

Download this file

readme.md    126 lines (77 with data), 3.7 kB

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

## TEST SERVICE 

Example of a service with the following components:

* JOB
* TASK EXECUTOR
* MARIADB WRAPPER
* FRONT-END 
 
### INSTRUCTIONS 

Clone the repos of all components in the service in the same folder level where this projects is located. From C2NET_HOME 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


**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 first it first..)

    ./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:

        .
        ├── 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 Bundle
(2) The components will be included in this folder
(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