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

Modification of --shrink for future schedules #588

Open
QuantumPosix opened this issue Mar 27, 2025 · 2 comments
Open

Modification of --shrink for future schedules #588

QuantumPosix opened this issue Mar 27, 2025 · 2 comments

Comments

@QuantumPosix
Copy link
Contributor

  • QUADS version (rpm -qa | grep quads and/or quads --version): "QUADS version 2.1.6 bowie"
  • Python version: Python 3.12.7
  • Operating System: Fedora release 40 (Forty)

Describe the bug
Went to shrink the with no active schedule but a future schedule to start on the next cycle. Gave following traceback:

To Reproduce

  1. quads --ls-schedule --host <host>
    Default cloud: cloud01 Current cloud: cloud01 753| start=2025-02-16T22:00, end=2025-03-23T22:00, cloud=cloud14 838| start=2025-03-30T22:00, end=2025-05-04T22:00, cloud=cloud50

  2. quads --shrink --host <host> --now
    Would you like to shrink a future allocation of <host> ? (y/N): Traceback (most recent call last): File "/usr/bin/quads", line 33, in <module> sys.exit(load_entry_point('quads==2.0', 'console_scripts', 'quads')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/quads/cli/main.py", line 64, in main _exit_code = qcli.run( ^^^^^^^^^ File "/usr/lib/python3.12/site-packages/quads/cli/cli.py", line 65, in run exit_code = action_meth() ^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/quads/cli/cli.py", line 755, in action_shrink if end_date < schedule.start or end_date > schedule.end or (not now and end_date < threshold): ^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: '<' not supported between instances of 'datetime.datetime' and 'str'

Additional context
add in a exception to display a message for this side case where if the host is not currently active and has a future schedule for the host (was scheduled to go into a decom cloud assignment) shrinking that future schedule(s) to cloud01 will display an error message over attempting to perform the shrink.

@sadsfae
Copy link
Member

sadsfae commented Mar 27, 2025

@QuantumPosix you need to use --mod-schedule for future schedules, --shrink only works on the current active schedule. This is what --mod-schedule is for since it needs the argument for the --schedule-id. I don't think this is a bug, this is by design.

https://github.com/redhat-performance/quads?tab=readme-ov-file#modifying-a-host-schedule

@grafuls
Copy link
Contributor

grafuls commented Mar 27, 2025

Leaving this open to provide a more user friendly error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do
Development

No branches or pull requests

3 participants