Commit Graph

1858 Commits

Author SHA1 Message Date
Charlie Crane
155562cb68 #2712 - Commit before merging in changes on dev 2024-07-19 11:18:17 +01:00
Charlie Crane
2104a7ec7d #2712 - Commit before merging in changes on dev 2024-07-19 11:17:54 +01:00
Charlie Crane
51d29c3ab9 Merged PR 464: Terminal Class Session Manager Methods
## Summary
This PR introduces the ability of the Terminal class to  send/receive messages via the session manager, along with the initial logic for processing the responses that it may receive.
Initial implementation of logging in and disconnecting from a remote session, though this will likely see significant refactor when we start using the `UserManager` from #2735

## Test process
Unit tests written.

## 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: #2710
2024-07-17 13:33:12 +00:00
Charlie Crane
fee7f202a6 #2711 - Amending some minor changes spotted whilst raising PR 2024-07-15 10:06:28 +01:00
Charlie Crane
32c2ea0b10 #2710 - Pre-commit run ahead of raising PR 2024-07-15 08:22:18 +01:00
Charlie Crane
2eb36149b2 #2710 - Prep for draft PR 2024-07-15 08:20:11 +01:00
Charlie Crane
dc3558bc4d #2710 - End of Day commit 2024-07-10 17:39:45 +01:00
Charlie Crane
8061102587 #2710 - commit before changing branch 2024-07-09 11:55:16 +01:00
Charlie Crane
42602be953 #2710 - Initial implementation f the receive/send methods. Committing to change branch 2024-07-09 11:54:33 +01:00
Charlie Crane
61c2ee0ee8 Merged PR 450: Terminal Service Class
## Summary
This PR is the base implementation of the Terminal Service Class, containing the skeleton structure for #2711.

## Test process
Future me's problem - see #2714

## 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
- [X] updated the **change log**
- [X] ran **pre-commit** checks for code style
- [ ] attended to any **TO-DOs** left in the code

Related work items: #2711
2024-07-08 09:46:53 +00:00
Charlie Crane
252214b468 #2711 Updating Changelog 2024-07-08 08:25:42 +01:00
Charlie Crane
219d448adc #2711 - Rewrite of the majority of the terminal class after not liking how I originally did it. This takes a heavier inspiration for handling connections from the database_client/server 2024-07-08 07:58:10 +01:00
Czar Echavez
20e5e40d0d Merged PR 446: Add fix duration in config
## Summary
Added a ``fix_duration`` config property in applications and services
Defaults to using 2 if none is specified

## Test process
https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE/pullrequest/446?_a=files&path=/tests/integration_tests/configuration_file_parsing/test_software_fix_duration.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
- [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

Related work items: #2725
2024-07-03 10:21:17 +00:00
Czar Echavez
797afc99ab Merge remote-tracking branch 'origin/dev' into feature/2725-add-software-fix-duration-config 2024-07-03 10:37:02 +01:00
Czar Echavez
55c457a87d #2725: apply PR suggestions 2024-07-03 10:34:44 +01:00
Marek Wolan
bd23ee2083 Merged PR 444: Refactor application install
## Summary
* Remove the ip address parameter from application install
* Make it possible to install any application that exists
* Add new configuration actions for applications
* Add an application registry to match names to application classes

## Test process
* several new tests
* notebooks still running

## 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: #2438, #2705
2024-07-02 15:57:59 +00:00
Czar Echavez
fcd1209156 #2725: documentation 2024-07-02 16:55:28 +01:00
Charlie Crane
ebf6e7a90e #2711 - Added in remote_login and process_login methods. Minor updates to make pydantic happy. Starting to flesh out functionality of Terminal Service in more detail 2024-07-02 16:47:39 +01:00
Czar Echavez
6a72f6af42 #2725: add fix duration to application and service configuration 2024-07-02 15:52:18 +01:00
Marek Wolan
eb1f7555f8 Merged PR 445: #2702 - update data manipulation notebook text
## Summary
*Replace this text with an explanation of what the changes are and how you implemented them. Can this impact any other parts of the codebase that we should keep in mind?*

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

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

#2702 - update data manipulation notebook text

Related work items: #2702
2024-07-02 14:29:05 +00:00
Marek Wolan
cbc414bddf #2702 - update data manipulation notebook text 2024-07-02 15:25:40 +01:00
Charlie Crane
bd05f4d4e8 #2711 - Initial commit of Terminal Service Skeleton framework. Added in a placeholder SSHPacket class. Currently, this allows the Terminal 'service' to be installed onto a HostNode class, and Port 22 - SSH to be visible when using .show(). Functionality and testing still to be completed 2024-07-02 15:02:59 +01:00
Marek Wolan
59b4a162ef Merged PR 442: Add application configuration actions
## Summary
* Add new actions for configuring applications

## Test process
Integration tests.

## 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: #2700
2024-07-02 13:56:34 +00:00
Marek Wolan
feabe5117c #2700 Fix docstrings in application configure methods 2024-07-02 12:48:23 +01:00
Marek Wolan
b27ac52d9e #2700 add E2E tests for application configure actions 2024-07-02 11:10:19 +01:00
Marek Wolan
33b9c5f6b3 Merge branch 'feature/2701-refactor-install-action' into feature/2700-application-configure-actions 2024-07-02 10:41:17 +01:00
Czar Echavez
eee7a68f28 Merged PR 440: #2620: add nbmake and pytest xdist to run the notebooks as part of pieline
![image.png](https://dev.azure.com/ma-dev-uk/b50a61ee-86c4-48bc-9a0b-a67645ba12ee/_apis/git/repositories/2825053e-bd3b-45b2-8680-1281809eefa2/pullRequests/440/attachments/image.png)
![image (2).png](https://dev.azure.com/ma-dev-uk/b50a61ee-86c4-48bc-9a0b-a67645ba12ee/_apis/git/repositories/2825053e-bd3b-45b2-8680-1281809eefa2/pullRequests/440/attachments/image%20%282%29.png)

## Summary
Added nbmake so that the pytest can be used to run the notebooks in primaite as part of the pipeline

## Test process
n/a

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

#2620: add nbmake and pytest xdist to run the notebooks as part of pieline

Related work items: #2620
2024-07-02 08:21:29 +00:00
Czar Echavez
e2429df220 #2620: remove div zero from notebook 2024-07-02 02:52:08 +01:00
Czar Echavez
a5a93fe850 #2620: commit a div zero to check that the pipeline fails 2024-07-02 02:10:40 +01:00
Czar Echavez
12a6aa5e7f #2620: make the windows script work 2024-07-02 01:31:59 +01:00
Czar Echavez
88ab3c3ca1 #2620: remove shell 2024-07-02 00:45:24 +01:00
Czar Echavez
1faacc8d7c #2620: fix indentation 2024-07-02 00:28:59 +01:00
Czar Echavez
918eba2217 #2620: fix indentation 2024-07-02 00:25:30 +01:00
Czar Echavez
8097884ae2 #2620: modify script 2024-07-02 00:00:20 +01:00
Czar Echavez
ab3e84b8b9 #2620: remove irrelevant change 2024-07-01 17:03:14 +01:00
Czar Echavez
afcb844501 #2620: remove cell that fails on purpose 2024-07-01 16:45:28 +01:00
Marek Wolan
dc2c64b2f6 #2701 - Remove ip address option from node application install 2024-07-01 16:23:10 +01:00
Czar Echavez
9c568b0ff3 Merged PR 439: #2641: Added a check for software health state in db service + tests
## Summary
Added a check in the database service process_sql method that checks if the Database Service is in a GOOD state (mainly so that the database service being in a fixed state returns an error)

## Test process
https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE/pullrequest/439?_a=files&path=/tests/integration_tests/system/test_database_on_node.py

https://dev.azure.com/ma-dev-uk/PrimAITE/_git/PrimAITE/pullrequest/439?_a=files&path=/tests/integration_tests/system/test_web_client_server_and_database.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
- [ ] attended to any **TO-DOs** left in the code

#2641: Added a check for software health state in db service + tests

Related work items: #2641
2024-07-01 15:22:22 +00:00
Czar Echavez
a47a14b86e #2620: Going around azure dev ops to fail the script 2024-07-01 15:57:15 +01:00
Marek Wolan
91727f7fde Merged PR 438: #2705 - Move application registry into application module instead of hardcodi...
## Summary
- Add a registry class variable to Application.
- Add an identifier string for all existing applications
- Utilise application registry in game from_config method.

## Test process
New unit test for new features
existing tests pass
notebooks run as before

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

#2705 - Move application registry into application module instead of hardcoding in game module

Related work items: #2705
2024-07-01 14:33:44 +00:00
Marek Wolan
f2db8b0fb5 Merge remote-tracking branch 'origin/feature/2438-application-install-action-refactor' into feature/2700-application-configure-actions 2024-07-01 15:26:19 +01:00
Marek Wolan
bf8ec60833 #2700 Add configure dosbot action 2024-07-01 15:25:20 +01:00
Marek Wolan
ab73ac20e8 #2700 add ransomware configure action 2024-07-01 14:41:41 +01:00
Czar Echavez
4dd50be11a #2620: run notebooks after test so that the results can be published 2024-07-01 14:31:58 +01:00
Charlie Crane
96f62a3229 Merged PR 436: 2656 - Implement Optional Negative Reward
## Summary
This PR implements an "ActionPenalty" Reward class, that can be used for penalising an agent when it carries out an action other than DONOTHING.

The value for this can be configured within the scenario YAML file.

## Test process
I've written unit tests to check that the action penalty is correctly calculated and applied, another to check that the config is read correctly and loads into PrimaiteGymEnv correctly.

## 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: #2656
2024-07-01 13:25:05 +00:00
Marek Wolan
2dd7546f3d 2705 Fix application tests by correctly renaming fixture 2024-07-01 13:25:16 +01:00
Marek Wolan
655bc04a42 #2705 Minor comment and name changes to applications 2024-07-01 13:21:08 +01:00
Czar Echavez
cb61756e43 #2620: attempting to fail pipeline if notebook fails 2024-07-01 12:21:05 +01:00
Czar Echavez
ee4e152f13 #2620: publish result of test and checking if pipeline fails 2024-07-01 12:00:17 +01:00
Marek Wolan
c34cb6d7ce #2700 Add DatabaseConfigure action 2024-07-01 11:31:27 +01:00