Skip to content

Commit

Permalink
man1: add man(1) for flux-account, DB admin cmds
Browse files Browse the repository at this point in the history
Problem: flux-accounting doesn't have a man(1) entry for flux-account,
which has lots of subcommands that could use specific manual pages to
describe how to use each subcommand.

Add a general flux-account(1) man page entry and list of all the
currently available subcommands. Add man(1) entries for all of the DB
administration commands, i.e create-db, export-db, and pop-db. Add some
of the flagged "mispelled" words in these man pages to the dictionary.
  • Loading branch information
cmoussa1 committed Nov 22, 2024
1 parent 6d1d2c3 commit c96f242
Show file tree
Hide file tree
Showing 6 changed files with 267 additions and 0 deletions.
30 changes: 30 additions & 0 deletions doc/man1/flux-account-create-db.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.. flux-help-section: flux account
=========================
flux-account-create-db(1)
=========================


SYNOPSIS
========

**flux** **account** **create-db** [OPTIONS]

DESCRIPTION
===========

.. program:: flux account create-db

:program:`flux account create-db` creates the flux-accounting SQLite database
which will hold all of the accounting information for users, banks, queues,
projects, and job records.

.. option:: --priority-usage-reset-period

The number of weeks at which job usage information gets reset to 0. By
default, the usage reset period is set at 4 weeks.

.. option:: --priority-decay-half-life

The contribution of historical usage in weeks on the composite job usage
value. By default, this is set at 1 week.
38 changes: 38 additions & 0 deletions doc/man1/flux-account-export-db.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.. flux-help-section: flux account
=========================
flux-account-export-db(1)
=========================


SYNOPSIS
========

**flux** **account** **export-db** [OPTIONS]

DESCRIPTION
===========

.. program:: flux account export-db

:program:`flux account export-db` will extract flux-accounting database
information into two ``.csv`` files.

.. option:: -u, --users

Path to a ``.csv`` file containing user information.

.. option:: -b, --banks

Path to a ``.csv`` file containing bank information.

The order of columns extracted from the ``association_table``:

**Username,UserID,Bank,Shares,MaxRunningJobs,MaxActiveJobs,MaxNodes,Queues**

The order of columns extracted from the ``bank_table``:

**Bank,ParentBank,Shares**

If no custom path is specified, this will create a file in the current working
directory called ``users.csv`` and ``banks.csv``.
42 changes: 42 additions & 0 deletions doc/man1/flux-account-pop-db.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.. flux-help-section: flux account
======================
flux-account-pop-db(1)
======================


SYNOPSIS
========

**flux** **account** **pop-db** [OPTIONS]

DESCRIPTION
===========

.. program:: flux account pop-db

:program:`flux account pop-db` will populate an already-existing
flux-accounting database with a ``.csv`` file.

.. option:: -u, --users

Path to a ``.csv`` file containing user information.

.. option:: -b, --banks

Path to a ``.csv`` file containing bank information.

The order of elements required for populating the ``association_table`` are as
follows:

**Username,UserID,Bank,Shares,MaxRunningJobs,MaxActiveJobs,MaxNodes,Queues**

**Shares,MaxRunningJobs,MaxActiveJobs,MaxNodes** can be left blank (``''``) in
the ``.csv`` file for a given row.

The order of elements required for populating the ``bank_table`` are as
follows:

**Bank,ParentBank,Shares**

**Shares** can be left blank (``''``) in the ``.csv`` file for a given row.
121 changes: 121 additions & 0 deletions doc/man1/flux-account.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
.. flux-help-section: flux account
===============
flux-account(1)
===============


SYNOPSIS
========

**flux** **account** [*COMMAND*] [OPTIONS]

DESCRIPTION
===========

.. program:: flux account

:program:`flux account` provides an interface to the SQLite database containing
information regarding banks, associations, queues, projects, and archived jobs.
It also provides administrative commands like exporting and populating the DB's
information to and from ``.csv`` files, updating the database when new versions
of flux-accounting are released, and more.

DATABASE ADMINISTRATION
=======================

create-db
^^^^^^^^^

Create the flux-accounting database.

See flux account-create-db(1) for more details.

pop-db
^^^^^^

Populate a flux-accounting database with ``.csv`` files.

See flux account-pop-db(1) for more details.

export-db
^^^^^^^^^

Export a flux-accounting database into ``.csv`` files.

See flux account-export-db(1) for more details.

USER ADMINISTRATION
===================

view-user
^^^^^^^^^

add-user
^^^^^^^^

delete-user
^^^^^^^^^^^

edit-user
^^^^^^^^^

BANK ADMINISTRATION
===================

view-bank
^^^^^^^^^

add-bank
^^^^^^^^

delete-bank
^^^^^^^^^^^

edit-bank
^^^^^^^^^

list-banks
^^^^^^^^^^

QUEUE ADMINISTRATION
====================

view-queue
^^^^^^^^^^

add-queue
^^^^^^^^^

delete-queue
^^^^^^^^^^^^

edit-queue
^^^^^^^^^^

PROJECT ADMINISTRATION
======================

view-project
^^^^^^^^^^^^

add-project
^^^^^^^^^^^

delete-project
^^^^^^^^^^^^^^

list-projects
^^^^^^^^^^^^^

JOB RECORDS
===========

view-job-records
^^^^^^^^^^^^^^^^

update-usage
^^^^^^^^^^^^

scrub-old-jobs
^^^^^^^^^^^^^^
28 changes: 28 additions & 0 deletions doc/manpages.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,34 @@
# - Author (use [author])
# - Manual section
man_pages = [
(
"man1/flux-account",
"flux-account",
"flux-accounting commands",
[author],
1,
),
(
"man1/flux-account-create-db",
"flux-account-create-db",
"create the flux-accounting SQLite database",
[author],
1,
),
(
"man1/flux-account-pop-db",
"flux-account-pop-db",
"populate a flux-accounting database with .csv files",
[author],
1,
),
(
"man1/flux-account-export-db",
"flux-account-export-db",
"export flux-accounting database information into .csv files",
[author],
1,
),
(
"man5/flux-config-accounting",
"flux-config-accounting",
Expand Down
8 changes: 8 additions & 0 deletions doc/test/spell.en.pws
Original file line number Diff line number Diff line change
Expand Up @@ -536,3 +536,11 @@ raiseall
fairshare
dne
DNE
csv
SQLite
DB's
MaxActiveJobs
MaxNodes
MaxRunningJobs
ParentBank
UserID

0 comments on commit c96f242

Please sign in to comment.