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

Allow {web_,task_,}replicas to be 0 #1464

Closed
wants to merge 5 commits into from

Conversation

relrod
Copy link
Member

@relrod relrod commented Jun 24, 2023

SUMMARY

There is quite a bit going on here.

On the user-facing side:

  • First off allow replicas, web_replicas, and task_replicas to be 0. Previously this was interpreted as a falsy value and messed up the templating logic. Now we compare it to the default (empty string) instead. Fixes AWX doesn't scale in to 0 replicas #1454.
  • The above uncovered another issue: If we scale replicas to 0, then the operator reconciliation loop starts failing since it tries to find some pod that doesn't exist in that case. Only run those tasks if we are able.

On the testing side:

  • Add tests for the above.
  • However this made the (single) test file really big, so I broke it into some separately-runnable files. For example, one file to update the AWX instance we are testing with. You just import that with include_tasks.
    • I also made it so that when you do that, you can pass in an additional_fields var so that you can actually customize the AWX definition to test how changes to fields interact.
  • Lowered CPU request specs, because it was failing with testing 3 replicas on GHA.
  • All these new tests made CI really slow (~13 minutes up to ~25 minutes). So to fix this, I made use of ansible tags and broke a test matrix in GHA. It's also easy to expand this (just tag the new tasks and edit/add two lines in ci.yaml) so that if we add chunks of other tests later, they can each run in their own separate instance, in parallel.
    • To do that, I had to tag the tasks that should always run (like the tasks to set up kind and tear it down, and to do the image build). I think this is a fair trade-off for the flexibility we get with doing matrix runs now.
  • Also deleted the branch filter from ci.yaml so that people can run the tests in the own forks on their own feature branches.
ISSUE TYPE
  • Bug, Docs Fix or other nominal change

@relrod relrod force-pushed the zero-replicas-are-replicas-too branch from 3a24b85 to 2f6b218 Compare June 24, 2023 07:31
@relrod relrod closed this Jun 24, 2023
@relrod relrod reopened this Jun 24, 2023
@relrod relrod force-pushed the zero-replicas-are-replicas-too branch from 2f6b218 to 3a24b85 Compare June 25, 2023 05:09
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.

AWX doesn't scale in to 0 replicas
1 participant