patsec / ot-sim

Operational Technology (OT) Simulator
GNU General Public License v3.0
26 stars 7 forks source link

Problem with the example #9

Open hanusek opened 1 month ago

hanusek commented 1 month ago

Hello! I have a problem with starting the example.

code/ot-sim$ docker run -it --rm --name ot-test ot-sim hivemind Procfile.single
broker | Running...
dss    | Running...
cpu    | Running...
cpu    | 2024/07/25 20:35:58 [CPU] starting backplane module
cpu    | panic: creating ZMQ context: zmq4 was compiled with ZeroMQ version 4.3.5, but the runtime links with version 4.3.4
cpu    | 
cpu    | goroutine 1 [running]:
cpu    | github.com/patsec/ot-sim/msgbus.MustNewPusher(...)
cpu    |    github.com/patsec/ot-sim/msgbus/pusher.go:18
cpu    | github.com/patsec/ot-sim/cpu.(*CPU).Run(0xc000000180, {0x9f7308, 0xc0001cc720}, {0xc0000283a8, 0x14}, {0xc000028390, 0x14})
cpu    |    github.com/patsec/ot-sim/cpu/cpu.go:156 +0x9eb
cpu    | github.com/patsec/ot-sim.Start({0x9f7308, 0xc0001cc720})
cpu    |    github.com/patsec/ot-sim/ot-sim.go:89 +0xf0
cpu    | main.main()
cpu    |    ./main.go:31 +0x11e
cpu    | exit status 2
broker | Interrupting...
dss    | Interrupting...
broker | Traceback (most recent call last):
broker |   File "/usr/local/src/ot-sim/testing/e2e/helics/broker.py", line 3, in <module>
broker |     import helics as h
broker |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
broker |   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
broker |   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
broker |   File "<frozen importlib._bootstrap_external>", line 936, in exec_module
broker |   File "<frozen importlib._bootstrap_external>", line 1026, in get_code
broker |   File "<frozen importlib._bootstrap_external>", line 1148, in path_stats
broker |   File "<frozen importlib._bootstrap_external>", line 147, in _path_stat
broker | KeyboardInterrupt
dss    | Traceback (most recent call last):
broker | signal: interrupt
dss    |   File "/usr/local/src/ot-sim/testing/e2e/helics/opendss-federate.py", line 0, in <module>
dss    | KeyboardInterrupt
dss    | signal: interrupt
activeshadow commented 1 month ago

I cannot reproduce this. The issue is the panic in the Golang CPU module due to a mismatch in ZMQ versions. There shouldn't be a mismatch if the modules are built with the Dockerfile, so I'm not sure what's going on here.

Can you elaborate on how you built the Docker image you're using to run the example? The Docker image available from this GitHub repo is missing some of the things necessary to run the example, so the Docker image must be built manually using the test target (which is the default target).