Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin: add project validation and annotation #294

Closed
wants to merge 11 commits into from

Commits on Sep 25, 2023

  1. plugin: expand split_string ()

    Problem: The split_string () helper function can only accept a list of
    queues to parse when unpacking user/bank information from the
    flux-accounting DB, but there also exists a need to be able to parse a
    list of projects as well. Since both lists can be parsed the same way,
    this helper function should be expanded.
    
    Expand the split_string () helper function to accept either a list of
    queues or a list of proects to parse through when unpacking user/bank
    information.
    cmoussa1 committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    d2f764f View commit details
    Browse the repository at this point in the history
  2. plugin: add project information unpacks

    Add an unpack of the "projects" and "def_project" columns for each
    association when unpacking them in the rec_update_cb () function.
    
    Add a new callback to unpack information from the project_table and
    store it in a vector of projects to be used for project validation
    and annotation.
    cmoussa1 committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    1e3f290 View commit details
    Browse the repository at this point in the history
  3. priority-update: add projects info to update

    Add information from the project_table and the projects column in the
    association_table to the bulk update script that sends user, bank, and
    queue information to the multi-factor priority plugin.
    cmoussa1 committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    c19bee2 View commit details
    Browse the repository at this point in the history
  4. t: add active, projects, def_project cols

    Add "active", "projects", and "def_project" key-value pairs to the fake
    payloads sent to the multi-factor priority plugin in a number of the
    sharness tests.
    cmoussa1 committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    a14fdd1 View commit details
    Browse the repository at this point in the history
  5. t: move sample JSON payloads to separate files

    Problem: The sample user payloads sent to the plugin grow longer than
    wanted in the sharness test files with the addition of the "project" and
    "default_project" fields.
    
    For the tests that have these sample payloads, create a new folder in
    the t/ directory that stores these JSON payloads permanently in a file
    instead of creating them within the test.
    cmoussa1 committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    567753e View commit details
    Browse the repository at this point in the history
  6. plugin: add project validation

    Add project validation to the validate_cb () function, which checks
    that if a project is specified by an association when a job is
    submitted, it:
    
    1) is a valid project to submit jobs under, and
    
    2) is a valid project for the association to submit jobs under.
    
    If either one of these checks fail, the job is rejected with a message
    including the project name.
    cmoussa1 committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    30fae7e View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2023

  1. plugin: add helper function to add project name

    Add a helper function to mf_priority.cpp that adds the project name for
    a user/bank's job to the jobspec via jobspec-update under
    attributes.system.project.
    cmoussa1 committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    dc55621 View commit details
    Browse the repository at this point in the history
  2. plugin: add jobspec-update of project name

    Problem: If a user submits a job under a default project, there is no
    way to tell which project they submitted their job under because it does
    not get posted to jobspec.
    
    Add a jobspec-update of the user/bank's default project name when the
    job is in the job.new callback.
    
    In the event where a user/bank submits a job before any information is
    loaded to the priority plugin and their job is held in PRIORITY state,
    add a jobspec-update of the user/bank's default project name in
    job.state.priority IF their default project name is not "*" ("*" is
    the default project name if a user is added to the database with no
    projects).
    cmoussa1 committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    29fb9f6 View commit details
    Browse the repository at this point in the history
  3. plugin_query: add projects, def_project

    Add the projects and def_project fields to the list of information
    returned for each association in the plugin.query callback.
    
    Add the projects and def_project key-value pairs to the expected files
    for t1019-mf-priority-info-fetch.t.
    cmoussa1 committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    139c440 View commit details
    Browse the repository at this point in the history
  4. t: add tests for project validation

    Problem: There are no tests for project validation and annotation in the
    multi-factor priority plugin.
    
    Add some tests.
    cmoussa1 committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    9723d3b View commit details
    Browse the repository at this point in the history
  5. t1029: remove brackets from "grep" tests

    Problem: Now that the priority jobtap plugin supports jobspec-updates of
    both banks and projects, the "jobspec-update" event in the eventlog
    holds both of these updates on one line, which breaks the assumption in
    t1029-mf-priority-default-bank.t that the jobspec-update of a user's
    default bank will be surrounded by brackets {}.
    
    Remove the outer brackets from the tests in
    t1029-mf-priority-default-bank.t that grep for a certain bank.
    cmoussa1 committed Sep 26, 2023
    Configuration menu
    Copy the full SHA
    09063e0 View commit details
    Browse the repository at this point in the history