This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/training.git
The following commit(s) were added to refs/heads/develop by this push:
new 06ca5bb chore: Updated the Docker setup in the archetype to match the
one of the root of the project (containing pinned versions of most tools)
06ca5bb is described below
commit 06ca5bb27a63e85c1f683c14a8e0bad19bb3619e
Author: Christofer Dutz <[email protected]>
AuthorDate: Sat Aug 30 14:28:03 2025 +0200
chore: Updated the Docker setup in the archetype to match the one of the
root of the project (containing pinned versions of most tools)
---
.../IoT/magic-industrial-data-acquisition/pom.xml | 2 +-
.../main/resources/archetype-resources/Dockerfile | 170 ++++++++++++++-------
.../archetype-resources/docker-compose.yaml | 1 -
.../archetype-resources/requirements-legacy.txt | 5 +
.../archetype-resources/requirements-modern.txt | 15 ++
5 files changed, 132 insertions(+), 61 deletions(-)
diff --git a/content/IoT/magic-industrial-data-acquisition/pom.xml
b/content/IoT/magic-industrial-data-acquisition/pom.xml
index 3c43af8..fc4f790 100644
--- a/content/IoT/magic-industrial-data-acquisition/pom.xml
+++ b/content/IoT/magic-industrial-data-acquisition/pom.xml
@@ -24,7 +24,7 @@
<groupId>org.apache.training</groupId>
<artifactId>content-parent-pom</artifactId>
<version>1.3.0</version>
- <relativePath/>
+ <relativePath>../../../tools/content-parent-pom/pom.xml</relativePath>
</parent>
<groupId>org.apache.training.content</groupId>
diff --git
a/tools/content-archetype/src/main/resources/archetype-resources/Dockerfile
b/tools/content-archetype/src/main/resources/archetype-resources/Dockerfile
index 95f8d06..c8eadd6 100644
--- a/tools/content-archetype/src/main/resources/archetype-resources/Dockerfile
+++ b/tools/content-archetype/src/main/resources/archetype-resources/Dockerfile
@@ -20,62 +20,114 @@
# Fixed version of this in order to have a fixed JDK version
FROM azul/zulu-openjdk:21 as build
-# Install some stuff we need to run the build
-RUN apt update -y
-RUN apt install -y git graphviz wget bzip2 python3 python3-pip imagemagick
curl protobuf-compiler mc
-
-# Install the version 1.76.0 of the Rust toolchain
-RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
--default-toolchain=1.76.0
-ENV PATH="/root/.cargo/bin:$PATH"
-# Install svgbob
-RUN cargo install svgbob_cli
-RUN cp /root/.cargo/bin/svgbob_cli /usr/local/bin
-
-# Forced version of pillow as with version 10 the build fails
-RUN python3 -m pip install --upgrade pip setuptools==57.5.0 seqdiag blockdiag
actdiag nwdiag convert racks opc-diag pillow==9.5.0
-
-#ENV CONDA_DIR /opt/conda
-#RUN wget
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh -O
/root/miniconda.sh
-#RUN sh /root/miniconda.sh -b -p $CONDA_DIR
-#ENV PATH=$CONDA_DIR/bin:$PATH
-#RUN conda update -y conda
-#RUN rm /root/miniconda.sh
-#RUN wget --quiet
https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
-O /root/miniconda.sh && sh /root/miniconda.sh -b -p /opt/conda
-#ENV PATH=$CONDA_DIR/bin:$PATH
-
-# Install vg2svg for rendering vega diagrams
-# NOTE: Installing vega-cli doesn't seem to work as dependencies are not
available for arm64 (silicon)
-ENV NODE_VERSION=18.20.4
-RUN curl --silent -o-
https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
-RUN /root/.nvm/install.sh
-ENV PATH=/root/.nvm/versions/node/v$NODE_VERSION/bin:$PATH
-#RUN npm install --no-audit vega
-
-#RUN wget
https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
-#RUN bunzip2 phantomjs-2.1.1-linux-x86_64.tar.bz2
-#RUN tar -xvf phantomjs-2.1.1-linux-x86_64.tar
-
-# Install ERD
-RUN apt install -y golang
-ENV PATH=/root/go/bin:$PATH
-RUN go install github.com/kaishuu0123/[email protected]
-
-# Install Syntrax
-# https://kevinpt.github.io/syntrax/
-# Problem is, that newer versions of python don't have use_2to3
-#RUN apt install -y libcairo2-dev pkg-config python3-dev python3-gi
python3-gi-cairo gir1.2-gtk-4.0
-RUN apt install -y libcairo2-dev pkg-config python3-dev python3-gi
gir1.2-gtk-4.0
-RUN python3 -m pip install --upgrade pycairo pango syntrax
-# For some reason, if we install this before the python stuff, it doesn't work
-RUN apt install -y python3-gi-cairo
-
-# Install Mermaid
-# Mermaid seems to have issues with Apple Silicon
-#RUN apt install -y nodejs npm
-RUN npm install -g @mermaid-js/mermaid-cli
-
-# Required for running on Windows systems
-RUN apt install -y dos2unix
-
-# Change the working directory (where commands are executed) into the new "ws"
directory
-WORKDIR /ws
\ No newline at end of file
+# --- Versions in one place ---
+ARG RUST_TOOLCHAIN=1.89.0
+ARG SVGBOB_VERSION=0.7.6
+ARG NODE_VERSION=22.18.0
+ARG NVM_VERSION=0.40.3
+ARG GO_VERSION=1.25.0
+# mermaid-cli 10.x is broadly compatible and avoids breaking changes in 11
+ARG MERMAID_CLI_VERSION=10.9.1
+ARG ERD_GO_VERSION=1.4.6
+
+ENV DEBIAN_FRONTEND=noninteractive
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+
+# System dependencies
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends \
+ ca-certificates \
+ git \
+ graphviz \
+ wget \
+ bzip2 \
+ python3 \
+ python3-pip \
+ python3-dev \
+ python3-dbus \
+ pkg-config \
+ imagemagick \
+ curl \
+ protobuf-compiler \
+ mc \
+ libcairo2-dev \
+ python3-gi \
+ gir1.2-gtk-4.0 \
+ dos2unix \
+ build-essential \
+ && rm -rf /var/lib/apt/lists/*
+
+# -------------------------
+# Rust
+# -------------------------
+RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
+ | sh -s -- -y --default-toolchain="${RUST_TOOLCHAIN}"
+ENV PATH="/root/.cargo/bin:${PATH}"
+
+# svgbob_cli pinned (use --locked to respect Cargo.lock of the crate and
ensure reproducibility)
+RUN cargo install svgbob_cli --version "${SVGBOB_VERSION}" --locked \
+ && cp /root/.cargo/bin/svgbob_cli /usr/local/bin/
+
+# -------------------------
+# Python
+# -------------------------
+COPY requirements-legacy.txt /tmp/requirements-legacy.txt
+COPY requirements-modern.txt /tmp/requirements-modern.txt
+
+# 1) Ensure old setuptools is present and *kept* for legacy packages
+RUN python3 -m pip install --no-cache-dir "pip==24.2" "setuptools==57.5.0"
"wheel<0.40"
+
+# 2) Install legacy packages using that setuptools (no isolated build env!)
+RUN python3 -m pip install --no-cache-dir --no-build-isolation -r
/tmp/requirements-legacy.txt
+
+# 3) Install the rest (these can use modern build behavior)
+RUN python3 -m pip install --no-cache-dir -r /tmp/requirements-modern.txt
+
+# -------------------------
+# Node
+# -------------------------
+ENV NVM_DIR=/root/.nvm
+RUN curl -fsSL
https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh -o
/root/install_nvm.sh \
+ && bash /root/install_nvm.sh \
+ && . "$NVM_DIR/nvm.sh" \
+ && nvm install ${NODE_VERSION} \
+ && nvm alias default ${NODE_VERSION} \
+ && nvm use default
+ENV PATH="${NVM_DIR}/versions/node/v${NODE_VERSION}/bin:${PATH}"
+
+# Mermaid CLI pinned
+RUN npm install -g @mermaid-js/mermaid-cli@${MERMAID_CLI_VERSION}
+
+# -------------------------
+# Go
+# -------------------------
+RUN arch="$(uname -m)"; \
+ case "$arch" in \
+ x86_64) go_arch=amd64 ;; \
+ aarch64|arm64) go_arch=arm64 ;; \
+ *) echo "Unsupported arch: $arch" && exit 1 ;; \
+ esac; \
+ curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${go_arch}.tar.gz" -o
/tmp/go.tgz \
+ && tar -C /usr/local -xzf /tmp/go.tgz \
+ && rm /tmp/go.tgz
+ENV PATH="/usr/local/go/bin:${PATH}"
+ENV GOPATH="/root/go"
+ENV PATH="${GOPATH}/bin:${PATH}"
+
+# erd-go pinned
+RUN go install github.com/kaishuu0123/erd-go@v${ERD_GO_VERSION}
+
+# -------------------------
+# GTK Cairo Python bridge (must be after Python deps for syntrax)
+# -------------------------
+# python3-gi-cairo is separate and sometimes needs to be installed last
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends python3-gi-cairo \
+ && rm -rf /var/lib/apt/lists/*
+
+RUN python3 -m pip freeze > /requirements-frozen.txt
+
+# -------------------------
+# Final touches
+# -------------------------
+WORKDIR /ws
diff --git
a/tools/content-archetype/src/main/resources/archetype-resources/docker-compose.yaml
b/tools/content-archetype/src/main/resources/archetype-resources/docker-compose.yaml
index c33a0a3..7d57205 100644
---
a/tools/content-archetype/src/main/resources/archetype-resources/docker-compose.yaml
+++
b/tools/content-archetype/src/main/resources/archetype-resources/docker-compose.yaml
@@ -17,7 +17,6 @@
# under the License.
#
-version: "3.8"
services:
builder:
build:
diff --git
a/tools/content-archetype/src/main/resources/archetype-resources/requirements-legacy.txt
b/tools/content-archetype/src/main/resources/archetype-resources/requirements-legacy.txt
new file mode 100644
index 0000000..49c37ca
--- /dev/null
+++
b/tools/content-archetype/src/main/resources/archetype-resources/requirements-legacy.txt
@@ -0,0 +1,5 @@
+syntrax==1.0
+blockdiag==3.0.0
+actdiag==3.0.0
+nwdiag==3.0.0
+seqdiag==3.0.0
\ No newline at end of file
diff --git
a/tools/content-archetype/src/main/resources/archetype-resources/requirements-modern.txt
b/tools/content-archetype/src/main/resources/archetype-resources/requirements-modern.txt
new file mode 100644
index 0000000..b02490c
--- /dev/null
+++
b/tools/content-archetype/src/main/resources/archetype-resources/requirements-modern.txt
@@ -0,0 +1,15 @@
+pip==24.2
+convert==0.1.2
+#dbus-python==1.2.18
+docopt==0.6.2
+funcparserlib==2.0.0a0
+lxml==6.0.1
+nwdiag==3.0.0
+opc-diag==1.1.1
+pango==0.0.1
+Pillow==9.5.0
+pycairo==1.28.0
+PyGObject==3.42.1
+racks==1.0.0
+termcolor==3.1.0
+webcolors==24.11.1
\ No newline at end of file