Skip to content

Commit 6281c74

Browse files
authored
Merge pull request #376 from capocchi/version-5.1
Version 5.1
2 parents 69d62c1 + 1e262b4 commit 6281c74

File tree

9 files changed

+1086
-275
lines changed

9 files changed

+1086
-275
lines changed

devsimpy/Container.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
from Decorators import BuzyCursorNotification, Post_Undo
100100
from Utilities import HEXToRGB, relpath, playSound, sendEvent, load_and_resize_image, getInstance, FixedList, getObjectFromString, getTopLevelWindow, printOnStatusBar
101101
from Patterns import Subject, Observer
102+
from StandaloneGUIKafkaPKG import StandaloneGUIKafkaPKG
102103

103104
if getattr(builtins, 'GUI_FLAG', True):
104105
from DetachedFrame import DetachedFrame
@@ -4023,6 +4024,13 @@ def OnExport(self, event):
40234024
wx.OK | wx.ICON_ERROR)
40244025
dlg.ShowModal()
40254026

4027+
def OnExportKafkaPkg(self, evt):
4028+
""" Create the standalone package that contains the kafka-based worker for the atomic model
4029+
"""
4030+
4031+
frame = StandaloneGUIKafkaPKG(None, -1, _('Standalone Settings'), block_model=self)
4032+
frame.Show(True)
4033+
40264034
def update(self, concret_subject = None):
40274035
""" Update method to respond to notify call.
40284036
"""

devsimpy/DEVSKernel/KAFKADEVS/auto_kafka.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,17 @@ def ensure_kafka_broker(
7373
# Conteneur existant mais arrêté : on le démarre
7474
subprocess.run(["docker", "start", container_name], check=True)
7575
else:
76+
77+
kafka_port = bootstrap.split(':')[-1] or "9092"
78+
7679
# 3) Sinon, on le crée avec docker run
7780
cmd = [
7881
"docker", "run", "-d",
7982
"--name", container_name,
80-
"-p", "9092:9092",
83+
"-p", f"{kafka_port}:{kafka_port}",
8184
"-e", "KAFKA_NODE_ID=1",
8285
"-e", "KAFKA_PROCESS_ROLES=broker,controller",
83-
"-e", "KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093",
86+
"-e", f"KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:{kafka_port},CONTROLLER://0.0.0.0:9093",
8487
"-e", f"KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://{KAFKA_BOOTSTRAP}",
8588
"-e", "KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER",
8689
"-e", "KAFKA_CONTROLLER_QUORUM_VOTERS=1@localhost:9093",

devsimpy/DEVSKernel/Strategies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ def simulate(self, T = 1e8):
509509
ts = self.ts.Get()
510510

511511
### The SIM_VERBOSE event occurs
512-
PluginManager.trigger_event("SIM_VERBOSE", self.master, None, clock = )
512+
PluginManager.trigger_event("SIM_VERBOSE", self.master, None, clock = ts)
513513

514514
### tree-like data structure ordered by devsimpy priority
515515
priority_scheduler = [a for a in formated_priority_list if ts == a[1].myTimeAdvance]

0 commit comments

Comments
 (0)