INTO-CPS-Association / fmu-rabbitmq

RabbitMQ FMU: an fmu that subscribes and publishes data to the RabbitMQ server.
Other
9 stars 6 forks source link

Dependencies broken in latest ubuntu (22.04) #57

Open clagms opened 1 year ago

clagms commented 1 year ago

It seems that if Rabbitmq is loaded in a dockerfile like the following, it will fail due to missing dependency:

FROM ubuntu:latest

RUN apt-get update && apt-get install -y openjdk-11-jdk wget tzdata

RUN DEBIAN_FRONTEND=noninteractive && apt-get install -y tzdata

CMD tail -F anything

As of today, the latest ubuntu is 22.04

It will give the following error:

Interpretation load took: 457797588
error: Could not load /fmus/rmq_controller/rmqfmuv2.1.5/binaries/linux64/rabbitmq.so
libicuuc.so.66: cannot open shared object file: No such file or directoryjava.lang.Exception: Load failed!!!
        at org.intocps.fmi.jnifmuapi.NativeFmu.nLoadLibrary(Native Method)
        at org.intocps.fmi.jnifmuapi.DirectoryFmu.internalLoad(DirectoryFmu.java:158)
        at org.intocps.fmi.jnifmuapi.DirectoryFmu.load(DirectoryFmu.java:121)
        at org.intocps.maestro.interpreter.Fmi2Interpreter.createFmiValue(Fmi2Interpreter.java:738)
        at org.intocps.maestro.interpreter.DefaultExternalValueFactory$Fmi2LifecycleHandler.instantiate(DefaultExternalValueFactory.java:342)
        at org.intocps.maestro.interpreter.DefaultExternalValueFactory.create(DefaultExternalValueFactory.java:159)
        at org.intocps.maestro.interpreter.Interpreter.caseALoadExp(Interpreter.java:111)
        at org.intocps.maestro.interpreter.Interpreter.caseALoadExp(Interpreter.java:19)
        at org.intocps.maestro.ast.node.ALoadExp.apply(ALoadExp.java:240)
        ...
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at org.intocps.maestro.Main.main(Main.java:19)
org.intocps.maestro.interpreter.ErrorException: controller IS NULL 
       ...
clagms commented 1 year ago

@gitting-around is there any way to fix these dependency issues once and for all? It's a nuissance that whenever a new ubuntu version comes about, we risk breaking rabbitmqfmu loading behavior.

Can we at least set up integration tests that will catch these problems? They are fairly easy to reproduce: just get a docker with latest ubuntu, and run a cosim with rabbitmq and some script generating messages.

clagms commented 1 year ago

The workaround to this issue is to change the dockerfile above with the following:

FROM ubuntu:22.04

RUN DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y openjdk-11-jdk 

# Fixes https://github.com/INTO-CPS-Association/fmu-rabbitmq/issues/57
RUN echo "deb http://security.ubuntu.com/ubuntu focal-security main" | tee --append /etc/apt/sources.list

RUN apt-get update && apt-get install -y libicu66 libssl1.1 

CMD tail -F anything

Maybe RabbitmqFMU needs to be updated to use the most recent openssl? It seems the intention is to move away from openssl1

clagms commented 1 year ago

I just noticed that this seems to be a duplicate of https://github.com/INTO-CPS-Association/fmu-rabbitmq/issues/56 and https://github.com/INTO-CPS-Association/fmu-rabbitmq/issues/54.

I hope we can find another solution to prevent this from reocurring whenever ubuntu changes.