Page MenuHomeDevCentral

Update reports automatically on Agora
Open, WishlistPublic

Description

The reports repository contains two reports to publish and update Agora content:

Database serverReport for Agora pageCommitQuery file
AcquisitariatAI contentbb14cdd26c66tokens-language-models.sql
db-BOperations grimoire/Old content report3c94fd688d3eoperations-grimoire-older-pages.sql

It would make sense if this could be automated.

Plan is to:

  • tag the pages to help machine to identify automated report section
  • write helpers script to run the query and format the output as MediaWiki table
  • run an automated bot to run the report generator and update the relevant page

Event Timeline

dereckson triaged this task as Wishlist priority.Fri, Sep 12, 19:04
dereckson created this task.

Naming

On Agora, an account name is required for the automated agent / bot.
The agent will be called Rhyne-Wyse [1].

Credentials

Saved the following credentials into Vault:

ServicePurposeVault pathAccount status
AgoraEdit the wikiapps/rhyne-wyse/agora
db-BRun MariaDB queries against Agora databaseops/secrets/dbserver/cluster-B/users/rhyne-wyseD3667
acquisitariatRun MySQL queries against DevCentral databaseops/secrets/nasqueron/reports/acquisitariat

Notes

[1] Generated with the help of https://donjon.bin.sh/scifi/name/ (cyberpunk, megacorp), like usual for the bots.

dereckson updated the task description. (Show Details)

Claiming temporarily for credentials and if time allows this evening write helpers script. Will release afterwards, so anyone can create the bot.

Deployed on WindRiver. Anyone with a vault token valid for ops/secrets/dbserver/cluster-B/users/rhyne-wyse can run there:

$ run-report agora-operations-grimoire-older-pages

Releasing the task assignment.

Next step: create a MediaWiki client to automate the wiki publishing (based on pywikibot for example)

At this stage, we've an auto update working when running the helper script manually:

Screenshot From 2025-09-15 02-49-51.png (704×1 px, 1 MB)

Code is ready for anyone with a Vault token to run the bot, as hvac detects authentication methods from environment and known paths.

Next steps for full automation:

  • allow to login with proper credentials
    • Vault via rOPS: Create a permission for access to relevant credentials (see first comment of this post, acquisitariat not needed)
    • Vault manually: Create an AppRole linked to that permission
    • Code: allow to login to Vault with AppRole when available in environment or when a file exists, TO IMPLEMENT FOR BOTH TOOLS (bot needs Agora, run-report needs db-B-001).
  • deploy the bot on WindRiver
    • Vault via rOPS: credentials to query Vault (ie secret id and role id from the AppRole)
    • Salt: create rhyne-wyse user
    • Salt: create /var/db/rhyne-wyse, chown to rhyne-wyse:nasquenautes in 775, so everyone can run the bot too
    • Salt: provide /etc/periodic configuration to run the script daily

Asked ChatGPT to review D3678. An important note was raised about periodic system:

If the bot runs from periodic, environment may lack $HOME, so place config explicitly (-dir: option or set PYWIKIBOT_DIR).

Just for information, log doesn't have any timestamp.

Last entries of successful run:

Logging in to agora:agora as Rhyne-Wyse
[wiki.update_report] Report devcentral-token-language-models is up to date.
[wiki.update_report] Report agora-operations-grimoire-older-pages is up to date.

Next steps for full automation:

  • allow to login with proper credentials
    • Vault via rOPS: Create a permission for access to relevant credentials (see first comment of this post, acquisitariat not needed)
    • Vault manually: Create an AppRole linked to that permission
    • Code: allow to login to Vault with AppRole when available in environment or when a file exists, TO IMPLEMENT FOR BOTH TOOLS (bot needs Agora, run-report needs db-B-001).
  • deploy the bot on WindRiver
    • Vault via rOPS: credentials to query Vault (ie secret id and role id from the AppRole)
    • Salt: create rhyne-wyse user
    • Salt: create /var/db/rhyne-wyse, chown to rhyne-wyse:nasquenautes in 775, so everyone can run the bot too
    • Salt: provide /etc/periodic configuration to run the script daily

Done, operations part pending review, code part committed.

Improvement from last week plan:

  • approle credentials have been deployed through Terraform and not manually
  • crontab entry with wrapper script instead of hijacking system periodic system

If the bot runs from periodic, environment may lack $HOME, so place config explicitly (-dir: option or set PYWIKIBOT_DIR).

The wrapper explicitly uses /var/run/rhyne-wyse as working directory.

That's where Pywikibot populates pywikibot-Rhyne-Wyse.lwp, throttle.ctrl and apicache/
That's also where we copy the config (symlink was ignored as file didn't belong to rhyne-wyse or root, but to builder)