From 5abb5ecc8ef6801c30257dd548980ea0cba25e4f Mon Sep 17 00:00:00 2001 From: Ondrej Lukas Date: Tue, 6 Jan 2026 15:29:26 +0100 Subject: [PATCH 1/4] Refactor Dockerfile to set ENTRYPOINT and CMD for better argument handling --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5efa9618..4aeaed4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,8 @@ RUN if [ -f pyproject.toml ]; then pip install . ; fi # Expose the port the coordinator will run on EXPOSE 9000 -# Run the Python script when the container launches -CMD ["python3", "-m", "AIDojoCoordinator.worlds.NSEGameCoordinator", "--task_config=netsecenv_conf.yaml", "--game_port=9000", "--game_host=0.0.0.0"] +# Run the Python script when the container launches (with default arguments --task_config=netsecenv_conf.yaml --game_port=9000 --game_host=0.0.0.0) +ENTRYPOINT ["python3", "-m", "AIDojoCoordinator.worlds.NSEGameCoordinator", "--task_config=netsecenv_conf.yaml", "--game_port=9000", "--game_host=0.0.0.0"] +# Default command arguments (can be overridden at runtime) +CMD ["--log_level=INFO"] From 75b0266514ed268b3e26b096e2cd2a3d3fcb25d0 Mon Sep 17 00:00:00 2001 From: Ondrej Lukas Date: Tue, 6 Jan 2026 16:33:49 +0100 Subject: [PATCH 2/4] Update default command argument to set debug level to INFO --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4aeaed4a..3be8548a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,4 +29,4 @@ EXPOSE 9000 ENTRYPOINT ["python3", "-m", "AIDojoCoordinator.worlds.NSEGameCoordinator", "--task_config=netsecenv_conf.yaml", "--game_port=9000", "--game_host=0.0.0.0"] # Default command arguments (can be overridden at runtime) -CMD ["--log_level=INFO"] +CMD ["--debug_level=INFO"] From e65d9070f32c738b64a61e034d42559c9c2a0b4d Mon Sep 17 00:00:00 2001 From: Ondrej Lukas Date: Tue, 6 Jan 2026 16:57:57 +0100 Subject: [PATCH 3/4] Update trajectory storage location and ensure directory creation --- AIDojoCoordinator/coordinator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AIDojoCoordinator/coordinator.py b/AIDojoCoordinator/coordinator.py index a2986c2a..dd14ad29 100644 --- a/AIDojoCoordinator/coordinator.py +++ b/AIDojoCoordinator/coordinator.py @@ -957,7 +957,10 @@ def _add_step_to_trajectory(self, agent_addr:tuple, action:Action, reward:float, if end_reason: self._agent_trajectories[agent_addr]["end_reason"] = end_reason - def _store_trajectory_to_file(self, agent_addr:tuple, location="./trajectories")-> None: + def _store_trajectory_to_file(self, agent_addr:tuple, location="./logs/trajectories")-> None: + if not os.path.exists(location): + os.makedirs(location) + self.logger.debug(f"Created directory for storing trajectories: {location}") self.logger.debug(f"Storing Trajectory of {agent_addr}in file") if agent_addr in self._agent_trajectories: agent_name, agent_role = self.agents[agent_addr] From 8a877e6431a5dd546dc8b94600e8c42d7df015f0 Mon Sep 17 00:00:00 2001 From: Ondrej Lukas Date: Tue, 6 Jan 2026 17:12:02 +0100 Subject: [PATCH 4/4] Add support for custom logging levels in Docker run command --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 756f2936..00cefef9 100755 --- a/README.md +++ b/README.md @@ -113,14 +113,25 @@ python3 -m AIDojoCoordinator.worlds.NSEGameCoordinator \ --game_port=9000 ``` Upon which the game server is created on `localhost:9000` to which the agents can connect to interact in the NetSecGame. + ### Docker Container When running in the Docker container, the NetSecGame can be started with: ```bash docker run -it --rm \ -v $(pwd)/examples/example_task_configuration.yaml:/aidojo/netsecenv_conf.yaml \ -v $(pwd)/logs:/aidojo/logs \ - -p 9000:9000 lukasond/aidojo-coordinator:1.0.2 + -p 9000:9000 stratosphereips/netsecgame:lastest +``` +optionally, you can set the logging level with `--debug_level=["DEBUG", "INFO", "WARNING", "CRITICAL"]` (defaul=`"INFO"`): + +```bash +docker run -it --rm \ + -v $(pwd)/examples/example_task_configuration.yaml:/aidojo/netsecenv_conf.yaml \ + -v $(pwd)/logs:/aidojo/logs \ + -p 9000:9000 aidojo-local-test:latest \ + --debug_level="WARNING" ``` + ## Documentation You can find user documentation at [https://stratosphereips.github.io/NetSecGame/](https://stratosphereips.github.io/NetSecGame/) ## Components of the NetSecGame Environment