dstl / YAWNING-TITAN

YAWNING TITAN is an abstract, graph based cyber-security simulation environment that supports the training of intelligent agents for autonomous cyber operations.
MIT License
58 stars 17 forks source link

Signature of NetworkInterface causing issues in a few files #30

Closed forrestmckee closed 1 year ago

forrestmckee commented 1 year ago

Describe the bug The __init__ method in NetworkInterface changed and no longer allows for settings_path. This causes rl_baseline.py to fail.

To Reproduce Steps to reproduce the behaviour:

  1. run rl_baseline.py
  2. TypeError

Expected behaviour I expect the file to run to completion.

Environment (please complete the following information):

Additional context This seems like more of a simple oversight than a bug. It looks like there's a new way to do the same thing.

jamesshort1 commented 1 year ago

Thank you for raising this issue @forrestmckee. We have one of the team looking into it.

ChrisMcCarthyDev commented 1 year ago

Hi @forrestmckee, thank you for raising this issue!

Firstly let me apologise for this issue, this definitely was an oversight on our part when implementing the updated configs and NetworkInterface instantiation throughout the codebase.

So I have actually identified a number of issues here:

  1. You're right, the NetworkInterface constructor has changed and now takes an instance of GameModeConfig and NetworkConfig. There are three locations in Yawning-Titan that have not had the instantiation of NetworkInterface updated:
    • yawning_titan.integrations.dcbo.rl_baseline
    • yawning_titan.integrations.dcbo.utils
    • utils.custom_config_runner
      1. Yawning-Titan, when installed outside of the cloned repo, has no access to yawning_titan/integrations/dcbo/base_net.txt.
      2. Yawning-Titan, when installed outside of the cloned repo, has no access to yawning_titan/integrations/dcbo/dcbo_config.yaml.
      3. Newly added fields to in the game mode config have not been added to yawning_titan/integrations/dcbo/dcbo_config.yaml.

I'm currently working on a bugfix that will:

  1. Refactor all modules that instantiate the NetworkInterface so that they recieve a GameModeConfig and NetworkConfig.
  2. Convert yawning_titan/integrations/dcbo/base_net.txt to a network function in yawning_titan.envs.generic.helpers.network_creator so the file can be dropped.
  3. Include dcbo_config.yaml as package data and store alongside the default game mode config. Add a reference to its path and update all usages to use this new location.
  4. Add the missing fields to dcbo_config.yaml.

I'm hoping to get a release (v1.0.1) out for this before the end of the week.

@ChrisMcCarthyDev (Yawning-Titan dev team)

ChrisMcCarthyDev commented 1 year ago

Closing as fixed in release v1.0.1.