Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HybridLabs (MSP-3820 + MSP-5394 + MSP-5384 + MSP-5391) #292

Open
wants to merge 242 commits into
base: dev
Choose a base branch
from

Conversation

marinhekman
Copy link
Contributor

@marinhekman marinhekman commented Dec 12, 2024

MSP-5384: extend server to support external simulations
MSP-3820 Port ServerManager into Symfony
MSP-5394 HybridLabs: swagger api documentation
MSP-5391 HybridLabs: simulations into own docker container

…menting with onFlush to handle simpler and quicker changes, notably of game state
@marinhekman marinhekman changed the title MSP-5384 MSP-3820 HybridLabs: extend server to support external simulations + MSP-3820 Port ServerManager into Symfony (MSP-3820 + MSP-5394 + MSP-5384) MSP-5384 HybridLabs: extend server to support external simulations + MSP-3820 Port ServerManager into Symfony + MSP-5394 HybridLabs: swagger api documentation Jan 23, 2025
marinhekman and others added 3 commits January 23, 2025 12:38
* wip

* fixed phpstan issues

* wip pt.2

* fix code style issues

* fixed phpstan issues

* changed description

* * added note why dev needs another server url
* renamed MSPControllerBase to LegacyControllerBase, since it is used to set the forwarding closure for the SymfonyToLegacyHelper
* fixed forwarding to Layer/List
* removed todo from index.php
* added tags list to nelmio api doc
  config to control the order (moved User / Authorization
  to the top)
* build_timestamp field is not nullable for the User/RequestSession request
* Added examples to /User/RequestSession response

* * fixed Layer::Export query I think. It checks for substractive = 0 but the column can also be NULL , which should be interpreted as 0
* removed usage of links in the api doc
* added description to the response
  structure schema
* added response LayerMetaResponse global variable used by 2 layer api methods
* added a lot of examples to the api doc
  requests, responses, and properties
* changed wrapPayloadForResponse with an additional parameter "Success" since I wanted to be able to set a message on success too
* Added all "getter" layer api methods to the api doc

* fixed code style issues

* * copied part and pieces from branch MSP-5391 to fix mitmproxy url usage
* disable dev/debug output when formatting a response in non-dev environment
* added a "public" section in security.yaml to add urls can do not need security (assign of a user role)
* added missing Bearer prefix in Base::callServer call
* Added and fixed "logout" for Server Manager
* Fixed bug that imported an old or other user's refresh token
* Fixed authoriser url used in navbar using env. vars
* refresh token works again
* improved, extended api docs again
* No more permanent 308 redirect for /{session}/api/{query} to /api/{query} but instead we use sub request now. Works a lot better. No log clutter , and no issues with the watchdog. No more session query parameter, using attributes now.
* Remove AppFixtures in src/ , there is already a newer one in the root

* fixed some handling with the session sub request

* * added optional layer_tags request parameter to Layer/List, that allows to filter on tags, and updated the corresponding api docs
* exposed Game/GetActualDateForSimulatedMonth and Game/GetCountries, updated the api docs

* * added KPI/BatchPost to the api docs
* added check if session exists in SessionController.php

* fix /api/doc.json

* * fixed security
* update comment on doc.json in services.yaml
* fixed session attribute name
* fixed sub request handling

* blackfire loop should not be activated is apm is disabled (#304)

* improvements

* merged with MSP-5384
* removed ALLOWED and constructor parameter "method" from legacy api classes
* removed Base::isValid(...), was a disabled legacy security layer. We use Symfony's now.
* moved some base methods to child classes, since they were the only one using it
* usage of Geoserver as a member in child classes of Base, are now private. Added a getter to fetch it. And Geoserver has some setters now to configure it
* Changed EventLog legacy class to use the EventLog entity for convenience. EventLog entity has been extended with a "reference", so you tell what the message refers to
* moved
* added new SimulationController having api calls to Simulation/*. Note that Simulations/* cannot no longer be used, and MSWSupport has been adapted to this
* structured the SessionEntityListener
* extended watchdog server management with scheme and port , and changed the address handling (not a full url anymore)
* move more watchdog communication logic to the message handler keeping its slim on the caller side. also removed code duplication - in favor of the more generic async implementation
@marinhekman marinhekman changed the title (MSP-3820 + MSP-5394 + MSP-5384) MSP-5384 HybridLabs: extend server to support external simulations + MSP-3820 Port ServerManager into Symfony + MSP-5394 HybridLabs: swagger api documentation (MSP-3820 + MSP-5394 + MSP-5384 + MSP-5391) MSP-5384 HybridLabs: extend server to support external simulations + MSP-3820 Port ServerManager into Symfony + MSP-5394 HybridLabs: swagger api documentation + MSP-5391 HybridLabs: simulations into own docker container Jan 23, 2025
* simulations into own docker container:
* updated simulations folder.
  using debian 11 build since debian 12 has switch to net8 with libicu72, not
  supporting libicu67 anymore.
  todo: upgrade to net8.0
* Set WATCHDOG_ADDRESS=simulations
* updated docker-compose.yml: added new simulations container
* Dockerfile: removed msw from supervisor
* docker-entrypoint.sh: removed file permissions on simulations

* moved MSP_MEL_EWE_DUMP_ENABLED to simulations container

* more configurable ports to be able to run multiple dev environments in docker

* more configurable ports to be able to run multiple dev environments in docker pt.2

* fixed internal docker api url

* added alias dls: docker log simulations container
removed alias detlm

* fixed error in docker-compose.override.yml
@marinhekman marinhekman changed the title (MSP-3820 + MSP-5394 + MSP-5384 + MSP-5391) MSP-5384 HybridLabs: extend server to support external simulations + MSP-3820 Port ServerManager into Symfony + MSP-5394 HybridLabs: swagger api documentation + MSP-5391 HybridLabs: simulations into own docker container HybridLabs (MSP-3820 + MSP-5394 + MSP-5384 + MSP-5391) Jan 23, 2025
@marinhekman marinhekman marked this pull request as ready for review January 23, 2025 14:19
* fixed bug wrong datamodel key
* fixed route /api/simulation
* fixed getWatchdogs query
…l . non-string fields like game_session_info in Watchdog/UpdateState/

* added DeleteAll . And changed Upsert and Delete to handle multiple simulations at once.
* fixed "Start simulation" button in toolbar
* added support for x-notify-monthly-simulation-finished header for KPI::BatchPost
* test and fixed Simulation::notifyMonthSimulationFinished api call
* fixed watchdog message SetMonth. game_session_token needs to be string
…now if defined.

* added FailedMessageListener if a watchdog message gets into the failed transport, it will remove any unresponsive watchdog
* Changed watchdog messages to only hold the id of the watchdog entity . The entity itself will be retrieved by the message handler. This garantees the entity from being persisted on any change. E.g. setting the status to unresponsive
* Restructured the watchdog messages a bit , added WatchdogPingMessage
* Added websocket server plugin that pings all watchdogs (except the internal one) every 30 sec.
* Added custom retry strategy class for watchdog message . the ping message is not retried , that is repeated anyway.
* On a 405 do not repeat the message anymore by throwing UnrecoverableMessageHandlingException
* cascade persist for watchdog->simulations
…api/doc)

* on game load just take the game state as it was saved. This allows external simulation to still "connect" during a setup
* added simulation_settings field to game_watchdog_servers table, entity, twig template and form handling
* fixed http response 405 from watchdog
* fixed kpi handling of type external
* on toolbar's "start simulations" we also re-register the simulations if the game state is SETUP
* moved logic from handler to repository or helper classes
* retry on "method not allowed", remove watchdog on last try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants