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

WireViz support #1439

Merged
merged 3 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/cve-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
image: [ kroki, kroki-mermaid, kroki-bpmn, kroki-excalidraw, kroki-blockdiag, kroki-diagramsnet ]
image: [ kroki, kroki-mermaid, kroki-bpmn, kroki-excalidraw, kroki-blockdiag, kroki-diagramsnet, kroki-wireviz ]
tag: [ latest ]
steps:
- name: Run Trivy vulnerability scanner
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/dockerhub-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,12 @@ jobs:
repository: yuzutech/kroki-diagramsnet
short-description: Companion server for Kroki that provides diagrams.net (formerly draw.io)
readme-filepath: ./DOCKERHUB-COMPANION.md

- name: Docker Hub Description - wireviz
uses: peter-evans/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: yuzutech/kroki-wireviz
short-description: Companion server for Kroki that provides WireViz
readme-filepath: ./DOCKERHUB-COMPANION.md
6 changes: 6 additions & 0 deletions DOCKERHUB.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ services:
- KROKI_MERMAID_HOST=mermaid
- KROKI_BPMN_HOST=bpmn
- KROKI_EXCALIDRAW_HOST=excalidraw
- KROKI_WIREVIZ_HOST=wireviz
ports:
- "8000:8000"
blockdiag:
Expand All @@ -58,6 +59,10 @@ services:
image: yuzutech/kroki-excalidraw
ports:
- "8004:8004"
wireviz:
image: yuzutech/kroki-wireviz
ports:
- "8006:8006"
```

If you don't want to use `docker-compose`, you can configure the host and port for each companion container using environment variables:
Expand All @@ -68,6 +73,7 @@ If you don't want to use `docker-compose`, you can configure the host and port f
| `kroki-mermaid` | `KROKI_MERMAID_HOST` | `KROKI_MERMAID_PORT` |
| `kroki-bpmn` | `KROKI_BPMN_HOST` | `KROKI_BPMN_PORT` |
| `kroki-excalidraw` | `KROKI_EXCALIDRAW_HOST` | `KROKI_EXCALIDRAW_PORT` |
| `kroki-wireviz` | `KROKI_WIREVIZ_HOST` | `KROKI_WIREVIZ_PORT` |

For Kubernetes installation follow the description in [install using Kubernetes](https://docs.kroki.io/kroki/setup/install/#_using_kubernetes) section.

Expand Down
13 changes: 12 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ image:https://github.com/yuzutech/kroki/workflows/CI/badge.svg?branch=master[Git
image:https://img.shields.io/badge/zulip-join_chat-brightgreen.svg[Zulip chat, link=https://kroki.zulipchat.com/]
endif::[]

{uri-kroki}[Kroki] provides a unified API with support for BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag, PacketDiag, RackDiag), BPMN, Bytefield, C4 (with PlantUML), D2, DBML, Diagrams.net (experimental), Ditaa, Erd, Excalidraw, GraphViz, Mermaid, Nomnoml, Pikchr, PlantUML, SvgBob, UMLet, Vega, Vega-Lite and WaveDrom... and more to come!
{uri-kroki}[Kroki] provides a unified API with support for BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag, PacketDiag, RackDiag), BPMN, Bytefield, C4 (with PlantUML), D2, DBML, Diagrams.net (experimental), Ditaa, Erd, Excalidraw, GraphViz, Mermaid, Nomnoml, Pikchr, PlantUML, SvgBob, UMLet, Vega, Vega-Lite, WaveDrom and WireViz... and more to come!

== Quickstart

Expand Down Expand Up @@ -109,6 +109,9 @@ A companion web server written in JavaScript (powered by _micro_) that provides
diagrams.net::
A companion web server written in JavaScript (powered by _micro_) that provides _diagrams.net_.

wireviz::
A companion web server written in Python (powered by _Flask_ and _Gunicorn_) that provides _WireViz_.

== Build

=== Gateway Server
Expand Down Expand Up @@ -154,6 +157,9 @@ Excalidraw
yuzutech/kroki-diagramsnet (experimental)::
diagrams.net

yuzutech/kroki-wireviz::
WireViz

You can use `docker-compose` to run multiple containers:

.docker-compose.yml
Expand All @@ -168,6 +174,7 @@ services:
- KROKI_MERMAID_HOST=mermaid
- KROKI_BPMN_HOST=bpmn
- KROKI_EXCALIDRAW_HOST=excalidraw
- KROKI_WIREVIZ_HOST=wireviz
ports:
- "8000:8000"
blockdiag:
Expand All @@ -191,6 +198,10 @@ services:
image: yuzutech/kroki-diagramsnet
expose:
- "8005"
wireviz:
image: yuzutech/kroki-wireviz
ports:
- "8006:8006"
----

$ docker-compose up -d
4 changes: 3 additions & 1 deletion ci/tasks/update-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ const diagramLibraryNames = [
'umlet',
'vega',
'vegalite',
'wavedrom'
'wavedrom',
'wireviz'
]

try {
Expand Down Expand Up @@ -250,6 +251,7 @@ try {
await updateServiceGetVersion('Svgbob.java', diagramLibraryVersions.svgbob)
await updateServiceGetVersion('Umlet.java', diagramLibraryVersions.umlet)
await updateServiceGetVersion('Wavedrom.java', diagramLibraryVersions.wavedrom)
await updateServiceGetVersion('WireViz.java', diagramLibraryVersions.wireviz)
await updateVegaServiceGetVersion(diagramLibraryVersions.vega, diagramLibraryVersions.vegalite)

} catch (err) {
Expand Down
26 changes: 26 additions & 0 deletions ci/tests/diagrams/wireviz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
connectors:
X1:
type: D-Sub
subtype: female
pinlabels: [DCD, RX, TX, DTR, GND, DSR, RTS, CTS, RI]
X2:
type: Molex KK 254
subtype: female
pinlabels: [GND, RX, TX]

cables:
W1:
gauge: 0.25 mm2
length: 0.2
color_code: DIN
wirecount: 3
shield: true

connections:
-
- X1: [5,2,3]
- W1: [1,2,3]
- X2: [1,3,2]
-
- X1: 5
- W1: s
6 changes: 6 additions & 0 deletions ci/tests/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
- KROKI_BPMN_HOST=bpmn
- KROKI_EXCALIDRAW_HOST=excalidraw
- KROKI_DIAGRAMSNET_HOST=diagramsnet
- KROKI_WIREVIZ_HOST=wireviz
ports:
- "8000:8000"

Expand Down Expand Up @@ -41,3 +42,8 @@ services:
image: yuzutech/kroki-diagramsnet:smoketests
expose:
- "8005"

wireviz:
image: yuzutech/kroki-wireviz:smoketests
ports:
- "8006:8006"
3 changes: 2 additions & 1 deletion ci/tests/smoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const tests = [
{engine: 'diagramsnet', file: 'diagramsnet-network.xml', outputFormat: ['svg', 'png']},
{engine: 'diagramsnet', file: 'diagramsnet-ui.xml', outputFormat: ['svg', 'png']},
{engine: 'diagramsnet', file: 'diagramsnet-venn.xml', outputFormat: ['svg', 'png']},
{engine: 'd2', file: 'connections.d2', outputFormat: ['svg']}
{engine: 'd2', file: 'connections.d2', outputFormat: ['svg']},
{engine: 'wireviz', file: 'wireviz.yaml', outputFormat: ['svg', 'png']}
]

chai.use(chaiHttp)
Expand Down
4 changes: 4 additions & 0 deletions docker-bake-release.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ target "kroki-excalidraw" {
target "kroki-diagramsnet" {
tags = ["yuzutech/kroki-diagramsnet:${RELEASE_VERSION}", "yuzutech/kroki-diagramsnet:latest"]
}

target "kroki-wireviz" {
tags = ["yuzutech/kroki-wireviz:${RELEASE_VERSION}", "yuzutech/kroki-wireviz:latest"]
}
6 changes: 5 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ variable "TAG" {
}

group "default" {
targets = ["kroki", "kroki-blockdiag", "kroki-mermaid", "kroki-bpmn", "kroki-excalidraw", "kroki-diagramsnet"]
targets = ["kroki", "kroki-blockdiag", "kroki-mermaid", "kroki-bpmn", "kroki-excalidraw", "kroki-diagramsnet", "kroki-wireviz"]
}

target "kroki" {
Expand Down Expand Up @@ -44,3 +44,7 @@ target "kroki-diagramsnet" {
tags = ["yuzutech/kroki-diagramsnet:${TAG}"]
}

target "kroki-wireviz" {
context = "wireviz"
tags = ["yuzutech/kroki-wireviz:${TAG}"]
}
1 change: 1 addition & 0 deletions docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ asciidoc:
vega-version: 5.22.1
vegalite-version: 5.6.0
wavedrom-version: 2.9.1
wireviz-version: 0.3.2
uri-docker-get-started: https://docs.docker.com/get-started/
uri-podman-get-started: https://podman.io/getting-started/
uri-docker-compose-install: https://docs.docker.com/compose/install/
Expand Down
14 changes: 14 additions & 0 deletions docs/modules/ROOT/pages/architecture.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ A companion web server written in JavaScript (powered by _micro_) that provides
Diagrams.net::
A companion web server written in JavaScript (powered by _micro_) that provides https://www.diagrams.net/[_diagrams.net_] to render diagrams.

WireViz::
A companion web server written in Python (powered by _Flask_ and _Gunicorn_) that provides WireViz.

== Gateway Server

The `yuzutech/kroki` Docker image contains the following diagrams libraries out-of-the-box:
Expand Down Expand Up @@ -155,3 +158,14 @@ The `yuzutech/kroki-diagramsnet` Docker image contains the following diagrams li
|https://www.diagrams.net/[diagrams.net]
|{diagramsnet-version}
|===

=== WireViz

The `yuzutech/kroki-wireviz` Docker image contains the following diagrams libraries out-of-the-box:

[options="header",cols="1,1m"]
|===
|Diagram Type | Version
|https://github.com/formatc1702/WireViz[WireViz]
|{wireviz-version}
|===
1 change: 1 addition & 0 deletions docs/modules/ROOT/pages/diagram-types.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Diagram::
* Bytefield diagram
* Excalidraw
* https://www.diagrams.net/[diagrams.net] (experimental)
* WireViz

Visualization::
* Bar charts
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Kroki provides a unified HTTP API with support for BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag, PacketDiag, RackDiag),
BPMN, Bytefield, C4 (with PlantUML), Diagrams.net (experimental), Ditaa, Erd, Excalidraw, GraphViz, Mermaid, Nomnoml, PlantUML, Structurizr, SvgBob, UMLet,
Vega, Vega-Lite and WaveDrom... and more to come!
Vega, Vega-Lite, WaveDrom and WireViz... and more to come!

Kroki is available as a Self-Managed instance. +
We are also _actively_ looking for sponsors to provide Kroki as a free service:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ spec:
value: excalidraw
- name: KROKI_MERMAID_HOST
value: mermaid
- name: KROKI_WIREVIZ_HOST
value: wireviz
image: yuzutech/kroki
name: kroki
ports:
Expand Down
23 changes: 23 additions & 0 deletions docs/modules/setup/examples/k8s-multi-pod/wireviz-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
labels:
app: wireviz
name: wireviz
spec:
replicas: 1
selector:
matchLabels:
app: wireviz
template:
metadata:
labels:
app: wireviz
spec:
containers:
- image: yuzutech/kroki-wireviz
name: wireviz
ports:
- containerPort: 8006
restartPolicy: Always
15 changes: 15 additions & 0 deletions docs/modules/setup/examples/k8s-multi-pod/wireviz-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: v1
kind: Service
metadata:
annotations:
labels:
app: wireviz
name: wireviz
spec:
ports:
- name: "8006"
port: 8006
targetPort: 8006
selector:
app: wireviz
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ spec:
value: localhost
- name: KROKI_EXCALIDRAW_HOST
value: localhost
- name: KROKI_WIREVIZ_HOST
value: localhost
ports:
- protocol: TCP
containerPort: 8000
Expand All @@ -49,4 +51,9 @@ spec:
image: docker.io/yuzutech/kroki-excalidraw:latest
ports:
- protocol: TCP
containerPort: 8004
containerPort: 8004
- name: kroki-wireviz
image: docker.io/yuzutech/kroki-wireviz:latest
ports:
- protocol: TCP
containerPort: 8006
5 changes: 5 additions & 0 deletions docs/modules/setup/examples/kroki-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
- KROKI_MERMAID_HOST=mermaid
- KROKI_BPMN_HOST=bpmn
- KROKI_EXCALIDRAW_HOST=excalidraw
- KROKI_WIREVIZ_HOST=wireviz
ports:
- "8000:8000"
blockdiag:
Expand All @@ -31,3 +32,7 @@ services:
expose:
- "8004"

wireviz:
image: yuzutech/kroki-wireviz
ports:
- "8006"
2 changes: 2 additions & 0 deletions docs/modules/setup/pages/configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ KROKI_BPMN_HOST:: Host of the BPMN container (default: `127.0.0.1`).
KROKI_BPMN_PORT:: Port of the BPMN container (default: `8003`).
KROKI_EXCALIDRAW_HOST:: Host of the Excalidraw container (default: `127.0.0.1`).
KROKI_EXCALIDRAW_PORT:: Port of the Excalidraw container (default: `8004`).
KROKI_WIREVIZ_HOST:: Host of the WireViz container (default: `127.0.0.1`).
KROKI_WIREVIZ_PORT:: Port of the WireViz container (default: `8006`).

NOTE: If you are using the default `docker-compose.yaml` file you can rely on the default values.

Expand Down
7 changes: 7 additions & 0 deletions docs/modules/setup/pages/install.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:uri-docker-kroki-bpmn-image: https://hub.docker.com/r/yuzutech/kroki-bpmn
:uri-docker-kroki-excalidraw-image: https://hub.docker.com/r/yuzutech/kroki-excalidraw
:uri-docker-kroki-diagramsnet-image: https://hub.docker.com/r/yuzutech/kroki-diagramsnet
:uri-docker-kroki-wireviz-image: https://hub.docker.com/r/yuzutech/kroki-wireviz
// URIs of diagram generation application sites by diagram name
:uri-blockdiag: http://blockdiag.com/en/blockdiag/index.html
:uri-seqdiag: http://blockdiag.com/en/seqdiag/index.html
Expand All @@ -17,6 +18,7 @@
:uri-bpmn: https://bpmn.io/toolkit/bpmn-js/
:uri-excalidraw: https://excalidraw.com/
:uri-diagramsnet: https://diagrams.net/
:uri-wireviz: https://github.com/formatc1702/WireViz

This section covers installing Kroki locally.

Expand Down Expand Up @@ -117,6 +119,7 @@ These optional companion containers provide additional diagrams and require the
// * <<yuzutech-kroki-bpmn,Kroki bpmn>>
// * <<yuzutech-kroki-excalidraw,Kroki excalidraw>>
// * <<yuzutech-kroki-mermaid,Kroki mermaid>>
// * <<yuzutech-kroki-wireviz,Kroki wireviz>>

[#yuzutech-kroki-blockdiag]
{uri-docker-kroki-blockdiag-image}[yuzutech/kroki-blockdiag^]::
Expand All @@ -143,3 +146,7 @@ Provides flowchart, sequence and Gantt diagrams for Kroki using the {uri-mermaid
[#yuzutech-kroki-diagramsnet]
{uri-docker-kroki-diagramsnet-image}[yuzutech/kroki-diagramsnet^] (experimental)::
Provides diagrams for Kroki using the {uri-diagramsnet}[diagrams.net^] library.

[#yuzutech-kroki-wireviz]
{uri-docker-kroki-wireviz-image}[yuzutech/kroki-wireviz^]::
Provides diagrams for Kroki using the {uri-wireviz}[WireViz^] library.
8 changes: 8 additions & 0 deletions docs/modules/setup/pages/use-kubernetes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ kubectl apply -f {uri-k8s-kroki-examples}/excalidraw-deployment.yaml
kubectl apply -f {uri-k8s-kroki-examples}/excalidraw-service.yaml
----

.Add WireViz service
[source,cli,subs=+attributes]
----
kubectl apply -f {uri-k8s-kroki-examples}/wireviz-deployment.yaml
kubectl apply -f {uri-k8s-kroki-examples}/wireviz-service.yaml
----

.Add Kroki service
[source,cli,subs=+attributes]
----
Expand Down Expand Up @@ -127,6 +134,7 @@ bpmn-6cfccf9bc4-6w4px 1/1 Running 0 24s
excalidraw-5b84995fcb-dh57t 1/1 Running 0 24s
kroki-6b49bcb7c4-x2ksc 1/1 Running 0 23s
mermaid-7bff5c9959-hkrxx 1/1 Running 0 22s
wireviz-8c778ff7a8-7ds7c 1/1 Running 0 24s
....

. To make sure that Kroki is working, open a terminal and type:
Expand Down
Loading