Skip to content

Commit

Permalink
Improve on-demand deployment (#126)
Browse files Browse the repository at this point in the history
* Change order of deployment modals

* Retrieve on-demand state

* Move instructions to the top

* Only create service instances for not on-demand CSARs

* Only perform binding for not on-demand services

* Add on-demand check during binding

* Fix issue not opening the on demand modal

* Remove unused code

* Add information about completion into on-demand modal

* Remove unnecessary if

* Forward required data to on-demand transformation

* Forward required information to on-demand transformation

* add input var preparation for vm

* add input var preparation for vm

* update ondemand subprocess

* add scripts for ondemand depl

* ondemand script

* use slurper for parsing json

* adding 2nd script task

* Add first part of OT instance retrieval

* Pass OT endpoint to instance check

* enable dedicated policy for ondemand

* Extend instance retrieval script

* Fix upper case

* Only perform on-demand transformation for tasks with corresponding policy

* Remove log

* Improve logging

* Fix logging

* Fix issue with dedicated policy

* Eventually handle input parameters for on-demand deployment

* Fix escaping in service creation script

* add matching for vm parameters

* Add all required input parameters and make selfServiceUrl task specific

* Fix first part of waiting script

* Fix waiting script

* Adapt service invokation to scoped selfserviceinstance variables

---------

Co-authored-by: mbeisel <beiselmn@gmail.com>
  • Loading branch information
wederbn and mbeisel authored Nov 24, 2023
1 parent f38e4ad commit f6e99ad
Show file tree
Hide file tree
Showing 7 changed files with 1,058 additions and 373 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@

import { getBindingType } from "./BindingUtils";
import { getFlowElementsRecursively } from "../../../editor/util/ModellingUtilities";
import { synchronousPostRequest } from "../utilities/Utilities";
import {
synchronousGetRequest,
synchronousPostRequest,
} from "../utilities/Utilities";
import config from "../framework-config/config";
import { getModeler } from "../../../editor/ModelerHandler";

/**
* Get the ServiceTasks of the current workflow that have an attached deployment model to deploy the corresponding service starting from the given root element
Expand Down Expand Up @@ -44,6 +48,17 @@ export function getServiceTasksToDeploy(startElement) {
console.log("Adding to existing CSAR entry...");
csarEntry.serviceTaskIds.push(flowElement.id);
} else {
// get businessObject for onDemand property retrieval
const taskData = getModeler()
.get("elementRegistry")
.get(flowElement.id);
let onDemand;
if (taskData.businessObject.onDemand) {
onDemand = taskData.businessObject.onDemand;
} else {
onDemand = false;
}

csarsToDeploy.push({
serviceTaskIds: [flowElement.id],
url: flowElement.deploymentModelUrl,
Expand All @@ -52,6 +67,7 @@ export function getServiceTasksToDeploy(startElement) {
incomplete: !isCompleteDeploymentModel(
flowElement.deploymentModelUrl
),
onDemand: onDemand,
});
}
}
Expand Down Expand Up @@ -132,3 +148,10 @@ export function completeIncompleteDeploymentModel(
return undefined;
}
}

export function getTopology(deploymentModelUrl) {
let url = deploymentModelUrl.replace("/?csar", "/topologytemplate");
console.log("Getting topology from URL:", url);
const topology = synchronousGetRequest(url, "application/json");
return JSON.parse(topology);
}
Loading

0 comments on commit f6e99ad

Please sign in to comment.