Commit Graph

821 Commits

Author SHA1 Message Date
Czar.Echavez
be4a467877 #1962: revert pulling from src 2023-11-08 10:48:41 +00:00
Czar.Echavez
f5df1366a7 #1962: merge dev into branch + fix minor diffs + ensure that imports pull from src 2023-11-08 10:36:47 +00:00
Marek Wolan
c060991084 Merged PR 207: Game layer
## Summary
- Remove v2-specific code, documentation, and tests
- Reconnect CLI, to new v3 classes and functions
- Add Game layer
- Minor changes to simulation layer to ensure compatibility with game layer actions and observations

### Game layer
- Add a primaite session, which is the main entry point to running a session. This encompasses agents, the simulation, and a connection with GATE.
- Add an agent interface, random agents, and RL agents.
- Add new observation space management
- Add new action space management
- Add new reward function management

## Test process
Ran primaite session without crash. Majority of integration and unit tests have not been written yet. (sorry)

I know it's not ideal to merge in this not-tested-state, but it doesn't make sense to continue diverging `dev` and `dev-game-layer`.

Instead of reviewing the diff, I would recommend downloading this code and getting familiarised with the new `game` module by reading the code and playing around with it.

Related work items: #1622, #1759, #1760, #1761, #1764, #1765, #1766, #1767, #1768, #1879, #1924, #1986, #1987, #1988, #1989, #1990, #1998
2023-11-07 16:03:43 +00:00
Czar Echavez
729ef2ebac Merged PR 208: #2025: added GATE installation as part of pipeline
## Summary
Installing GATE before running the primaite setup command so that the pipeline passes

## Test process
*How have you tested this (if applicable)?*

## Checklist
- [X] PR is linked to a **work item**
- [X] **acceptance criteria** of linked ticket are met
- [X] performed **self-review** of the code
- [ ] 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

#2025: added GATE installation as part of pipeline

Related work items: #2025
2023-11-07 15:03:00 +00:00
Czar.Echavez
d4679bb0e3 #2025: Missing character for GATE path 2023-11-07 14:09:22 +00:00
Czar.Echavez
e0d694a736 #2025: added GATE installation as part of pipeline 2023-11-07 14:00:08 +00:00
Marek Wolan
0ea282166d Merge remote-tracking branch 'origin/dev' into dev-game-layer 2023-11-06 16:23:29 +00:00
Czar.Echavez
eba10ae5ef #1962: clean up tests + improve the show command which shows the folders and files in file system 2023-11-06 11:56:44 +00:00
Czar.Echavez
535c1b19ab #1962: attempt to make the timestep actions look neater + adding logic that allows restoring a folder take multiple timesteps 2023-11-06 11:12:06 +00:00
Czar.Echavez
e70ceec716 #1962: folder/file restore logic 2023-11-06 10:22:08 +00:00
Czar.Echavez
51713bad74 #1962: split tests into managable files + implement deletion of folders and files + tests 2023-11-03 15:15:18 +00:00
Czar.Echavez
b2c3e273b7 #1962: separating file system into more managable files 2023-11-02 15:10:51 +00:00
Czar.Echavez
b67eb1bb34 #1962: separating file system into more managable files 2023-11-02 13:14:08 +00:00
Czar.Echavez
11848aa180 #1962: keeping track of deleted files 2023-10-31 15:52:44 +00:00
Czar Echavez
870707f86b Merged PR 200: Implement node scan and reset
## Summary
Implementing the ability for the simulation to scan all node components as well as the ability for the red agent to reveal the node and its components.

Implementing the ability for the simulation to reset a node

## Test process
Unit tests added

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

Related work items: #1961
2023-10-30 16:47:28 +00:00
Czar.Echavez
98ca33e994 #1961: scanning no longer happens every timestep - the scan is all done in one timestep after the required timestep countdown is complete 2023-10-30 15:34:13 +00:00
Czar.Echavez
1ddf400d6f #1961: node resetting 2023-10-27 18:28:34 +01:00
Czar.Echavez
68b22b6444 #1961: node scanning + applying timestep to all components within node + node revealing to red 2023-10-27 17:50:41 +01:00
Marek Wolan
2923921559 Merged PR 199: Fix setup and session commands
## Summary
Make PrimAITE work with the new:
- configs
- CLI commands

## Test process
I ran primaite setup and primaite session to check that they work

## Checklist
- [x] PR is linked to a **work item**
- [x] **acceptance criteria** of linked ticket are met
- [x] performed **self-review** of the code
- [ ] 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
- [ ] attended to any **TO-DOs** left in the code

Related work items: #1987, #1998
2023-10-27 15:14:06 +00:00
Marek Wolan
a37ce051c5 Add ARCD GATE setup to primaite setup 2023-10-27 14:50:31 +01:00
Marek Wolan
75d1fd20c3 Remove temporary files 2023-10-27 14:41:53 +01:00
Marek Wolan
b81c1739f8 Fix CLI and Session to work with new classes 2023-10-27 14:26:52 +01:00
Marek Wolan
6378ff3087 Merged PR 198: Updates to documentation
* STILL IN PROGRESS *

## Summary
Delete old documentation, write some more up-to-date documentation.

## Test process

## Checklist
- [ ] PR is linked to a **work item**
- [ ] **acceptance criteria** of linked ticket are met
- [ ] performed **self-review** of the code
- [ ] 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**
- [ ] ran **pre-commit** checks for code style
- [ ] attended to any **TO-DOs** left in the code

Updates to documentation

Related work items: #1988, #1990
2023-10-27 11:33:09 +00:00
Marek Wolan
1ec1b319e5 Fix formatting in docs 2023-10-27 12:24:22 +01:00
Marek Wolan
d4eb499729 Start fixing up cli and setup 2023-10-27 12:20:23 +01:00
Marek Wolan
a06629ed0b Bump version 2023-10-27 11:48:54 +01:00
Marek Wolan
6ac7dcf9ac Update README.md 2023-10-27 11:48:22 +01:00
Marek Wolan
318c9f8c5a Fix formatting issues 2023-10-27 11:43:11 +01:00
Czar.Echavez
8783574442 #1961: os scan set up 2023-10-27 10:17:59 +01:00
Marek Wolan
11fad5084e Merged PR 197: Remove deprecated functionality
## Summary
* Delete many files which are not used with the new V3 approach. Including all the previous simulation files, as well as the old config, old session, etc.
* Delete tests for the removed functionality
* Note: this PR can only be merged after !195

## Test process
This PR Changes our Unit Test suite to only keep tests related to V3 code. All tests pass as of my recent attempt.

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

Related work items: #1989, #1986
2023-10-26 14:33:31 +00:00
Marek Wolan
4f387cf092 Merged PR 195: Initial game layer functionality
## Summary
* add a new module `game` to PrimAITE
* this includes a new PrimaiteSession which creates a simulation, and multiple agents, and talks to GATE
* agent interface
* agent actions to work with Simulator requests
* agent observations that work with Simulator State
* agent rewards also with Simulator state

**note** that this branch is currently still in a broken state. Still need to do things like updating readme, install instructions, refactoring some poorly designed classes, and removing legacy code. These will be done in subsequent PRs to avoid making this PR even bigger than it needs to be. Still, please review this to familiarise yourself.

## Test process
Some unit tests exist but their coverage will be expanded.
I performed some test runs with to train a SB3 agent in GATE with a primaite simulation.

## Checklist
- [y] PR is linked to a **work item**
- [y] **acceptance criteria** of linked ticket are met
- [~] performed **self-review** of the code
- [n] 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**
- [y] ran **pre-commit** checks for code style
- [n] attended to any **TO-DOs** left in the code

Related work items: #1622, #1759, #1760, #1761, #1764, #1765, #1766, #1767, #1768, #1879, #1924
2023-10-26 12:49:11 +00:00
Marek Wolan
afa7916db0 Updates to documentation 2023-10-25 23:32:52 +01:00
Marek Wolan
450aa150ae Merge remote-tracking branch 'origin/dev-game-layer' into feature/1989-remove-v2-modules 2023-10-25 19:19:34 +01:00
Marek Wolan
02901a7c99 Apply suggestions from code review. 2023-10-25 19:07:45 +01:00
Marek Wolan
38b71c0c8e Update CHANGELOG 2023-10-25 18:06:33 +01:00
Marek Wolan
78a8d2be3e Fix File observation test 2023-10-25 17:57:19 +01:00
Marek Wolan
59e2c23c04 Merge remote-tracking branch 'origin/feature/1924-Agent-Interface' into feature/1989-remove-v2-modules 2023-10-25 17:56:21 +01:00
Marek Wolan
4872c939ff Apply suggestions from code review 2023-10-25 17:19:24 +01:00
Marek Wolan
c57b5152c0 Remove broken tests 2023-10-25 17:08:01 +01:00
Marek Wolan
1e811148ed Fix dependency versions to align with GATE 2023-10-25 17:04:30 +01:00
Marek Wolan
2b8462d38d Fix link import in v3 code 2023-10-25 17:04:04 +01:00
Marek Wolan
e8e14ae68a Comment out tests for primaite v2 2023-10-25 13:56:02 +01:00
Marek Wolan
f861b1897a Remove deprecated code from v2 2023-10-25 13:36:55 +01:00
Marek Wolan
ffe80f215e Merge 'origin/dev-game-layer' into feature/1924-Agent-Interface 2023-10-25 09:58:04 +01:00
Czar Echavez
091920c6f7 Merged PR 192: Implement missing actions
## Summary

#1947
Implementation of actions from the QTSL-820-2450 - ARCD Track 2 Common Interface Definition for Environments UC2 document

Covers:
- [X] BAS-12 NODE  SERVICE SCAN
- [X] BAS-15 NODE  SERVICE STOP
- [X] BAS-16 NODE  SERVICE START
- [X] BAS-17 NODE  SERVICE PAUSE
- [X] BAS-18 NODE  SERVICE RESUME
- [X] BAS-19 NODE  SERVICE RESTART
- [X] BAS-20 NODE  SERVICE DISABLE
- [X] BAS-21 NODE  SERVICE ENABLE

- [X] BAS-29 NODE  FILE SCAN
- [X] BAS-30 NODE  FILE CHECKHASH
- [X] BAS-33 NODE  FILE DELETE
- [X] BAS-34 NODE  FILE REPAIR

- [X] BAS-38 NODE  FOLDER SCAN
- [X] BAS-39 NODE  FOLDER CHECKHASH
- [X] BAS-41 NODE  FOLDER REPAIR

- [X] BAS-44 NODE SHUTDOWN
- [X] BAS-45 NODE STARTUP

- [X] RAS-30 NODE FILE DELETE
- [X] RAS-31 NODE FILE CORRUPT
- [X] RAS-36 NODE FOLDER DELETE
- [X] RAS-37 NODE FOLDER CORRUPT

## Test process

### node actions test
https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE/pullrequest/192?_a=files&path=/tests/unit_tests/_primaite/_simulator/_network/_hardware/test_node_actions.py

### service actions
https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE/pullrequest/192?_a=files&path=/tests/unit_tests/_primaite/_simulator/_system/_services/test_service_actions.py

### file/folder actions
https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE/pullrequest/192?_a=files&path=/tests/unit_tests/_primaite/_simulator/_file_system/test_file_system_actions.py

## 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

Related work items: #1947
2023-10-25 08:35:59 +00:00
Marek Wolan
c9b06e1bfb Delete sandbox file 2023-10-24 17:06:58 +01:00
Marek Wolan
cb60b6f785 Update text in docs 2023-10-24 17:02:29 +01:00
Marek Wolan
d49d5b292d Add a bit of documentation 2023-10-24 15:51:29 +01:00
Czar.Echavez
ac23633d82 #1947: Added documentation on how the node initialisation works 2023-10-24 15:41:39 +01:00
Czar.Echavez
c4b43c479e #1947: remove storing deleted files in a list and banish them to the shadow realm instead 2023-10-24 11:53:21 +01:00