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

Use pre-built binary for GraphViz #1522

Merged
merged 4 commits into from
May 1, 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
20 changes: 5 additions & 15 deletions ci/tasks/update-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ try {
const { version } = plantumlVersionFound.groups
diagramLibraryVersions.plantuml = version
}
const graphvizVersionFound = line.match(/^ARG GRAPHVIZ_VERSION="(?<version>.+)"$/)
if (graphvizVersionFound) {
const { version } = graphvizVersionFound.groups
diagramLibraryVersions.graphviz = version
}
}

const svgbobCargoContent = await fs.readFile(ospath.join(rootDir, 'server', 'ops', 'docker', 'Cargo.toml'), 'utf8')
Expand All @@ -215,21 +220,6 @@ try {
const { value: ditaaVersion } = await mvnEvaluateExpression('ditaa-mini.version')
diagramLibraryVersions.ditaa = ditaaVersion

// GraphViz version
const ubuntuPackagesUrl = `https://packages.ubuntu.com/${KROKI_UBUNTU_VERSION}/graphviz`
const ubuntuPackagesResponse = await fetch(ubuntuPackagesUrl)
if (ubuntuPackagesResponse.status >= 200 && ubuntuPackagesResponse.status < 400) {
const ubuntuPackagesContent = await ubuntuPackagesResponse.text()
const found = ubuntuPackagesContent.match(/Package: graphviz \((?<version>[0-9.]+)-[0-9]+\)/)
if (found) {
const { version } = found.groups
diagramLibraryVersions.graphviz = version
}
} else {
console.error(`Unable to GET ${ubuntuPackagesUrl} - ${ubuntuPackagesResponse.status} ${ubuntuPackagesResponse.statusText} - ${await ubuntuPackagesResponse.text()}`)
process.exit(1)
}

console.log({
diagramLibraryVersions: Object.fromEntries(Object.entries(diagramLibraryVersions).sort((a, b) => a[0].localeCompare(b[0]))),
count: Object.keys(diagramLibraryVersions).length
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ asciidoc:
ditaa-version: 1.0.3
erd-version: 0.2.1.0
excalidraw-version: 0.14.2
graphviz-version: 2.42.2
graphviz-version: 8.0.4
mermaid-version: 9.4.3
nomnoml-version: 1.5.3
nwdiag-version: 3.0.0
Expand Down
9 changes: 8 additions & 1 deletion server/ops/docker/jdk11-jammy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ FROM eclipse-temurin:11.0.18_10-jre-jammy
ARG D2_VERSION="0.4.1"
ARG PLANTUML_VERSION="1.2023.6"
ARG UMLET_VERSION="2023-03-20_UMLet_v15.1"
ARG PLANTUML_VERSION="1.2023.6"
ARG GRAPHVIZ_VERSION="8.0.4"
ARG TARGETARCH

RUN addgroup --gecos 1000 kroki && adduser --disabled-password --ingroup kroki -u 1000 kroki
Expand All @@ -224,11 +226,13 @@ RUN addgroup --gecos 1000 kroki && adduser --disabled-password --ingroup kroki -
# * texlive-pictures - Provides various graphics packages like "circuitikz"
# * texlive-science - Provides various science packages like "siunitx"
RUN apt-get update && apt-get install --no-install-recommends --yes \
libgd3 \
libjpeg9 \
giflib-tools \
graphviz \
fonts-freefont-ttf \
fonts-noto-cjk \
fonts-liberation \
gsfonts \
ghostscript \
poppler-utils \
texlive \
Expand All @@ -238,6 +242,9 @@ RUN apt-get update && apt-get install --no-install-recommends --yes \
texlive-science && \
apt-get clean && apt-get autoremove

RUN wget "https://github.com/yuzutech/graphviz-builder/releases/download/${GRAPHVIZ_VERSION}/dot-linux-${TARGETARCH}" -O /usr/bin/dot && \
chmod +x /usr/bin/dot

RUN wget "https://github.com/terrastruct/d2/releases/download/v${D2_VERSION}/d2-v${D2_VERSION}-linux-${TARGETARCH}.tar.gz" -O - | tar -zxv -C /usr/bin d2-v${D2_VERSION}/bin/d2 && \
mv usr/bin/d2-v${D2_VERSION}/bin/d2 /usr/bin/d2 && \
chmod +x /usr/bin/d2
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/io/kroki/server/service/Graphviz.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public SourceDecoder getSourceDecoder() {

@Override
public String getVersion() {
return "2.42.2";
return "8.0.4";
}

@Override
Expand Down