Commit Graph

880 Commits

Author SHA1 Message Date
Czar Echavez
cd49f1eb85 #2064: Apply PR suggestions 2023-11-25 13:19:32 +00:00
Czar Echavez
330e87698e Merge remote-tracking branch 'origin/dev' into bugfix/2064-software-continues-running-after-node-is-turned-off 2023-11-24 15:16:25 +00:00
Czar Echavez
b7b718f25d #2064: added a method that checks if the class can perform actions and added it where necessary + tests everywhere 2023-11-24 15:15:56 +00:00
Marek Wolan
5a03db9ff3 Merged PR 219: Skip slow tests for now.
Related work items: #1971
2023-11-24 14:58:00 +00:00
Marek Wolan
82116e6c92 Merged PR 218: Get Ray agents working
## Summary
- PrimaiteSession class was separated into 'game' and 'session' classes. Game manages the interfacing of agents and the simulator. Session manages the environment, IO, and RL algorithms, as well as the game.
- Add ray single and multi agent support
- Add environments that can be interacted with directly so that users who want to manually configure RL policies can do so.
- Add notebooks demonstrating manual environment interfacing.

## Test process
Unit tests added, all pass. Example notebooks run to demonstrate compatibility with SB3 and Ray.

## 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
- [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
- [ ] attended to any **TO-DOs** left in the code

![PrimAITE High Level Design - Page 1 (4).png](https://dev.azure.com/ma-dev-uk/b50a61ee-86c4-48bc-9a0b-a67645ba12ee/_apis/git/repositories/2825053e-bd3b-45b2-8680-1281809eefa2/pullRequests/218/attachments/PrimAITE%20High%20Level%20Design%20-%20Page%201%20%284%29.png)

Related work items: #1970, #1971
2023-11-24 13:57:54 +00:00
Marek Wolan
64c7dd3c84 Skip slow tests for now. 2023-11-24 12:03:46 +00:00
Marek Wolan
d8975078b3 Fix game reset test. 2023-11-24 10:50:10 +00:00
Marek Wolan
bfd5f054dc Merge 'origin/dev' into feature/1971-ray-agents-2 2023-11-24 09:50:37 +00:00
Marek Wolan
abba1ef86b Remove hardcoded checkpoint frequency in rllib 2023-11-24 09:37:26 +00:00
Marek Wolan
6754dbf541 Remove GATE and fix a few spelling mistakes. 2023-11-24 09:28:50 +00:00
Marek Wolan
50c9ef16cb Move policy module into session 2023-11-24 09:18:18 +00:00
Marek Wolan
bd109a7cfc Complete session->game rename refactor 2023-11-24 09:14: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
Czar Echavez
8aa743188f #2064: fix layout of test so it passes in pipeline 2023-11-23 22:28:08 +00:00
Czar Echavez
2ce03e0262 #2064: turn on everything when node is turned on 2023-11-23 22:10:53 +00:00
Czar Echavez
f0fc6518a0 #2064: add handling of offline service to dns, ftp and database 2023-11-23 21:48:11 +00:00
Chris McCarthy
dfe07ad926 #2034 - Fixed deepcopy reference issue 2023-11-23 21:25:52 +00:00
Czar Echavez
bd6c27244c #2064: Edited services and applications to handle when they are shut down 2023-11-23 19:49:03 +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
Marek Wolan
dd63563ba1 Update doc page on primaite session. 2023-11-23 03:07:39 +00:00
Marek Wolan
f1f516c51a Add multi agent session test 2023-11-23 02:51:31 +00:00
Marek Wolan
8a2279c6cb Update end to end tests after session changes 2023-11-23 01:40:27 +00:00
Marek Wolan
14ae8be5e2 Update session after it was split from game 2023-11-23 00:54:19 +00:00
Marek Wolan
1fd5298fc5 Fix multi agent system 2023-11-22 20:22:34 +00:00
Marek Wolan
9070fb44d4 Check that ray single agent training works 2023-11-22 13:26:29 +00:00
Marek Wolan
b81dd26b71 Add Ray env class 2023-11-22 13:12:08 +00:00
Marek Wolan
1138644a4b Update to make things work with new layout 2023-11-22 12:59:33 +00:00
Marek Wolan
afd64e4674 Separate game, environment, and session 2023-11-22 11:59:25 +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
Marek Wolan
66d5612e92 Merge remote-tracking branch 'origin/feature/1972-remove-sqlite' into feature/1971-ray-agents-2 2023-11-18 04:54:17 +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
Marek Wolan
5d9d8fe92c merge PR updates from parent branch 2023-11-17 17:59:45 +00:00
Marek Wolan
3fb7bce3ce Get RLLib to stop crashing. 2023-11-17 17:57:57 +00:00
Marek Wolan
c5b4ae45be Remove problematic progress bars 2023-11-17 11:40:36 +00:00
Marek Wolan
6e5e1e6456 Begin rllib 2023-11-17 11:38:29 +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
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