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

Use query builder #25

Merged
merged 11 commits into from
Jan 5, 2024
Merged

Use query builder #25

merged 11 commits into from
Jan 5, 2024

Commits on Jan 3, 2024

  1. fix: Correct json tag in struct def

    Signed-off-by: Mahendra Paipuri <[email protected]>
    mahendrapaipuri committed Jan 3, 2024
    Configuration menu
    Copy the full SHA
    041a0ac View commit details
    Browse the repository at this point in the history
  2. chore: Remove unnecessary arg in receiver

    Signed-off-by: Mahendra Paipuri <[email protected]>
    mahendrapaipuri committed Jan 3, 2024
    Configuration menu
    Copy the full SHA
    bd3a949 View commit details
    Browse the repository at this point in the history
  3. feat: Use query builder for building queries

    * Simplified the logic of fetching jobs from DB
    
    * Admin user can fetch all jobs of any user by setting special X-Dashboard-User header
    
    * Use ISO date format used by Grafana
    
    * Update and add new tests
    
    Signed-off-by: Mahendra Paipuri <[email protected]>
    mahendrapaipuri committed Jan 3, 2024
    Configuration menu
    Copy the full SHA
    575a007 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2024

  1. refactor: Include time zone in slurm job times

    * We need to have time zone information to be able to convert times between unix and dateformats easily
    
    * Set SLURM_TIME_FORMAT env var for sacct command to include timezone in output
    
    * Include time stamps in BatchJob struct as we need them to generate Grafana URLs
    
    * Add env arg to os execute helpers to be able to set env vars to subprocesses
    
    * Update functions using Execute calls to include env vars arg
    
    Signed-off-by: Mahendra Paipuri <[email protected]>
    mahendrapaipuri committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    b574eb9 View commit details
    Browse the repository at this point in the history
  2. refactor: Use timestamp as query parameter

    * Grafana passes ISO time always in UTC zone
    
    * If we want to use local browser time, we need to use timestamp as query parameter
    
    * We simplify /api/jobs end point to accept timestamp as query parameter
    
    * Update tests and fixtures accordingly
    
    Signed-off-by: Mahendra Paipuri <[email protected]>
    mahendrapaipuri committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    d8d5503 View commit details
    Browse the repository at this point in the history
  3. fix: Remove unnecessary quotes

    * Quoting SLURM_TIME_FORMAT is messing up DB entry format
    
    Signed-off-by: Mahendra Paipuri <[email protected]>
    mahendrapaipuri committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    9cd5314 View commit details
    Browse the repository at this point in the history
  4. feat: Query for changes after db row deletion

    * Emit log in debug mode on how many rows deleted
    
    Signed-off-by: Mahendra Paipuri <[email protected]>
    mahendrapaipuri committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    d492685 View commit details
    Browse the repository at this point in the history
  5. chore: Update get accounts endpoint

    Signed-off-by: Mahendra Paipuri <[email protected]>
    mahendrapaipuri committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    5dede8c View commit details
    Browse the repository at this point in the history
  6. refactor: Use UnixMilli for slurm job times

    * Grafana expects a millisecond epoch for to and from query params
    
    Signed-off-by: Mahendra Paipuri <[email protected]>
    mahendrapaipuri committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    90e0bb4 View commit details
    Browse the repository at this point in the history
  7. test: Update tests and fixtures

    Signed-off-by: Mahendra Paipuri <[email protected]>
    mahendrapaipuri committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    dd91e1d View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2024

  1. fix: Add correct http status codes

    * We are always returning 200 for all responses
    
    * Set correct response codes based on actual response
    
    * Update tests
    
    Signed-off-by: Mahendra Paipuri <[email protected]>
    mahendrapaipuri committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    866f946 View commit details
    Browse the repository at this point in the history