Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature dockerize & deployment plugin & attachment button #69

Merged
merged 45 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
39dd32b
Refactor deployment processing in own plugin
wiomoc Jun 12, 2023
4218c77
feat(ci): dockerize
wiomoc May 10, 2023
f8ac265
docs: serve from docker container
wiomoc May 15, 2023
47c218d
docs(ci): extend documentation of docker build
wiomoc May 17, 2023
b426ed3
Merge pull request #13 from SeQuenC-Consortium/feat/6-dockerize
wiomoc Jun 12, 2023
4cbc677
Add feature issue template (#15)
KuhnMn Jun 14, 2023
ffa438e
Implement attachment of deployment artifacts
KuhnMn Jun 14, 2023
6302c9d
Merge branch 'PlanQK:master' into dev-main
KuhnMn Jun 17, 2023
54b9916
Merge remote-tracking branch 'upstream/master' into dev-main
KuhnMn Jun 22, 2023
fec13ce
Add xml viewer (#70)
LaviniaStiliadou Jun 23, 2023
bfabdf6
Feature/9 visualize deployment model (#17)
wiomoc Jun 29, 2023
827c620
Feature/11 deployment model show all button (#18)
wiomoc Jul 3, 2023
a3ea1bc
Fix/upstream pr comments (#21)
wiomoc Jul 12, 2023
ed2d524
Merge remote-tracking branch 'upstream/master' into dev-main
wiomoc Jul 13, 2023
8ce8dd9
Fix/upstream pr comments
wiomoc Jul 13, 2023
617aa23
Rename ArtifactWizardModal
lokmanfl Jul 18, 2023
963bf44
Feature/10 deployment model prevent overlap (#19)
wiomoc Jul 18, 2023
406ed2e
Merge pull request #22 from SeQuenC-Consortium/fix/upstream-PR-commen…
wiomoc Jul 18, 2023
f9974e2
Feature/3 preparation of attached deployment artifacts (#23)
lokmanfl Jul 19, 2023
69586d7
nit picking
wiomoc Jul 24, 2023
5d896c6
Merge branch 'PlanQK:master' into dev-main
KuhnMn Jul 24, 2023
23462de
Add On-Demand Deployment Pop-Up
KuhnMn Jul 24, 2023
fe83257
Fix button integration
KuhnMn Jul 27, 2023
09a2e26
implement on demand transformation
wiomoc Jul 29, 2023
8b0da6e
Merge remote-tracking branch 'upstream/master' into dev-main
KuhnMn Aug 1, 2023
8453884
Move connectorUrl to opentosca plugin
KuhnMn Aug 1, 2023
5c7f84d
fix merge of upstream
wiomoc Aug 1, 2023
6220a5a
upload transformed xml
wiomoc Aug 2, 2023
396ff92
fix review comments
wiomoc Aug 2, 2023
12ee2ac
Merge branch 'upstream-master' into dev-main
wiomoc Aug 25, 2023
09fcb15
Prototyp script task
wiomoc Aug 28, 2023
a9bae65
fixup! Prototyp script task
wiomoc Aug 28, 2023
6557e96
fix input parameter supplier
wiomoc Sep 11, 2023
749e7ef
Merge branch 'dev-main' into feature/4-enable-on-demand-deployment-tr…
wiomoc Sep 11, 2023
abfb5bf
fix tests
wiomoc Sep 11, 2023
892bada
Merge pull request #25 from SeQuenC-Consortium/feature/4-enable-on-de…
wiomoc Sep 11, 2023
1219c52
implement push on-demand deployements
wiomoc Sep 21, 2023
2ee3ba2
improve retry mechanism
wiomoc Oct 1, 2023
2028743
Implement changes suggested in review
lokmanfl Oct 1, 2023
70c8619
change organization in docker-push.yaml to planqk
lokmanfl Oct 2, 2023
e55c0b4
name tasks in subprocess & extend timeout
wiomoc Oct 4, 2023
90acc1a
Merge pull request #26 from SeQuenC-Consortium/4-implenent-push-ondem…
wiomoc Oct 6, 2023
51444a0
Implement PR comments
KuhnMn Oct 20, 2023
67702fb
Merge remote-tracking branch 'upstream/master' into dev-main
KuhnMn Oct 20, 2023
9323c28
Rename BPMNConfigTab
KuhnMn Oct 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
components/bpmn-q/node_modules/
npm-debug.log
yarn-error.log
24 changes: 24 additions & 0 deletions .github/workflows/docker-publish.yaml
LaviniaStiliadou marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

on:
push:
branches:
- 'master'

jobs:
docker-publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ghcr.io/sequenc-consortium/workflow-modeler:latest
2 changes: 2 additions & 0 deletions .vscode/settings.json
LaviniaStiliadou marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
36 changes: 29 additions & 7 deletions Dockerfile
KuhnMn marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
FROM node:18-alpine

FROM node:18-alpine as builder
LABEL maintainer = "Martin Beisel <martin.beisel@iaas.uni-stuttgart.de>"
COPY "components/bpmn-q" /tmp
WORKDIR /tmp
COPY "components/bpmn-q" /app
WORKDIR /app
RUN npm ci

RUN npm install
ARG DATA_CONFIG
ARG OPENTOSCA_ENDPOINT
ARG WINERY_ENDPOINT
ARG NISQ_ANALYZER_ENDPOINT
ARG TRANSFORMATION_FRAMEWORK_ENDPOINT
ARG QISKIT_RUNTIME_HANDLER_ENDPOINT
ARG AWS_RUNTIME_HANDLER_ENDPOINT
ARG SCRIPT_SPLITTER_ENDPOINT
ARG SCRIPT_SPLITTER_THRESHOLD
ARG QRM_REPONAME
ARG QRM_USERNAME
ARG QRM_REPOPATH
ARG PROVENANCE_COLLECTION
ARG ENABLE_DATA_FLOW_PLUGIN
ARG ENABLE_PLANQK_PLUGIN
ARG ENABLE_QHANA_PLUGIN
ARG ENABLE_QUANTME_PLUGIN
ARG ENABLE_OPENTOSCA_PLUGIN
RUN env
RUN npm run build -- --mode=production

EXPOSE 8080

CMD npm run dev
FROM nginxinc/nginx-unprivileged:alpine
USER root
RUN rm -rf /usr/share/nginx/html
COPY --from=builder /app/public /usr/share/nginx/html
USER 101
14 changes: 14 additions & 0 deletions README.md
LaviniaStiliadou marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ npm run dev
```
to start the modeler in a simple html website which runs on localhost:8080.

## Execution in Docker
To serve the application from a Docker container execute:
```
docker run --name workflow-modeler -p 8080:8080 ghcr.io/sequenc-consortium/workflow-modeler
```
Afterwards the application is available in a browser on localhost:8080

To build and run an own image execute:
```
docker build -t workflow-modeler [--build-arg <Key>=<Value>] .
docker run --name workflow-modeler -p 8080:8080 workflow-modeler
```


## How to use this Library

To use the Quantum Workflow Modeler component in your application you have to install its npm package which is published
Expand Down
5 changes: 4 additions & 1 deletion components/bpmn-q/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ module.exports = function (config) {
'test/tests/editor/editor.spec.js',
'test/tests/editor/plugin.spec.js',
'test/tests/planqk/planqk-transformation.spec.js',
'test/tests/quantme/quantme-transformation.spec.js',
'test/tests/editor/utils/modelling-util.spec.js',
'test/tests/qhana/qhana-plugin-config.spec.js',
'test/tests/qhana/qhana-service-configs.spec.js',
'test/tests/quantme/quantme-transformation.spec.js',
'test/tests/quantme/data-object-configs.spec.js',
'test/tests/quantme/quantme-config.spec.js',
'test/tests/opentosca/opentosca-config.spec.js',
'test/tests/opentosca/deployment-utils.spec.js',
'test/tests/opentosca/deployment-model-renderer.spec.js',
'test/tests/dataflow/data-flow-transformation.spec.js',
'test/tests/dataflow/data-flow-plugin-config.spec.js',
'test/tests/dataflow/data-flow-configurations-endpoint.spec.js',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export class QuantumWorkflowModeler extends HTMLElement {
<div id="main-div" style="display: flex; flex: 1; height: 100%">
<div id="canvas" style="width: 100%"></div>
<div id="properties" style="overflow: auto; width:350px; max-height: 93.5vh; background: #f8f8f8;"></div>
<div id="modal-container"></div>
</div>
<div id="qwm-notification-container"></div>
</div>`;
Expand Down
15 changes: 11 additions & 4 deletions components/bpmn-q/modeler-component/editor/plugin/PluginHandler.js
LaviniaStiliadou marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import PlanQKPlugin from '../../extensions/planqk/PlanQKPlugin';
import QuantMEPlugin from '../../extensions/quantme/QuantMEPlugin';
import OpenToscaPlugin from "../../extensions/opentosca/OpenTOSCAPlugin";
import DataFlowPlugin from '../../extensions/data-extension/DataFlowPlugin';
import QHAnaPlugin from '../../extensions/qhana/QHAnaPlugin';
import { getAllConfigs } from './PluginConfigHandler';
Expand Down Expand Up @@ -29,6 +30,10 @@ const PLUGINS = [
{
plugin: PlanQKPlugin,
dependencies: []
},
{
plugin: OpenToscaPlugin,
dependencies: []
}
];

Expand Down Expand Up @@ -72,13 +77,15 @@ export function getActivePlugins() {
export function checkEnabledStatus(pluginName) {
switch (pluginName) {
case 'dataflow':
return process.env.ENABLE_DATA_FLOW_PLUGIN;
return process.env.ENABLE_DATA_FLOW_PLUGIN !== "false";
case 'planqk':
return process.env.ENABLE_PLANQK_PLUGIN;
return process.env.ENABLE_PLANQK_PLUGIN !== "false";
case 'qhana':
return process.env.ENABLE_QHANA_PLUGIN;
return process.env.ENABLE_QHANA_PLUGIN !== "false";
case 'quantme':
return process.env.ENABLE_QUANTME_PLUGIN;
return process.env.ENABLE_QUANTME_PLUGIN !== "false";
case 'opentosca':
return process.env.ENABLE_OPENTOSCA_PLUGIN !== "false";
}
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
color: #636363;
}

.qwm-properties-btn {
box-sizing: border-box;
outline: none;
background-color: transparent;
border: solid;
border-radius: 6px;
font-size: 15px;
font-family: Arial, serif;
font-weight: bold;
margin: 2px;
padding: 8px;
color: #636363;
}

.qwm-shortcuts {
right: 0px;
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ export default class NotificationHandler {
* @param title The title of the notification.
* @param content The text displayed by the notification.
* @param duration The duration in milliseconds.
* @returns {{update: update, close: close}}
*/
displayNotification({type = 'info', title, content, duration = 4000}) {
this.notificationRef.current.displayNotification({
return this.notificationRef.current.displayNotification({
type: type,
title: title,
content: content,
Expand Down
18 changes: 13 additions & 5 deletions components/bpmn-q/modeler-component/editor/util/RenderUtilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,32 @@ function drawRect(parentNode, width, height, borderRadius, color) {
* @param parentGfx The parent element the SVG is drawn in
* @param importSVG The SVG
* @param svgAttributes Attributes for the SVG
* @param foreground true if SVG should be above Task
* @returns The created svg element
*/
export function drawTaskSVG(parentGfx, importSVG, svgAttributes) {
export function drawTaskSVG(parentGfx, importSVG, svgAttributes, foreground) {
const innerSvgStr = importSVG.svg,
transformDef = importSVG.transform;

const groupDef = svgCreate('g');
svgAttr(groupDef, {transform: transformDef});
innerSVG(groupDef, innerSvgStr);

// set task box opacity to 0 such that icon can be in the background
svgAttr(svgSelect(parentGfx, 'rect'), {'fill-opacity': 0});
if(!foreground) {
// set task box opacity to 0 such that icon can be in the background
svgAttr(svgSelect(parentGfx, 'rect'), { 'fill-opacity': 0 });
}

if (svgAttributes) {
svgAttr(groupDef, svgAttributes);
}

// draw svg in the background
parentGfx.prepend(groupDef);
if(foreground) {
parentGfx.append(groupDef);
} else {
parentGfx.prepend(groupDef);
}
return groupDef;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as consts from '../Constants';
export default class DataFlowPaletteProvider {

constructor(bpmnFactory, create, elementFactory, palette, translate) {

this.bpmnFactory = bpmnFactory;
this.create = create;
this.elementFactory = elementFactory;
Expand Down
LaviniaStiliadou marked this conversation as resolved.
Show resolved Hide resolved
KuhnMn marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from "react";

import OpenTOSCATab from "./configTabs/OpenTOSCATab";

import opentoscaStyles from './styling/opentosca.css';
import DeploymentPlugin from "./ui/deployment/services/DeploymentPlugin";
import OpenToscaExtensionModule from "./modeling";
let openToscaModdleExtension = require('./resources/opentosca4bpmn.json');


/**
* Plugin Object of the OpenTOSCA extension. Used to register the plugin in the plugin handler of the modeler.
*/
export default {
buttons: [<DeploymentPlugin/>],
configTabs: [
{
tabId: 'OpenTOSCAEndpointTab',
tabTitle: 'OpenTOSCA',
configTab: OpenTOSCATab,
}
],
extensionModule: OpenToscaExtensionModule,
moddleDescription: openToscaModdleExtension,
name: 'opentosca',
styling: [opentoscaStyles]
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import React, {useState} from 'react';
import {getModeler} from "../../../editor/ModelerHandler";
import * as config from "../framework-config/config-manager";

/**
* React component specifying a tab for the configuration dialog of the modeler. The tab allows the user to change the
* OpenTOSCA and Winery endpoint.
*
* @return {JSX.Element} The tab as a React component
* @constructor
*/
export default function OpenTOSCATab() {

const [opentoscaEndpoint, setOpentoscaEndpoint] = useState(config.getOpenTOSCAEndpoint());
const [wineryEndpoint, setWineryEndpoint] = useState(config.getWineryEndpoint());

const modeler = getModeler();

const editorActions = modeler.get('editorActions');
const eventBus = modeler.get('eventBus');

// register editor action listener for changes in config entries
if (!editorActions._actions.hasOwnProperty('opentoscaEndpointChanged')) {
editorActions.register({
opentoscaEndpointChanged: function (opentoscaEndpoint) {
self.modeler.config.opentoscaEndpoint = opentoscaEndpoint;
}
});
}
if (!editorActions._actions.hasOwnProperty('wineryEndpointChanged')) {
editorActions.register({
wineryEndpointChanged: function (wineryEndpoint) {
self.modeler.config.wineryEndpoint = wineryEndpoint;
eventBus.fire('config.updated', self.modeler.config);
}
});
}

// save changed config entries on close
OpenTOSCATab.prototype.onClose = () => {
modeler.config.opentoscaEndpoint = opentoscaEndpoint;
modeler.config.wineryEndpoint = wineryEndpoint;
config.setOpenTOSCAEndpoint(opentoscaEndpoint);
config.setWineryEndpoint(wineryEndpoint);
};

return <>
<h3>OpenTOSCA</h3>
<table>
<tbody>
<tr className="spaceUnder">
<td align="right">OpenTOSCA Endpoint:</td>
<td align="left">
<input
type="string"
name="opentoscaEndpoint"
value={opentoscaEndpoint}
onChange={event => setOpentoscaEndpoint(event.target.value)}/>
</td>
</tr>
<tr className="spaceUnder">
<td align="right">Winery Endpoint:</td>
<td align="left">
<input
type="string"
name="wineryEndpoint"
value={wineryEndpoint}
onChange={event => setWineryEndpoint(event.target.value)}/>
</td>
</tr>
</tbody>
</table>
</>;
}

OpenTOSCATab.prototype.config = () => {
const modeler = getModeler();

modeler.config.opentoscaEndpoint = config.getOpenTOSCAEndpoint();
modeler.config.wineryEndpoint = config.getWineryEndpoint();
};
Loading
Loading