git clone https://@opensourceprojects.eu/git/p/c2net/tests c2net-tests



File Date Author Commit
bundle 2016-11-22 Daniel Machancoses Daniel Machancoses [aab297] Reorganized code for bundle
scripts 2016-11-22 Daniel Machancoses Daniel Machancoses [aab297] Reorganized code for bundle
readme.md 2016-11-23 Daniel Machancoses Daniel Machancoses [63b081] Fixed format

Read Me

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

./C2NET_HOME/c2net-tests/scripts/deploy_local_stamp.sh

Test the service is running

curl http://localhost:9000/opc/ping

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 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
curl "http://localhost:9000/opc/jobsApi?action=cancel&idJob=DG34543F"
Not implemented yet

Task Executor Component

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
curl http://localhost:9000/opc/taskApi?action=cancel
Not implemented yet