Commit Graph

873 Commits

Author SHA1 Message Date
Jake Walker
08c1b3cfb9 Fix code style issues 2023-11-24 15:56:04 +00:00
Jake Walker
e62ca22cb7 Fix data manipulation bot tests 2023-11-24 15:53:07 +00:00
Jake Walker
c5cfbb825a Fix database client connect method 2023-11-24 15:15:45 +00:00
Jake Walker
e6f75f8b32 Improve data manipulation bot documentation 2023-11-24 15:15:24 +00:00
Marek Wolan
e609f8eb50 Fix misconfiguration in uc2 config and session 2023-11-24 14:56:17 +00:00
Chris McCarthy
dfb08b8cf3 #1859 - DB query now returns false if the query isn't ran due to the node being off 2023-11-24 11:52:33 +00:00
Jake Walker
ff8b773c10 Database Manipulation Bot bug fixes 2023-11-24 11:10:34 +00:00
Jake Walker
4e104a4d99 Update data manipulation bot 2023-11-24 10:33:19 +00:00
Jake Walker
178d911be0 Update data manipulation bot 2023-11-24 10:05:36 +00:00
Jake Walker
92dabe59f7 Fix data manipulation bot configuration 2023-11-24 10:04:19 +00:00
Jake Walker
b13a9d3daf Add application execution action for data manipulation bot 2023-11-24 09:25:55 +00:00
Christopher McCarthy
0caeb60e01 Merged PR 216: #2034 - Implemented the Simulation reset functionality
## Summary
Implemented the Simulation reset functionality by doing a deepcopy of the Simulation object inside the PrimaiteSession upon instantiation and assigning it to a `_simulation_initial_state` variable. Then when reset called, the sessions `simulation` variable is assigned the value of the `_simulation_initial_state` variable.

## Test process
Added a test that uninstalls a service before performing a reset then checks that the service reappears.

## Checklist
- [X] PR is linked to a **work item**
- [X] **acceptance criteria** of linked ticket are met
- [X] performed **self-review** of the code
- [X] written **tests** for any new functionality added with this PR
- [ ] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [ ] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [X] attended to any **TO-DOs** left in the code

#2034 - Implemented the Simulation reset functionality by doing a deepcopy of the Simulation object inside the PrimaiteSession upon instantiation. Added a test that uninstalls a service before performing a reset then checks that the service reappears.

Related work items: #2034
2023-11-23 22:33:12 +00:00
Chris McCarthy
dfe07ad926 #2034 - Fixed deepcopy reference issue 2023-11-23 21:25:52 +00:00
Jake Walker
5f1a5af1b4 Add data manipulation bot action manager 2023-11-23 16:06:19 +00:00
Jake Walker
c93705867f Move configuration from agent to data manipulation bot 2023-11-23 15:53:47 +00:00
Christopher McCarthy
76939fb8e8 Apply suggestions from code review 2023-11-23 15:45:22 +00:00
Chris McCarthy
efeaa4c1cc #2034 - Implemented the Simulation reset functionality by doing a deepcopy of the Simulation object inside the PrimaiteSession upon instantiation. Added a test that uninstalls a service before performing a reset then checks that the service reappears. 2023-11-23 15:31:06 +00:00
Marek Wolan
4ee29efd1f Merged PR 213: Replace SQLite database implementation with a simulation
## Summary
Remove SQLLite and real sql queries and replace them with `SELECT` and `DELETE` queries that interact with the node's file system and service operating status.

## Test process
Existing unit tests pass after logic was changed.

## Checklist
- [x] PR is linked to a **work item**
- [ ] **acceptance criteria** of linked ticket are met
- [x] performed **self-review** of the code
- [x] written **tests** for any new functionality added with this PR
- [x] updated the **documentation** if this PR changes or adds functionality
- [ ] written/updated **design docs** if this PR implements new functionality
- [ ] updated the **change log**
- [x] ran **pre-commit** checks for code style
- [x] attended to any **TO-DOs** left in the code

Related work items: #1971
2023-11-23 10:18:06 +00:00
Jake Walker
061e508187 Add repeat option to data manipulation bot 2023-11-22 16:24:17 +00:00
Jake Walker
aa65c53a95 Pass probability of success through to functions 2023-11-21 15:09:51 +00:00
Jake Walker
48af022963 Run agent at configured timesteps 2023-11-21 13:41:38 +00:00
Jake Walker
d8154bbebd Add tests for data manipulation bot attack stages 2023-11-21 11:43:47 +00:00
Jake Walker
2975aa8827 Execute data manipulation bots from agent 2023-11-21 11:42:01 +00:00
Marek Wolan
e9d2437db8 Merged PR 212: GATE-less agents
## Summary
Remove gate and integrate SB3 agent natively.
This includes:
- agent saving
- checkpoints
- session output directory
- simulation output (such as syslogs) are now in the session output directory
- agent loading
- training progress bar (with `enlighten`)

## Test process
End to end tests that verify that a session is being created correctly with a network
They also check the outputs exist.

## Checklist
- [y] PR is linked to a **work item**
- [upcoming PR] **acceptance criteria** of linked ticket are met
- [y] performed **self-review** of the code
- [loading not tested but need to move onto Ray now] written **tests** for any new functionality added with this PR
- [n] updated the **documentation** if this PR changes or adds functionality
- [n] written/updated **design docs** if this PR implements new functionality
- [n] updated the **change log**
- [y] ran **pre-commit** checks for code style
- [n] attended to any **TO-DOs** left in the code

Related work items: #1971
2023-11-21 09:33:29 +00:00
Jake Walker
7e0e8a4768 Pass agent settings from config to agent 2023-11-20 10:38:01 +00:00
Marek Wolan
fdb48c0ded Update docs for Database 2023-11-18 03:46:24 +00:00
Marek Wolan
7d800cbbc9 Merge remote-tracking branch 'origin/dev' into feature/1972-remove-sqlite 2023-11-18 03:41:22 +00:00
Marek Wolan
77f3806ba7 Remove real database in favour of simulated 2023-11-18 03:40:08 +00:00
Marek Wolan
9d0a98b221 Apply suggestions from code review 2023-11-17 20:30:07 +00:00
Jake Walker
227e73602f Pass execution definition from config to agent 2023-11-17 11:51:19 +00:00
Marek Wolan
c5b4ae45be Remove problematic progress bars 2023-11-17 11:40:36 +00:00
Marek Wolan
5bda952ead Fix sim output 2023-11-17 10:20:26 +00:00
Marek Wolan
ba580b00b4 Improve config validation and fix tests 2023-11-16 16:14:50 +00:00
Marek Wolan
0861663cc1 Add agent loading 2023-11-16 15:40:49 +00:00
Marek Wolan
e52d1fbd45 Add enlighten dependency 2023-11-16 15:29:48 +00:00
Marek Wolan
0b9bdedebd Fix typehints 2023-11-16 15:28:38 +00:00
Marek Wolan
13c49bf3ea Fix session path monkeypatch 2023-11-16 15:19:14 +00:00
Marek Wolan
7545c25a46 Make pytest patch with temporary session dir 2023-11-16 15:11:03 +00:00
Marek Wolan
829500a60f Get sb3 checkpoints saving during training 2023-11-16 14:37:37 +00:00
Jake Walker
1c5ff66d26 Pass execution definition from config to agent 2023-11-16 13:26:30 +00:00
Marek Wolan
4cc7ba1522 Add ability to save sb3 final model 2023-11-15 16:59:56 +00:00
Marek Wolan
64e8b3bcea Add basic primaite session e2e tests 2023-11-15 16:04:16 +00:00
Marek Wolan
6182b53bfd Fix incorrect number of steps per episode 2023-11-15 14:49:44 +00:00
Marek Wolan
c8f2f193bd Implement agent training with sb3 2023-11-15 12:52:18 +00:00
Marek Wolan
e6ead6e532 Update agent interface to work better with envs 2023-11-14 15:10:07 +00:00
Marek Wolan
1cb54da2dd Remove more GATE stuff 2023-11-13 17:12:50 +00:00
Marek Wolan
08e88e52b0 Begin implementing training loop in session 2023-11-13 16:35:35 +00:00
Marek Wolan
707f2b59af Add SB3 RL agent 2023-11-13 16:08:39 +00:00
Marek Wolan
21c06dbea1 Remove GATE-related code. 2023-11-13 16:04:25 +00:00
Chris McCarthy
23fd9c3839 #1859 - Started giving the red agent some 'intelligence' and a sense of a state. Changed Application.run to .execute. 2023-11-13 15:55:14 +00:00