Download this file

donotreadme.md    221 lines (129 with data), 5.7 kB

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

# C2NET Service Implementation 

The C2NET cloud service is implemented and integrated in an incremental and iterative way. This implies to create an initial version of the C2NET service with a subset of its components, and then in new iterations to add new components while updating previously incorporated components by new versions. 

The incremental and iterative process for doing so has been composed by:

1. Initial C2NET service with basic set of PaaS 4 Manufacturing components:
   1. UCP
   1. ~~CNM~~ 
   1. ~~ACS~~ 
   1. ~~DS.sql~~ 
   1. ~~MariaDBWrapper~~
2. Incorporation of OPT components:
   1. ~~OPC~~
   1. ~~SM~~
   1. ~~PM~~
   1. ~~Job~~
   1. ~~TaskExecutor (with the embedded OptimizationAlgorithms).~~
3. Incorporation of DCF components:
   1. ~~Pub/Sub~~
   1. ~~RM~~ 
   1. ~~DKMS~~
   1. TPM
   1. Mobile Application.
4. Incorporation of COT components:
   1. OPP
   1. MPE-MD
   1. MPE-AA
5. New iterations for updating the component versions.

## SEED SERVICE - UNDER DEVELOMPENT

The aim of this service is to integrate all components within C2NET 

Following components are being integrated:

* JOB
* TASK EXECUTOR
* MARIADB WRAPPER
* optFE
 
* opcFE
* OPC
* POMAMANAGER
* DSSQL
* SOLVERMANAGER
 
### INSTRUCTIONS 

Clone the component repositories to the same folder. We refer to this folder as C2NET_HOME. So, from the C2NET_HOME folder execute:

 * JOB


    git clone https://{USER}@opensourceprojects.eu/git/p/c2net/cpl/paas4man/jex/jobs/code c2net-cpl-paas4man-jex-jobs-code
     
* TASK EXECUTOR


    git clone https://{USER}@opensourceprojects.eu/git/p/c2net/cpl/paas4man/jex/taskexecutor/code c2net-cpl-paas4man-jex-taskexecutor-code 
    
* MARIADB WRAPPER


    git clone https://{USER}@opensourceprojects.eu/git/p/c2net/cpl/paas4man/dst/mariadbwrapper/code c2net-cpl-paas4man-dst-mariadbwrapper-code 
    
* jobexFE


    #included in this repo

* opcFE

    
    #todo included in this repo
    
* OPC


    git clone https://{USER}@opensourceprojects.eu/git/p/c2net/opt/poma/opc/code c2net-opt-poma-opc-code 
* POMAMANAGER


    git clone https://{USER}@opensourceprojects.eu/git/p/c2net/opt/poma/pomam/code c2net-opt-poma-pomam-code 

* SOLVERMANAGER


    git clone https://{USER}@opensourceprojects.eu/git/p/c2net/opt/poma/solvermanager/code c2net-opt-poma-solvermanager-code 

* DSSQL

    
    git clone https://{USER}@opensourceprojects.eu/git/p/c2net/cpl/paas4man/dst/dssql/code c2net-cpl-paas4man-dst-dssql-code 
    
    
* ACS

* CNM


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