Skip to content

Repository files navigation

Ubuntu Static Reports Operator

Ubuntu Static Reports Operator is a charm for building and presenting various static reports for Ubuntu. Fetching those live from launchpad API or similar sources every time would be too stressful and therefore are done on a regular schedule with the reports then being made available on the web.

This reposistory contains the code for the charm, the applications are coming from various sources depending on the respective service.

List of covered services

Basic usage

Assuming you have access to a bootstrapped Juju controller, you can deploy the charm with (For details on local manual debug see CONTRIBUTING.md):

❯ juju deploy ubuntu-static-reports

Once the charm is deployed, you can check the status with Juju status:

❯ $ juju status
Model        Controller  Cloud/Region         Version  SLA          Timestamp
welcome-lxd  lxd         localhost/localhost  3.6.7    unsupported  13:29:50+02:00

App       Version  Status  Scale  Charm             Channel  Rev  Exposed  Message
ubuntu-static-reports           active      1  ubuntu-static-reports             0  no

Unit          Workload  Agent  Machine  Public address  Ports  Message
ubuntu-static-reports/0*  active    idle    1       10.142.46.109

Machine  State    Address        Inst id         Base          AZ  Message
1        started  10.142.46.109  juju-fd4fe1-1   ubuntu@24.04      Running

On first start up, the charm will install the application and install a systemd timer unit to trigger tracker updates on a regular basis.

Swap file (OOM resilience)

Report generation can be memory hungry; to make the unit resilient against out-of-memory kills, the charm ensures an 8G swap file at /swapfile.swp on the root filesystem (the detachable charm storage must not hold swap). On install, re-deploy and charm upgrades alike:

  • if /swapfile.swp already exists it is kept as-is (never recreated or resized) and only ensured to be active,
  • if it is missing it is created via fallocate with mode 0600, mkswap and activated,
  • and /etc/fstab is updated (idempotently) so the swap file also survives reboots.

If setting up or activating the swap file fails (e.g. not enough space on the root disk) the unit goes into blocked state.

To refresh the report, you can use the provided Juju Action:

❯ juju run ubuntu-static-reports/0 refresh"

Checking a live worker node

To analyze the status of all reports - when they ran or when they will run next, the log output of each and more - use systemctl as the are all systemd timers and services.

❯ systemctl list-timers --all update-bugpatterns update-seeds update-sync-blocklist packageset-report package-subscribers permissions-report update-mismatches update-germinate update-nbs update-archive-mirror

Since the report execution is wrapped into systemd services, one can also use systemctl status as well as journalctl -eu to assess state and debug if neccessary.

❯ journalctl -eu update-sync-blocklist
❯ systemctl status update-sync-blocklist.service

Testing

For information on running tests and development workflows, see the contribution guide.

Contribute to Ubuntu Static Reports Operator

Ubuntu Static Reports Operator is open source and part of the Canonical family. We would love your help.

If you're interested, start with the contribution guide.

License and copyright

Ubuntu Static Reports Operator is released under the GPL-3.0 license.

About

Charm for deploying static reports that used to be under https://ubuntu-archive-team.ubuntu.com/

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages