APX: RF2 server made easy

Discussion in 'Component and Mod Packaging' started by guenther, Oct 29, 2020.

  1. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    > Originally this was posted on reddit, but I thought I post that here also for non-reddit using people, especially league admins.

    For quite some time, I am working on a toolkit to help league admins to deal with rFactor servers. It follows the principle of having an non-invasive CLI interface to simplify and automate the management, updating and deployment of rFactor server instances. It works on every existing rFactor 2 server and does not add dependencies to the server itself, preventing the addition of new stability issues.

    The toolkit allows running reproducible builds, e.g. in case you want to add a skin to a server. The building/ updating is done via a single command, so you can grab a coffee instead of having to click throught multiple tools on the server. With having reproducible builds, it eradicates the factor of human-made mistakes between server update runs.

    The toolkit itself will be published as Open Source. It's not released yet, it's within a test loop to identify feature requirements and issues. The toolkit will also recieve a web interface, allowing people to sign up for championships and to upload liveries.

    I created a discord as a place for discussion, feel free to join if you have any questions or ideas:

    https://discord.gg/qwSkeAM
     
  2. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    instinkt likes this.
  3. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    instinkt likes this.
  4. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    instinkt likes this.
  5. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    I'm currently working on a web interface for the project. It will give administrators the possibility to create, manage and control servers including livery packaging (that means it creates all the rfcmp by itself), weather control (scripted) and race settings :)

    If anyone interested: https://discord.gg/qwSkeAM
     

    Attached Files:

    instinkt, Hazi and nonamenow like this.
  6. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    I am currently hosting an demo instance: https://apx-wizard.chmr.eu/admin/

    - The user is "testuser", password is "foobar!" (without quotes)
    - Saving and chatting is disabled
     
    instinkt likes this.
  7. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    Update about recent additions:
    • The web interface now features an signup form
    • Teams can now signup, revoke entries using a form
    • Teams can now upload/ update the liveries using a form
    • Files will be automatically renamed according to rFactor 2 naming schemes
    • The build process now uses ModMgr 64 bit build
    • VEH templates for a vehicle can be now parsed from a given example file, replacements will be done automatically
    • The web gui now automatically downloads the server key, an unlock key can be added and will be uploaded in the background
    • An extended error log was integrated, allowing better troubleshooting
    • The background workers are now included in one script to be executed regularly in the background
    • And update.ini can now be uploaded in the componentn properties
    • All components will be available as bundled with python at release
    • The server side component can now install everything on the fly (including dedicated server and steamcmd)
    • The web gui recieves the logfile about actions of the server automatically
    Documentation and in-detail information -> https://apx.chmr.eu/
    If anyone interested: https://discord.gg/qwSkeAM
     
    instinkt, Hazi and cybe like this.
  8. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    • The toolkit recieved an experimental update, adding support to upload and manage grip settings per session using the web interface
    • A bug was fixed preventing the server from being started
    • Added more logging output for better troubleshooting
    • A discord webhook was added, allowing to get a log what was happening on the instance (server start/stop/deploy, livery upload, health stats)
    Documentation and in-detail information -> https://apx.chmr.eu/
    If anyone interested: https://discord.gg/qwSkeAM
     
    instinkt and Hazi like this.
  9. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57

    Documentation and in-detail information -> https://apx.chmr.eu/
    If anyone interested: https://discord.gg/qwSkeAM
     
    instinkt, cybe and Hazi like this.
  10. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    I am thinking about doing a second Q/A session about the APX automation toolkit, as the last one was quite some time ago. And compared to the last meeting, a "shitton" of stuff changed and the new server management web UI was introduced.

    Topics

    - Current concept state
    - Current state of the implementation
    - How to install Reciever and Web GUI?
    - Limitations and open challenges

    Date: somewhere between 26th and 28th March
    Time: evening hours (UTC+1 located)

    Might be interesting for everyone keen to set up the project or just for people see wtf I am doing here all the time :sweat_smile:

    See you in the Q/A session :)

    Join the discord so we can define a meeting date and time https://discord.gg/qwSkeAM
     
    instinkt, cybe and Hazi like this.
  11. Hazi

    Hazi Registered

    Joined:
    Jan 15, 2012
    Messages:
    801
    Likes Received:
    89
    Sounds so great - but I don`t know about that stuff.
    Great work Thanks
     
    guenther likes this.
  12. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    Update summary for this week

    - Fixed an issue causing the VEH files from being not properly parsed
    - Fixed an issue where name and track in the status were mixed up
    - Added field "public secret" for using the race control screen
    - Added a fix which reduces the status endpoint execution time
    - Added a reason to a penalty
    - Added an experimental patch whcih adds the status polling in a thread, requesting the status each second. That change reduces the poll time for /status from 2.05s to 5ms
    - A new week, a new blog article https://chmr.eu/this-is-race-control/
    - Chat messages will no be send asynchronously -> no long load time while creating
    - Server actions (start, stop, deploy) are now executed instantly in the background -> no long load time when saving
    - The server can now have the state "Server is deploying" in case the wizard already thinks the server is ready to be started. -> This prevents the server from being started/ deployed again when not ready
    - The web app does not require to execute a secondary cron command now.
    - Updated the manual on https://wiki.apx.chmr.eu/doku.php?id=setup_wizard (added new settings, removed cron mentioning)
    - The event configuration now features an optional mod name, in case you want to have something different than apx_{randomstring}. The version number will be still managed by APX itself

    Documentation and in-detail information -> https://apx.chmr.eu/
    If anyone interested: https://discord.gg/qwSkeAM
     
    instinkt, Hazi and cybe like this.
  13. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    instinkt likes this.
  14. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    Recent additions:
    1. Added a form to sign up an entry for an event
    2. If no mod.json is avalable, abort deployment
    3. Added Restart weekend option to web interface
    4. Update of documentation:
    5. Added car selection to control which vehicle types can be signed up (Image)
    6. Added a flag to allow signup for an event (Image)
    7. Fixed an issue causing an wrong serialization of the start time

    [​IMG]

    Documentation and in-detail information -> https://apx.chmr.eu/
    If anyone interested: https://discord.gg/qwSkeAM
     
    instinkt likes this.
  15. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    And log rotation was added to the reciever.log file to prevent it from getting too large.
     
    instinkt likes this.
  16. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    I am thinking about doing a second Q/A session about the APX automation toolkit, as the last one was quite some time ago. And compared to the last meeting, a "shitton" of stuff changed and the new server management web UI was introduced.

    **Topics**

    - Current concept state
    - Current state of the implementation
    - How to install Reciever and Web GUI?
    - Limitations and open challenges

    Date? somewhere between 26th and 28th March
    Time? evening hours (UTC+1 located)

    Might be interesting for everyone keen to set up the project or just for people see wtf I am doing here all the time!

    See you in the Q/A session :)

    -> Join the discord so we can define a meeting date and time https://discord.gg/qwSkeAM
     
    instinkt likes this.
  17. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    instinkt likes this.
  18. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    The project recently got following updates:
    - The reciever can now install a new clean server if needed
    - A scheduler was added https://github.com/apx-simracing/issues/issues/11 https://wiki.apx.chmr.eu/doku.php?id=scheduler
    - Added gripfile support https://github.com/apx-simracing/issues/issues/6
    - The reciever now needs to be used with a separate user (for security reasons) https://github.com/apx-simracing/issues/issues/14
    - The serverw ill start now with high priority
    - Added possibility to adjust entry based veh values https://github.com/apx-simracing/issues/issues/19

    Documentation and in-detail information -> https://apx.chmr.eu/
    If anyone interested: https://discord.gg/qwSkeAM
     
    instinkt likes this.
  19. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    Updates! A lot of them!

    - Fixes https://github.com/apx-simracing/issues/issues/7
    - Added article for new CLI command plugins https://wiki.apx.chmr.eu/doku.php?id=commands:plugins
    - Added section documentation https://wiki.apx.chmr.eu/doku.php?id=event_configuration#section_plugins
    - Added documentation article for wizard view https://wiki.apx.chmr.eu/doku.php?id=add_plugins_wizard
    - Please note that there is currently no delete plugin feature, but it is listed as a to-do: https://github.com/apx-simracing/issues/issues/38
    - Fixed https://github.com/apx-simracing/issues/issues/38
    - The wizard/ CLI can now control if you want to run an steamcmd update of the server itself (I suspect that the common update calls may cause an invalidation of the ServerUnlock mechanism)
    - Documentation updated on https://wiki.apx.chmr.eu/doku.php?id=example_event_civic_2013_botniaring, https://wiki.apx.chmr.eu/doku.php?id=example_event_bmw_m8_gte_custom_liveries_autopolis and https://wiki.apx.chmr.eu/doku.php?id=event_configuration#section_update_on_build
    - Added hook onLapCompleted(driver, new_lap_count)
    - Added hook onPositionChange(driver, old_position, new_position)
    - Added hook onUnderYellowPositionChange(driver, old_position, new_position)
    - Added hook onSuspectedLag(driver: str, speed: float, old_speed:float, location: float, nearby_drivers: list, team_name: str)
    - Added hook onSteamIdChange(slotId, old_id: str, new_id: str)
    - Added hook onDriverPenaltyAdd(driver: str, old_penalty_count: int, new_penalty_count: int)
    - Added hook onDriverPenaltyRevoke(driver: str, old_penalty_count: int, new_penalty_count: int)
    - Added hook onNewPersonalBest(driver: str, old_time: seconds, new_time: seconds)
    - Added hook onGarageToggle(driver: str, old_status: boolean, new_status: boolean)
    - Added hook onPittingChange(driver: str, old_status: boolean, new_status: boolean)
    - Fixed an issue when the wizard is runned from packaged release, causing the run_apx_command to run into a file not found exception
    - Added a validation for the server dialog to make sure the reciever url ends with a slash
    - The public_url now defaults to "0.0.0.0" until it's being used
    - Fixed an inconsistency in the template settings file of the reciever, causing the background thread from being not runned
    - Use copy instead of cp on the wizard.bat - Fixed wrong path separator in wizard.bat
    - Deprecated the stamp command as the wizard includes this feature now
    - Added missing CRON_TIMEZONE to settings template
    - Fixed an issue causing the packaged CLI not to find it's args and commands packages
    - If the import of wand fails, the wizard will now disable any numberplates logic (stamping)
    - Fixed an issue causing the background thread from being not runned if a different port is used.
    - Added draft for a guide how to install updates: https://wiki.apx.chmr.eu/doku.php?id=install_updates
    - Added infos on how to change the wizard port https://wiki.apx.chmr.eu/doku.php?id=setup_wizard#use_different_port
    - Added an article about disabled servers in the wizard https://wiki.apx.chmr.eu/doku.php?id=server_disabled
     
    instinkt likes this.
  20. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    63
    Likes Received:
    57
    Recent additions

    - Added livetiming
    - Added livetiming customization guide https://wiki.apx.chmr.eu/doku.php?id=ticker_customization
    - Added packaging guidelines (more a hint on internals) https://wiki.apx.chmr.eu/doku.php?id=packaging_guidelines
    - The background cronjob now does only do schedules and downloading of the logfile. Anything else will be done on save.
    - Updated help texts accordingly
    - The logfile is now displayed as text instead of a forced download
    - Added filtering per class
    - Added neutral theme baseline to ticker
    - Updated https://wiki.apx.chmr.eu/doku.php?id=event_configuration
    - Updated https://wiki.apx.chmr.eu/doku.php?id=example_event_bmw_m8_gte_custom_liveries_autopolis
    - Updated https://wiki.apx.chmr.eu/doku.php?id=example_event_civic_2013_botniaring
    - Updated https://wiki.apx.chmr.eu/doku.php?id=setup_wizard to feature the new variable PUBLIC_URL
    - PUBLIC_URL represents the public wizard URL in case you want to use the livetiming. It's required so that the reciever knows where to send the event data to. Will be ignored if None
    - The livetiming will be able to filter classes out, if needed
    - Added best laps and last laps to livetiming
    - The hooks now use the PUBLIC_URL value instead of a hardcoded one
    - All hooks now recieve a last parameter containing the complete status object
    - Added /live/{key} endpoint to the wizard app to recieve latest ticker and timing data
    - Added command thumbnails https://wiki.apx.chmr.eu/doku.php?id=commands:thumbnails
    - Fixed an issue causing the CLI not to display the command requested in case of a command not found exception
    - Fixed an issue: Don't call the hook onLapChange if the new count is 0
    - Fixed an issue: Prevent the hook onPositionChange to fire if the previous position was unknown or 0
    - Changed the display of components. The version will be skipped if the version is the default (latest-even). You will only see the version in the list if you are using an explicit version or latest
    - Updated the article https://wiki.apx.chmr.eu/doku.php?id=common_components
    - The wizard will now feature three new batchscripts:
    addadmin.bat - add a new admin user
    applyupdates.bat - apply database updates after updating the wizard
    addcommon.bat - download the common component list and import it (this will import 44 components, adding 38 track layouts and 30 cars to the wizard) - The wizard.bat file will now stop creating a admin user as the mentioned script does that.
    - The article https://wiki.apx.chmr.eu/doku.php?id=install_updates#wizard was updated do mention the applyupdates.bat script.
    - The article https://wiki.apx.chmr.eu/doku.php?id=setup_wizard was updated to mention the new scripts
     
    instinkt likes this.

Share This Page