Skip to content

WIP: rework accounting scripts - #288

Draft
anish-mudaraddi wants to merge 4 commits into
masterfrom
wip-accounting
Draft

WIP: rework accounting scripts #288
anish-mudaraddi wants to merge 4 commits into
masterfrom
wip-accounting

Conversation

@anish-mudaraddi

@anish-mudaraddi anish-mudaraddi commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

make accounting scripts run as a docker container

requirements:

  1. the docker container must run continuously - to get accounting data every interval

  2. also, the container can be used to collect past accounting data by providing timestamps from the past.

  3. there should be good logs so it can run on kayobe and be debugged easily

  4. there should be a dry-run feature - so we can test improvements in the future without sending data anywhere

  5. there should be good testing and linting to keep up with our coding standards

  6. it should work on a supported python version and the dependencies should be up-to-date

Still TODO:

  • more testing on monitoring nodes
  • acceptance testing on dev
  • automated CI to run test
  • moving this out into https://github.com/stfc/cloud-image-builders
    so that we can auto-build and version the docker container
  • getting a playbook together in our kayobe config to install this alongside monitoring containers
  • setting up perms on dev db to allow these scripts to run on monitoring nodes

@gmatthews20 gmatthews20 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't yet reviewed any of the tests. Will take a look once we're happy with the functionality

Comment thread OpenStack-accounting/thecount/__init__.py Outdated
Comment thread OpenStack-accounting/thecount/cli.py Outdated
Comment thread OpenStack-accounting/thecount/cli.py Outdated
Comment thread OpenStack-accounting/thecount/jobs.py Outdated
Comment thread OpenStack-accounting/thecount/jobs.py Outdated
Comment thread OpenStack-accounting/thecount/source.py Outdated
Comment on lines +1 to +2
# Use Python 3.12 slim image as base
FROM python:3.12-slim

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was version 3.12 chosen, any reason we couldn't use something newer like 3.14?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used python3.12 to write the code - hence python:3.12

Comment thread OpenStack-accounting/Dockerfile Outdated
Comment thread OpenStack-accounting/pyproject.toml Outdated
Comment thread OpenStack-accounting/README.md
Comment thread OpenStack-accounting/thecount/cli.py Outdated
@anish-mudaraddi
anish-mudaraddi force-pushed the wip-accounting branch 2 times, most recently from 93a8215 to 817a236 Compare August 28, 2026 14:20
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.

2 participants