eclipse-sparkplug / sparkplug

Sparkplug
Eclipse Public License 2.0
114 stars 39 forks source link

Question: Run Sparkplug TCK in docker compose? #530

Closed figgegrahn closed 1 month ago

figgegrahn commented 1 month ago

What do you want to know?

Our team are trying run Sparkplug TCK as part of a docker compose but run into problems when trying to run the webconsole. Has anyone in this community successfully done this in the past? I'm not too familiar with the node/yarn ecosystem and get these error messages when running yarn install from inside a docker container (which has internet connectivity, I can run e.g. apt install):

➤ YN0013: │ @babel/parser@npm:7.15.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0001: │ Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
    at PassThrough.onclose (node:internal/streams/end-of-stream:154:30)
    at PassThrough.emit (node:events:519:28)
    at emitCloseNT (node:internal/streams/destroy:147:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21)

Any help appreciated, thanks!

Is this related to a Sparkplug Listing request? If so, link the issue from https://github.com/eclipse-sparkplug/sparkplug.listings here.

No response

Version

3.0.0 (Default)

Accept EFTL Terms

figgegrahn commented 1 month ago

For a little bit more context, this is the Dockerfile I'm experimenting with:

FROM eclipse-temurin:11-jdk
LABEL maintainer "Tim Brust <github@timbrust.de>"

ARG REFRESHED_AT
ENV REFRESHED_AT $REFRESHED_AT
ARG NODE_MAJOR=20

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN printf 'Package: nodejs\nPin: origin deb.nodesource.com\nPin-Priority: 1001' > /etc/apt/preferences.d/nodesource \
  && mkdir -p /etc/apt/keyrings \
  && apt-get update -qq \
  && apt-get install -qq --no-install-recommends \
    gpg \
    gpg-agent \
  && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
  && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
  && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
  && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
  && apt-get update -qq \
  && apt-get install -qq --no-install-recommends \
    nodejs \
    yarn \
    git \
    curl \
  && apt-get upgrade -qq
  # && rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/eclipse-sparkplug/sparkplug.git

WORKDIR /sparkplug/tck/webconsole

RUN corepack enable
RUN yarn set version 3.0.1
RUN yarn install
RUN yarn build
CMD ["yarn", "start"]

Trying to build with docker build fails at yarn install . If I comment out the failing last three lines and run the container interactively I see the versions below:

root@SFDLSE5LBJPN3:/sparkplug/tck/webconsole# yarn --version
3.0.1
root@SFDLSE5LBJPN3:/sparkplug/tck/webconsole# node --version
v20.17.0
root@SFDLSE5LBJPN3:/sparkplug/tck/webconsole# java -version
openjdk version "11.0.24" 2024-07-16
OpenJDK Runtime Environment Temurin-11.0.24+8 (build 11.0.24+8)
OpenJDK 64-Bit Server VM Temurin-11.0.24+8 (build 11.0.24+8, mixed mode, sharing)
rosstitmarsh commented 1 month ago

I have got this working here https://github.com/rosstitmarsh/Sparkplug-TCK-Docker-Compose You could cut the Dockerfile down a lot if you just want the webconsole, my one sets up the HiveMQ with the Sparkplug aware extension too.

figgegrahn commented 1 month ago

Thank you so much, Ross! Lokks great and I learned a few compose tricks there as well. I had the TCK extension with hivemq in another dockerfile, but this was so much cleaner. Awesome!

Den mån 16 sep. 2024 kl 19:47 skrev Ross Titmarsh @.***

:

I have got this working here https://github.com/rosstitmarsh/Sparkplug-TCK-Docker-Compose You could cut the Dockerfile down a lot if you just want the webconsole, my one sets up the HiveMQ with the Sparkplug aware extension too.

— Reply to this email directly, view it on GitHub https://github.com/eclipse-sparkplug/sparkplug/issues/530#issuecomment-2353539943, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACENVVUXRPQDKKNNSJM3WADZW4KSNAVCNFSM6AAAAABOIZ27Q6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJTGUZTSOJUGM . You are receiving this because you authored the thread.Message ID: @.***>