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

scheduled task to conditionally scale up the houndigrade cluster #229

Merged
merged 10 commits into from Apr 27, 2018

Conversation

infinitewarp
Copy link
Member

@infinitewarp infinitewarp commented Apr 25, 2018

#176

This PR adds our first support for scheduled Celery tasks using beat. As described in #176, this task checks the current cluster auto scaling size, checks the message queue for volume IDs, scales up to 1, and runs a (currently stubbed-out) async task that will be responsible for actually "running" houndigrade in the cluster.

Note: this PR builds upon the organize-aws-helpers branch and needs to merge after #224 merges.

Demo: coming soon!

@infinitewarp infinitewarp changed the title 176 scale cluster WIP 176 scale cluster Apr 25, 2018
@codecov
Copy link

codecov bot commented Apr 25, 2018

Codecov Report

Merging #229 into master will increase coverage by 0.2%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #229     +/-   ##
=========================================
+ Coverage   98.94%   99.15%   +0.2%     
=========================================
  Files          48       50      +2     
  Lines        1807     2012    +205     
  Branches       94       99      +5     
=========================================
+ Hits         1788     1995    +207     
+ Misses         13       11      -2     
  Partials        6        6
Impacted Files Coverage Δ
cloudigrade/util/aws/__init__.py 100% <100%> (ø) ⬆️
cloudigrade/util/tests/test_aws_autoscaling.py 100% <100%> (ø)
cloudigrade/util/exceptions.py 100% <100%> (ø) ⬆️
cloudigrade/account/tests/test_tasks.py 98.97% <100%> (+0.35%) ⬆️
cloudigrade/util/aws/autoscaling.py 100% <100%> (ø)
cloudigrade/account/util.py 98.27% <100%> (+0.71%) ⬆️
cloudigrade/account/tasks.py 100% <100%> (ø) ⬆️
cloudigrade/account/tests/test_util.py 100% <100%> (ø) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 24c8bd5...ec4821a. Read the comment docs.

@infinitewarp infinitewarp changed the title WIP 176 scale cluster scheduled task to conditionally scale up the houndigrade cluster Apr 25, 2018
)
HOUNDIGRADE_AWS_VOLUME_BATCH_SIZE = env.int(
'HOUNDIGRADE_AWS_VOLUME_BATCH_SIZE',
default=5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not want to do 32 like we originally talked about?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. 👍 I accidentally overlooked that requirement.

@infinitewarp infinitewarp added this to the sprint 2018-04-23 milestone Apr 26, 2018
)

if len(messages) == 0:
# Quietly exit and let a future run check for messages.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is the right time, but I'd love to see some debug logging happen in situations like this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd considered about the same thing when I wrote this. I think I'll add some in now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info logs added in the latest commits. I figure start louder at info and we can lower it to debug when we decide it's too noisy.

CELERYBEAT_SCHEDULE = {
'scale_up_inspection_cluster_every_5_min': {
'task': 'account.tasks.scale_up_inspection_cluster',
'schedule': 60 * 5, # seconds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding timing, I think we originally were talking about trying to run the cluster once every 30 mins or an hour, maybe have it be configurable? Either way 5 minutes seems awfully small with how long snapshot copy operations can take.

Copy link
Contributor

@katherine-black katherine-black left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throwing request changes on here until individual comments are resolved.

@infinitewarp infinitewarp changed the base branch from organize-aws-helpers to master April 26, 2018 14:12
@infinitewarp infinitewarp requested a review from noahl April 26, 2018 17:44
@infinitewarp
Copy link
Member Author

Recorded demos here: #176 (comment)

Copy link
Contributor

@katherine-black katherine-black left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the test for the limit 👍

@infinitewarp infinitewarp merged commit 2fcd3d6 into master Apr 27, 2018
@infinitewarp infinitewarp deleted the 176-scale-cluster branch April 27, 2018 20:46
infinitewarp added a commit to infinitewarp/demo-notes that referenced this pull request Nov 18, 2019
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.

None yet

2 participants