Skip to content

Commit

Permalink
Merge pull request #9 from UST-DeMAF/dev
Browse files Browse the repository at this point in the history
Feat(ES-38): Implement the Visualization Service
  • Loading branch information
365Bit authored Sep 29, 2024
2 parents 0cfe51d + e1729f2 commit 6c8abc3
Show file tree
Hide file tree
Showing 47 changed files with 4,426 additions and 1,174 deletions.
32 changes: 32 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Preparations
Please check if the PR fulfills these requirements
- [ ] Readme (How to Install, Run, Use and Configure) wurde aktualisiert falls nötig
- [ ] The feature has a documentation
- [ ] Unit tests for new features are available and working (if possible)
- [ ] All tests have to be successful
- [ ] At least one reviewer has to accept the pull request
- [ ] All open threads are resolved
## :ticket: Description


* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)



* **What is the current behavior?** (You can also link to an open issue here)



* **What is the new behavior (if this is a feature change)?**



* **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?)



* **Other information**:


## :lock: Closes
Which issue(s) is (are) being closed by the PR?
37 changes: 17 additions & 20 deletions .github/workflows/buildAndPushImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,30 @@ on:
push:
branches:
- 'main'
- 'dev'
- 'nightly'
pull_request:
branches:
- 'main'

env:
IMAGE_NAME: layout-pipeline
IMAGE_URL: ghcr.io/ust-demaf
IMAGE_NAME: visualization-service
IMAGE_TAG: ${{ github.ref == 'refs/heads/main' && 'latest' || github.ref == 'refs/heads/dev' && 'testing' || 'nightly' }}

jobs:
build-with-paketo-push-2-dockerhub:
build-using-dockerfile-push-2-ghcr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'true'

- name: Login to DockerHub Container Registry
run: echo $DOCKER_HUB_TOKEN | docker login -u 365bit --password-stdin
env:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKERHUBTOKEN }}

- name: Install pack CLI via the official buildpack Action https://github.com/buildpacks/github-actions#setup-pack-cli-action
uses: buildpacks/github-actions/[email protected]
- name: Login to GitHub Container Registry
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u well5a --password-stdin

- name: Build the Docker image
run: docker build . --file Dockerfile --tag $IMAGE_URL/$IMAGE_NAME:$IMAGE_TAG

- name: Build app with pack CLI using Buildpack Cache image (see https://buildpacks.io/docs/app-developer-guide/using-cache-image/) & publish to Docker Hub
run: |
pack build index.docker.io/365bit/$IMAGE_NAME:latest \
--builder paketobuildpacks/builder:base \
--path . \
--env BP_INCLUDE_FILES="src/*" \
--env BP_JVM_VERSION=17 \
--env BPL_JAVA_NMT_ENABLED=false \
--cache-image index.docker.io/365bit/$IMAGE_NAME-paketo-cache-image:latest \
--publish
- name: Push the Docker image
run: docker push $IMAGE_URL/$IMAGE_NAME:$IMAGE_TAG
61 changes: 59 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,59 @@
.idea/
target/
# Compiled class file
*.class

# Log file
*.log
*.log.*.gz
*.log.*.tmp

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM alpine:latest

RUN apk upgrade --no-cache \
&& apk add --no-cache curl graphviz maven openjdk17

RUN mkdir -p /app/target
WORKDIR /app

COPY pom.xml .
COPY src ./src

RUN mvn clean package

CMD java -jar target/visualization-service-0.1.0-SNAPSHOT.jar
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
# layout-pipeline
# visualization-service
The visualization-service is one of many plugins of the [DeMAF](https://github.com/UST-DeMAF) project.
It was developed to layout [EDMM Models](https://github.com/UST-EDMM) automatically with the help of [GraphVIZ](https://gitlab.com/graphviz/graphviz) and to visualize them with [Eclipse Winery](https://github.com/winery/winery/).

The plugin only works (without adaptions) in the context of the entire DeMAF application using the [deployment-config](https://github.com/UST-DeMAF/deployment-config).
The documentation for setting up the entire DeMAF application locally is [here](https://github.com/UST-DeMAF/EnPro-Documentation).

## Build and Run Application

You can run the application without the [deployment-config](https://github.com/UST-DeMAF/deployment-config), but it will not run as it needs to register itself at the [analysis-manager](https://github.com/UST-DeMAF/analysis-manager).

If you want to boot it locally nevertheless use the following commands.

```shell
mvn clean package
java -jar target/visualization-service-0.1.0-SNAPSHOT.jar
```

## Usage of Application
To visualize an EDMM model, follow steps 1-6 from [here](https://github.com/UST-DeMAF/EnPro-Documentation?tab=readme-ov-file#getting-started).
Then enter the following command in the DeMAF-shell:

```shell
transform --location file:/usr/share/filename.yaml --technology visualization-service --options dpi=96,flatten=partial,width=1920,height=1080,visualize=true
```

The plugin supports the following flags:
- `visualize=true/false` *(default true)*
- `height=pixel` *(default 1920)*
- `width=pixel` *(default 1080)*
- `flatten=true/false/partial` *(default false)*
- `dpi=pixels per inch of your display` *(default 96 dpi)*

The options arguments can also be specified in other transformations; these are then passed on to the visualization-service for automatic visualization.

## Visualization Service-Specific Configurations
This plugin has a few specialties compared to other DeMAF plugins:
1. Automatic execution: As long as the option `visualize=false` is not specified during the transformation, this plugin is automatically called to visualize the model after a successful transformation into an EDMM model.
2. No directories: Since EDMM models are typically defined in a single YAML file, no directories are supported as a location.

## Debugging
When running the project locally using e.g. IntelliJ IDEA or from the command-line, make sure that the plugin is not also running
in a Docker container, launched by the deployment-config, otherwise the port is blocked.
55 changes: 0 additions & 55 deletions example.dot

This file was deleted.

Loading

0 comments on commit 6c8abc3

Please sign in to comment.