Commit Graph

30 Commits

Author SHA1 Message Date
Chris McCarthy
1dc23e11f2 #1648 - Updated file header from 'Crown Owned Copyright (C) Dstl 2023. DEFCON 703. Shared in confidence.' to '© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK' 2023-07-21 14:54:09 +01:00
Chris McCarthy
aaf1066d29 #1632 - Added full benchmarking script that included plots and a LaTeX report. Ran the v2.0.0rc1 benchmark. Tidied a few other things up. 2023-07-20 08:48:18 +01:00
Chris McCarthy
f4683f3b66 #1631 - Updated the copyright statement to comply with DEFCON 703 Edition 08/13 2023-07-17 19:57:34 +01:00
Christopher McCarthy
3186fcb489 Merged PR 121: #1629 - Added rllib test
## Summary
Quick test that uses RLLIB in a session

## Test process
The learning session completes then we check that the number of rows in both the average reward per episode and all transactions csv files.

## Checklist
- [X] This PR is linked to a **work item**
- [X] I have performed **self-review** of the code
- [X] I have written **tests** for any new functionality added with this PR
- [ ] I have updated the **documentation** if this PR changes or adds functionality
- [X] I have run **pre-commit** checks for code style

#1629 - Added rllib test

Related work items: #1629
2023-07-17 17:28:51 +00:00
Chris McCarthy
ee0c797c3c #1629 - Added assertion in the test that checks the length of the all transactions file too.
- Added supporting function on the TempPrimaiteSession class that reads the all transactions csv file.
- Some renaming of the functions.
2023-07-17 12:14:47 +01:00
Czar Echavez
dce0d10383 #1595: fix poorly merged tests + files 2023-07-14 11:21:59 +01:00
Chris McCarthy
1ddfca6459 #1566 - Refactored the test_train_eval_episode_steps.py to sue TempPrimaiteSession.
- Fixed all errors that were caused b fixing the above.
- Some tests still fail, these are for SS to fix.
- Dropped the old run_generic stuff from conftest.py
2023-07-07 15:50:14 +01:00
Chris McCarthy
8edb26a65c Merge remote-tracking branch 'origin/dev' into 1566-configure-episode-steps-learn-eval
# Conflicts:
#	src/primaite/agents/rllib.py
2023-07-07 14:34:20 +01:00
SunilSamra
79d98e977b 1566 - added test file and edited configs to include types of num steps and modifed agents to use correct step and episode counts 2023-07-07 14:13:47 +01:00
Chris McCarthy
a35c363345 #1386 - Updated tests in test_seeding_and_deterministic_session.py to use TempPrimaiteSession.
- Added test_seeded_learning test and test_deterministic_evaluation test.
- Passed config values seed and deterministic to ppo agent
- Dropped deterministic override in evaluate functions
- TempPrimaiteSession now writes files to a UUID folder rather than datetime
- Added seed to Ray RLlib agent setup in rllib.py
- Added seed to SB3 agent setup in sb3.py
2023-07-06 11:35:44 +01:00
Czar Echavez
0068092d8b #1386: remove unneeded configs + setting the seed globally + temp test 2023-07-05 15:02:41 +01:00
Czar Echavez
c7de7bf21b Merge branch 'dev' into feature/1386-enable-a-repeatable-or-deterministic-baseline-test 2023-07-04 09:41:07 +01:00
Chris McCarthy
e11fd2ced4 #917 - Fixed the RLlib integration
- Dropped support for overriding the num_episodes and num_steps at the agent level. It's just not needed and will add complexity when overriding and writing output files.
2023-06-30 16:52:57 +01:00
Chris McCarthy
7b1f889415 #917 - Integrated the PrimaiteSession into all tests.
- Ran a full pre-commit hook and thus encountered tons of fixes required
2023-06-30 09:08:13 +01:00
Chris McCarthy
4866722911 #917 - Overhauled transaction and mean reward writing.
- Separated out learning outputs from evaluation outputs
2023-06-28 16:34:00 +01:00
Czar Echavez
99399cbda6 #1386: added documentation + dealing with pre-commit checks 2023-06-20 11:19:05 +01:00
Czar Echavez
9fb30ffe1b #1386: added the ability to set deterministic and seeding RNG when training and evaluating + the fix provided in #1535 2023-06-20 10:41:30 +01:00
Chris McCarthy
3670f16766 #917 - Integrated both SB3 and RLlib agents into PrimaiteSession 2023-06-19 20:27:08 +01:00
Chris McCarthy
6c2c95b329 Merge remote-tracking branch 'origin/dev' into feature/915_PRI-31_Packaging_Deployment
# Conflicts:
#	tests/conftest.py
#	tests/test_observation_space.py
#	tests/test_reward.py
2023-06-09 10:35:14 +01:00
Chris McCarthy
5558750f13 #915 - Refactored documentation and included APi docs, dependencies.
- make files now re-build autosummary and deps file.
- Added typer and platformdirs to deps in pyproject.toml.
- Made root_is_pure = True in setup.py as platform/python specific wheels don't need to be built but the option is there should we need to.
-
Added an e2e test for primaite.main.run func.
2023-06-08 15:57:38 +01:00
Chris McCarthy
c03dc8fd6b # 915 - Fixed issue in conftest.py where session_path and timestamp_str were not being passed to Primaite.
- Also now logging all test outputs to temp directory.
2023-06-07 22:57:37 +01:00
Chris McCarthy
98fc1e4c71 #915 - Created app dirs and set as constants in the top-level init.
- renamed _config_values_main to training_config.py and renamed the ConfigValuesMain class to TrainingConfig.
Moved training_config.py to src/primaite/config/training_config.py
- Renamed all training config yaml file keys to make creating an instance of TrainingConfig easier.
Moved action_type and num_steps over to the training config.
- Decoupled the training config and lay down config.
- Refactored main.py so that it can be ran from CLI and can take a training config path and a lay down config path.
- refactored all outputs so that they save to the session dir.
- Added some necessary setup scripts that handle creating app dirs, fronting example config files to the user, fronting demo notebooks to the user, performing clean-up in between installations etc.
- Added functions that attempt to retrieve the file path of users example config files that have been fronted by the primaite setup.
- Added logging config and a getLogger function in the top-level init.
- Refactored all logs entries logged to use a logger using the primaite logging config.
- Added basic typer CLI for doing things like setup, viewing logs, viewing primaite version, running a basic session.
- Updated test to use new features and config structures.
- Began updating docs. More to do here.
2023-06-07 22:40:16 +01:00
SunilSamra
0817a4cad3 893 - added consistent action for test_reward.py 2023-06-06 13:49:22 +01:00
SunilSamra
2e1bdf2361 893 - changed action in conftest.py back to sample of the environment action space 2023-06-06 13:23:08 +01:00
SunilSamra
efd0f6ed08 893 - returned config_values in conftest to move run_generic_set_actions into test_single_action_space.py 2023-06-06 13:21:04 +01:00
SunilSamra
dc7be7d8e6 893 - set the action_space to NOTHING so test_reward.py passes and removed unnecessary test print statements 2023-06-06 11:10:38 +01:00
SunilSamra
1a7d629d5a 893 - added new tests to test action space size and node is completing both sets of actions in a single episode and created new main config 2023-06-06 11:00:41 +01:00
Chris McCarthy
32a4d9e459 #1355 - Carried out full renaming in node.py, active_node.py, passive_node.py, and service_node.py to make params and variable names explicit.
- Made the same renaming in the yaml laydown config files.
- Added Type hints wherever I've been.
- Added a custom NodeType in custom_typing.py to encompass the Union of ActiveNode, PassiveNode, ServiceNode.
2023-05-25 21:03:11 +01:00
Chris McCarthy
fc1b374cb2 #902 - replaced 'final_node_<placeholder>' with 'reference_node_<placeholder>' in methods for scoring of os_state, file_system_state, service state and operating state. This fixed the reward function so it is checked at each step for node operating system state, operating state, file system state and service state.
- Added unit tests.
2023-05-25 14:05:53 +01:00
Chris McCarthy
aa8284897a Package restructuring and renaming for 1.2.0 2023-05-25 10:52:29 +01:00