Commit e72b0b9e authored by Alicja Reniewicz's avatar Alicja Reniewicz
Browse files

Merge branch 'rc3.0' into 'master'

Rc3.0

See merge request !1
parents 4b8418de aa222824
Pipeline #8029 passed with stages
in 28 minutes and 6 seconds
......@@ -6,7 +6,7 @@
<groupId>eu.melodic</groupId>
<artifactId>interfaces</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<dependencies>
<!--<dependency>-->
......
......@@ -18,6 +18,9 @@ types:
notificationURI:
description: The URI of an endpoint to sent the result of Constraint Problem creation.
type: string
isSimulation:
type: string
description: bool indicating whether application is launched in simulation mode or not
watermark:
type: ApiLib.Watermark
ApplySolutionRequest:
......@@ -34,7 +37,6 @@ types:
type: string
watermark:
type: ApiLib.Watermark
DifferenceRequest:
type: object
properties:
......@@ -47,13 +49,11 @@ types:
currDeploymentInstanceName:
type: string
description: Name of the deployment instance.
DifferenceResponse:
type: object
properties:
diff:
type: Touple[]
Touple:
type: object
properties:
......@@ -63,7 +63,6 @@ types:
value:
description: "details of deployment for component"
type: ToupleValue
ToupleValue:
type: object
properties:
......@@ -76,7 +75,6 @@ types:
toRemain:
description: "instances to remain"
type: InstanceDetails[]
InstanceDetails:
type: object
properties:
......@@ -86,7 +84,6 @@ types:
type:
description: "component type"
type: string
/applicationDeployment:
post:
body:
......@@ -111,4 +108,4 @@ types:
200:
body:
application/json:
type: DifferenceResponse
\ No newline at end of file
type: DifferenceResponse
......@@ -23,20 +23,15 @@ types:
ConstraintProblemSolutionFromFileRequest:
type: object
properties:
applicationId:
type: string
description: The identifier of the application.
camelModelFilePath:
type: string
description: The path in the filesystem where Camel Model for application can be found.
fileModelsPath:
cpProblemFilePath:
type: string
description: The path in the filesystem where models required for solvers can be found.
nodeCandidatesFilePath:
type: string
description: The path in filesystem where map with Node Candidates required for solvers can be found.
watermark:
type: ApiLib.Watermark
/constraintProblemSolution:
post:
body:
......
......@@ -17,11 +17,68 @@ types:
type: string
watermark:
type: ApiLib.Watermark
ConfigurationResponse:
description: A list of Configuration objects, describing a particular type and a list of parameters for it.
type: object
properties:
configurations:
type: Configuration[]
Configuration: LatencyConfiguration | OtherConfiguration
LatencyConfiguration:
description: A type of configuration which is used to get information about component's latency.
properties:
componentName:
description: Component's name.
type: string
componentIP:
description: Component's IP address.
type: string
componentRegion:
description: Region of component.
type: string
agentRegion:
description: Region of agent.
type: string
componentCloud:
description: Name of the provider hosting the component.
type: string
agentCloud:
description: Name of the provider hosting the agent.
type: string
OtherConfiguration:
description: This mock-up's been created to avoid problems with wrong autogenerated files when only one Configuration subtype is declared.
properties:
prop1:
description: Component's name.
type: string
prop2:
description: Component's IP address.
type: string
/dataModel:
post:
description: method used to add a data pool object
description: Method used to add a data pool object.
body:
application/json:
type: DataModelRequest
responses:
200:
/configuration:
get:
description: A method called by the DLMS Agent to get the configuration to set up metrics gathering.
queryParameters:
IP:
description: IP address.
required: true
type: string
example: "192.22.155.01"
responses:
200:
body:
application/json:
type: ConfigurationResponse
......@@ -78,6 +78,38 @@ types:
type: ApiLib.NotificationResult
watermark:
type: ApiLib.Watermark
MetricsNamesResponse:
type: object
properties:
metricsNames:
type: string[]
watermark:
type: ApiLib.Watermark
SimulatedMetricValuesRequest:
type: object
properties:
applicationId:
type: string
description: The identifier of the application.
metricValues:
type: KeyValuePair[]
watermark:
type: ApiLib.Watermark
SimulatedMetricValuesResponse:
type: object
properties:
applicationId:
type: string
description: The identifier of the application.
KeyValuePair:
type: object
properties:
key:
description: "key"
type: string
value:
description: "value"
type: string
/constraintProblemEnhancement:
post:
body:
......@@ -110,4 +142,19 @@ types:
200:
body:
application/json:
type: UpdateSolutionResponse
\ No newline at end of file
type: UpdateSolutionResponse
/provideSimulatedMetricValues:
post:
body:
application/json:
type: SimulatedMetricValuesRequest
description: Interface used by simulationHandler to provide him metric values from GUI.
responses:
200:
body:
application/json:
type: SimulatedMetricValuesResponse
description: if succeeded or not
......@@ -23,6 +23,9 @@ types:
type: array
items:
type: NewCloud
isSimulation:
type: string
description: bool indicating whether application is launched in simulation mode or not
watermark:
type: ApiLib.Watermark
DeploymentProcessResponse:
......
......@@ -22,6 +22,9 @@ types:
type: boolean
default: true
description: Flag indicating if new CP model should be generated by the CP-generator (false). By default (true) cp-model will not be generated.
isSimulation:
type: string
description: bool indicating whether application is launched in simulation mode or not
cdoResourcePath:
type: string
description: The path in the CDO server where existing cp-model can be found. Obligatory for useExistingCP=true
......@@ -44,4 +47,4 @@ types:
200:
body:
application/json:
type: DeploymentProcessResponse
\ No newline at end of file
type: DeploymentProcessResponse
......@@ -93,6 +93,9 @@ types:
notificationSubject:
type: string
description: Notification subject that will be used when reporting the CP notification.
isSimulation:
type: string
description: bool indicating whether application is launched in simulation mode or not
watermark:
type: ApiLib.Watermark
SolutionEvaluationRequest:
......
......@@ -17,7 +17,7 @@
<classpathentry kind="var" path="M2_REPO/javax/mail/mail/1.4.3/mail-1.4.3.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/xml/xquery/xqj-api/1.0/xqj-api-1.0.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="var" path="M2_REPO/eu/melodic/interfaces/2.5.1-SNAPSHOT/interfaces-2.5.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/eu/melodic/interfaces/3.0.0-SNAPSHOT/interfaces-3.0.0-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/cxf/cxf-rt-rs-extension-providers/3.1.9/cxf-rt-rs-extension-providers-3.1.9.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/cxf/cxf-core/3.1.9/cxf-core-3.1.9.jar"/>
<classpathentry kind="var" path="M2_REPO/org/codehaus/woodstox/woodstox-core-asl/4.4.1/woodstox-core-asl-4.4.1.jar"/>
......@@ -211,7 +211,7 @@
<classpathentry kind="var" path="M2_REPO/org/jdom/jdom/1.1.3/jdom-1.1.3.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/cxf/cxf-rt-transports-local/2.7.15/cxf-rt-transports-local-2.7.15.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/cxf/cxf-rt-ws-security/2.7.15/cxf-rt-ws-security-2.7.15.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/ehcache/ehcache-core/2.5.1/ehcache-core-2.5.1.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/ehcache/ehcache-core/3.0.0/ehcache-core-3.0.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/ws/security/wss4j/1.6.18/wss4j-1.6.18.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/santuario/xmlsec/1.5.8/xmlsec-1.5.8.jar"/>
<classpathentry kind="var" path="M2_REPO/org/opensaml/opensaml/2.6.1/opensaml-2.6.1.jar"/>
......
......@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.melodic</groupId>
<artifactId>jackson2-connector</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<packaging>mule-module</packaging>
<name>jackson2 connector</name>
......@@ -19,7 +19,7 @@
<dependency>
<groupId>eu.melodic</groupId>
<artifactId>interfaces</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
......
......@@ -42,7 +42,7 @@
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar" sourcepath="M2_REPO/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/eu/melodic/interfaces/2.5.1-SNAPSHOT/interfaces-2.5.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/eu/melodic/interfaces/3.0.0-SNAPSHOT/interfaces-3.0.0-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/com/fasterxml/jackson/core/jackson-annotations/2.6.0/jackson-annotations-2.6.0.jar"/>
<classpathentry kind="var" path="M2_REPO/com/fasterxml/jackson/core/jackson-core/2.6.3/jackson-core-2.6.3.jar"/>
<classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.9.13/jackson-core-asl-1.9.13.jar"/>
......@@ -52,7 +52,7 @@
<classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.9.13/jackson-mapper-asl-1.9.13.jar"/>
<classpathentry kind="var" path="M2_REPO/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.6.3/jackson-module-jaxb-annotations-2.6.3.jar"/>
<classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-xc/1.9.13/jackson-xc-1.9.13.jar"/>
<classpathentry kind="var" path="M2_REPO/eu/melodic/jackson2-connector/2.5.1-SNAPSHOT/jackson2-connector-2.5.1-SNAPSHOT.jar" sourcepath="M2_REPO/eu/melodic/jackson2-connector/2.5.1-SNAPSHOT/jackson2-connector-2.5.1-SNAPSHOT-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/eu/melodic/jackson2-connector/3.0.0-SNAPSHOT/jackson2-connector-3.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/eu/melodic/jackson2-connector/3.0.0-SNAPSHOT/jackson2-connector-3.0.0-SNAPSHOT-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/io/github/cloudiator/client/java-rest/0.3.0-SNAPSHOT/java-rest-0.3.0-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/code/javaparser/javaparser/1.0.11/javaparser-1.0.11.jar"/>
<classpathentry kind="var" path="M2_REPO/com/squareup/javapoet/1.7.0/javapoet-1.7.0.jar"/>
......
......@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.melodic</groupId>
<artifactId>mule-integration</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<packaging>mule</packaging>
<name>mule-integration Application</name>
......@@ -242,7 +242,7 @@
<dependency>
<groupId>eu.melodic</groupId>
<artifactId>interfaces</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
......@@ -254,7 +254,7 @@
<dependency>
<groupId>eu.melodic</groupId>
<artifactId>jackson2-connector</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
......
......@@ -236,7 +236,8 @@ http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mul
</flow>
<flow name="deploymentProcess_POST">
<set-variable variableName="vAppName" value="#[json:applicationId]" mimeType="application/json" doc:name="Store application ID" metadata:id="d5b18443-2f8d-4683-90ba-c08fe5e2e233"/>
<set-payload value="{&quot;variables&quot;: {&quot;applicationId&quot; : {&quot;value&quot; : &quot;#[flowVars.vAppName]&quot;, &quot;type&quot;: &quot;String&quot;}, &quot;melodicAuthorizationToken&quot; : {&quot;value&quot; : &quot;#[flowVars.melodicAuthorizationToken]&quot;, &quot;type&quot;: &quot;String&quot;}, &quot;refreshToken&quot; : {&quot;value&quot; : &quot;#[flowVars.refreshToken]&quot;, &quot;type&quot;: &quot;String&quot;}}} " mimeType="application/json" doc:name="Set Payload"/>
<set-variable variableName="isSimulation" value="#[json:isSimulation]" mimeType="application/json" doc:name="Store simulation flag"/>
<set-payload value="{&quot;variables&quot;: {&quot;applicationId&quot; : {&quot;value&quot; : &quot;#[flowVars.vAppName]&quot;, &quot;type&quot;: &quot;String&quot;}, &quot;melodicAuthorizationToken&quot; : {&quot;value&quot; : &quot;#[flowVars.melodicAuthorizationToken]&quot;, &quot;type&quot;: &quot;String&quot;}, &quot;refreshToken&quot; : {&quot;value&quot; : &quot;#[flowVars.refreshToken]&quot;, &quot;type&quot;: &quot;String&quot;}, &quot;isSimulation&quot; : {&quot;value&quot; : &quot;#[flowVars.isSimulation]&quot;, &quot;type&quot;: &quot;String&quot;}}} " mimeType="application/json" doc:name="Set Payload"/>
<set-property propertyName="Content-Type" value="application/json" doc:name="set Content-Type to application/json"/>
<logger message="Payload before call camunda #[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/>
<http:request config-ref="HTTP_Camunda_configuration" path="/rest/engine/default/process-definition/key/${camunda.deploymentProcess.name}/start" method="POST" sendBodyMode="ALWAYS" doc:name="call Camunda"/>
......@@ -271,9 +272,10 @@ http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mul
</when>
<otherwise>
<set-variable variableName="vAppName" value="#[json:applicationId]" mimeType="application/json" doc:name="Store application ID" metadata:id="d5b18443-2f8d-4683-90ba-c08fe5e2e233"/>
<set-variable variableName="isSimulation" value="#[json:isSimulation]" doc:name="Store isSimulation flag"/>
<set-variable variableName="vUseExistingCP" value="#[json:useExistingCP]" mimeType="application/json" doc:name="Store useExistingCP" metadata:id="d5b18443-2f8d-4683-90ba-c08fe5e2e234"/>
<set-variable variableName="vCdoResourcePath" value="#[json:cdoResourcePath]" mimeType="application/json" doc:name="Store cdoResourcePath" metadata:id="d5b18443-2f8d-4683-90ba-c08fe5e2e235"/>
<set-payload value="{ &quot;variables&quot;: { &quot;applicationId&quot;: { &quot;value&quot;: &quot;#[flowVars.vAppName]&quot;, &quot;type&quot;: &quot;String&quot; }, &quot;useExistingCP&quot;: { &quot;value&quot;: &quot;#[flowVars.vUseExistingCP]&quot;, &quot;type&quot;: &quot;Boolean&quot; }, &quot;cpCdoPath&quot;: { &quot;value&quot;: &quot;#[flowVars.vCdoResourcePath]&quot;, &quot;type&quot;: &quot;String&quot; }, &quot;melodicAuthorizationToken&quot;: { &quot;value&quot;: &quot;#[flowVars.melodicAuthorizationToken]&quot;, &quot;type&quot;: &quot;String&quot; }, &quot;refreshToken&quot;: { &quot;value&quot;: &quot;#[flowVars.refreshToken]&quot;, &quot;type&quot;: &quot;String&quot; } } }" mimeType="application/json" doc:name="Set Payload"/>
<set-payload value="{ &quot;variables&quot;: { &quot;applicationId&quot;: { &quot;value&quot;: &quot;#[flowVars.vAppName]&quot;, &quot;type&quot;: &quot;String&quot; }, &quot;useExistingCP&quot;: { &quot;value&quot;: &quot;#[flowVars.vUseExistingCP]&quot;, &quot;type&quot;: &quot;Boolean&quot; }, &quot;cpCdoPath&quot;: { &quot;value&quot;: &quot;#[flowVars.vCdoResourcePath]&quot;, &quot;type&quot;: &quot;String&quot; }, &quot;melodicAuthorizationToken&quot;: { &quot;value&quot;: &quot;#[flowVars.melodicAuthorizationToken]&quot;, &quot;type&quot;: &quot;String&quot; }, &quot;refreshToken&quot;: { &quot;value&quot;: &quot;#[flowVars.refreshToken]&quot;, &quot;type&quot;: &quot;String&quot; } , &quot;isSimulation&quot;: { &quot;value&quot;: &quot;#[flowVars.isSimulation]&quot;, &quot;type&quot;: &quot;String&quot; } } }" mimeType="application/json" doc:name="Set Payload"/>
<set-property propertyName="Content-Type" value="application/json" doc:name="set Content-Type to application/json"/>
<flow-ref name="LogPayload" doc:name="LogPayload"/>
<http:request config-ref="HTTP_Camunda_configuration" path="/rest/engine/default/process-definition/key/${camunda.deploymentProcess.name}/start" method="POST" sendBodyMode="ALWAYS" doc:name="call Camunda"/>
......
......@@ -14,6 +14,7 @@ public class AdapterTransformer {
eu.melodic.models.interfaces.adapter.ApplicationDeploymentRequestImpl interfaceRequest= new eu.melodic.models.interfaces.adapter.ApplicationDeploymentRequestImpl();
interfaceRequest.setApplicationId(req.getApplicationId());
interfaceRequest.setCdoModelsPath(req.getCdoResourcePath());
interfaceRequest.setIsSimulation(req.getIsSimulation());
interfaceRequest.setNotificationURI("/api/adapter/deploymentNotification/" + req.getProcessId() +"/" + req.getNotificationSubject());
interfaceRequest.setWatermark(req.getWatermark());
......
......@@ -4,7 +4,7 @@
<groupId>eu.melodic</groupId>
<artifactId>mule-esb</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>mule-esb</name>
......
......@@ -6,7 +6,7 @@
<groupId>eu.melodic.bpm</groupId>
<artifactId>process</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<properties>
<lombok.version>1.16.16</lombok.version>
......@@ -38,7 +38,7 @@
<dependency>
<groupId>eu.melodic</groupId>
<artifactId>interfaces</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
......
......@@ -240,7 +240,8 @@ public class ApplicationDeploymentExecutor {
}
log.info("Preparing ApplicationDeploymentRequest...");
ApplicationDeploymentRequest request = prepareApplicationDeploymentRequest(execution.getVariable(APPLICATION_ID_VARIABLE).toString(), execution.getVariable("businessKey").toString(), execution.getVariable("cpCdoPath").toString());
ApplicationDeploymentRequest request = prepareApplicationDeploymentRequest(execution.getVariable(APPLICATION_ID_VARIABLE).toString(),
execution.getVariable("businessKey").toString(), execution.getVariable("cpCdoPath").toString(), execution.getVariable("isSimulation").toString());
log.info("ApplicationDeploymentRequest prepared. Sending...");
sendAuthorizedPOSTRequest(execution, request, "applicationDeployment", execution.getVariable(ACCESS_TOKEN_VARIABLE).toString());
log.info("ApplicationDeploymentRequest sent.");
......@@ -436,12 +437,14 @@ public class ApplicationDeploymentExecutor {
return request;
}
private ApplicationDeploymentRequest prepareApplicationDeploymentRequest(String applicationId, String uuid , String cdoResourcePath) {
private ApplicationDeploymentRequest prepareApplicationDeploymentRequest(String applicationId, String uuid,
String cdoResourcePath, String isSimulation) {
ApplicationDeploymentRequest request = new ApplicationDeploymentRequestImpl();
request.setApplicationId(applicationId);
request.setCdoResourcePath(cdoResourcePath);
request.setNotificationSubject("ApplicationDeploymentNotification");
request.setProcessId(uuid);
request.setIsSimulation(isSimulation);
request.setWatermark(prepareWatermark(uuid));
return request;
}
......
......@@ -56,7 +56,8 @@ public class StartProcessVerifierDelegate implements JavaDelegate {
if (pi !=null){
log.info("There is already running process with ID: " +pi.getProcessInstanceId().toString() + " for application: "+execution.getVariable("applicationId") +". This process shall NOT start.");
execution.setVariable("localStartProcessDecision", "STOP");
} else {
} else if (!Boolean.parseBoolean(execution.getVariable("isSimulation").toString())){
//we don't want to wait if application is launched in simulation mode
log.info("No other running processes for application: "+execution.getVariable("applicationId") + ", check if enough time passed since last process finished.");
Calendar calendar = Calendar.getInstance();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment