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

Deployment scale refactor #4212

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Deployment scale refactor #4212

wants to merge 2 commits into from

Conversation

sethboyles
Copy link
Member

@sethboyles sethboyles commented Feb 8, 2025

Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:

  • A short explanation of the proposed change:

  • An explanation of the use cases your change solves

  • Links to any other associated PRs

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

* also start separating total instance count from current scale target
expect(up_scaler.finished_scaling?).to be false
end

# TODO: Currently, deployments transition to COMPLETED even if there are some instances that have not started and become routable
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 was able to reproduce this by adding this to Dora's healthcheck endpoint:

 if ENV['CF_INSTANCE_INDEX'].to_i==3
     status 500
     return
 end

Given 6 instances and max of flight=2, the deployment will complete before the instance has started/become routable. Will fix in a future PR

@@ -1,4 +1,5 @@
require 'prometheus/client'
require 'prometheus/client/data_stores/direct_file_store'
Copy link
Member Author

Choose a reason for hiding this comment

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

this was so I could use the lightweight_spec_helper for some tests

* also move logic into instance_reporters
@sethboyles sethboyles force-pushed the deployment_scale_refactor branch from 41df631 to 8de2953 Compare February 12, 2025 19:33
end

def desired_non_deploying_instances
[target_total_instance_count - @routable_instance_count, 0].max
Copy link
Contributor

Choose a reason for hiding this comment

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

nit Should we be consistent on direct access vs attribute reader here?


def scale_down_old_processes
instances_to_reduce = non_deploying_web_processes.map(&:instances).sum - desired_non_deploying_instances
return true if up_scaler.finished_scaling?
Copy link
Contributor

Choose a reason for hiding this comment

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

question Can we return true here if the downscaler is still doing its thing?

@@ -105,6 +106,17 @@ def crashed_instances_for_app(process)
raise CloudController::Errors::InstancesUnavailable.new(e)
end

def instance_count_summary(process)
Copy link
Contributor

Choose a reason for hiding this comment

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

praise big fan of pushing this out of the updater and into the reporter

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.

2 participants