Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion AIDojoCoordinator/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ["--debug_level=INFO"]
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down