Skip to content

Propagate HasBeenActive to a terminal condition as "ScaleTargetInitialized".#8569

Merged
knative-prow-robot merged 6 commits intoknative:masterfrom
markusthoemmes:propagate-has-been-active
Jul 8, 2020
Merged

Propagate HasBeenActive to a terminal condition as "ScaleTargetInitialized".#8569
knative-prow-robot merged 6 commits intoknative:masterfrom
markusthoemmes:propagate-has-been-active

Conversation

@markusthoemmes
Copy link
Contributor

First step of #8540

Proposed Changes

  • Propagate HasBeenActive to a terminal condition.

Release Note

NONE

/assign @vagababov @julz @taragu

/hold
Until after the release.

It will eventually be superceding "Active" as the PA's readiness gate.
@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 7, 2020
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jul 7, 2020
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 7, 2020
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@markusthoemmes: 0 warnings.

Details

In response to this:

First step of #8540

Proposed Changes

  • Propagate HasBeenActive to a terminal condition.

Release Note

NONE

/assign @vagababov @julz @taragu

/hold
Until after the release.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot knative-prow-robot added area/API API objects and controllers area/autoscale area/test-and-release It flags unit/e2e/conformance/perf test issues for product features labels Jul 7, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: markusthoemmes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 7, 2020
Copy link
Contributor

@julz julz left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 7, 2020
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 7, 2020
@markusthoemmes
Copy link
Contributor Author

/retest

Doubt it's related.

@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-knative-serving-unit-tests 0/3

Failed non-flaky tests preventing automatic retry of pull-knative-serving-unit-tests:

pkg/reconciler/revision.TestNewRevisionCallsSyncHandler

@markusthoemmes
Copy link
Contributor Author

/test pull-knative-serving-unit-tests

@vagababov
Copy link
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 7, 2020
@markusthoemmes markusthoemmes assigned dprotaso, julz and vagababov and unassigned taragu Jul 7, 2020
PodAutoscalerConditionReady = apis.ConditionReady
// PodAutoscalerConditionHasBeenActive is set when the PodAutoscaler's ScaleTargetRef was ready to
// serve traffic once.
PodAutoscalerConditionHasBeenActive apis.ConditionType = "HasBeenActive"
Copy link
Member

@dprotaso dprotaso Jul 7, 2020

Choose a reason for hiding this comment

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

HasBeenActive sounds a bit odd to me - how about Deployed

Copy link
Member

@dprotaso dprotaso Jul 7, 2020

Choose a reason for hiding this comment

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

ScaleTargetDeployed (maybe just TargetDeployed) might be more specific

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I almost feel like we should just set Ready 😂

Copy link
Contributor

Choose a reason for hiding this comment

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

Not necessarily true. With initialScale=0 — nothing will ever be deployed

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm ScaleTargetDeployed might imply new calculated autoscaler scale targets. What about InitialTargetDeployed?

Copy link
Member

Choose a reason for hiding this comment

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

TargetInitialized ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe ReachedInitialScale, since that’s what actually gates the condition

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ScaleTargetInitialized would be my favorite mix from the above. I would like to keep InitialScale out of this, it doesn't necessarily gate this, for example if minScale is > initialScale.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, in my head when minScale > initialScale, initialScale is implicitly set to minScale, but I see how that could be confusing.

ScaleTargetInitialized seems alright, just a bit odd that it talks about a "Scale Target" concept that isn't really defined anywhere else, and doesn't mention the quite important fact that it's the scale target for the first scale we're talking about. I'm also not totally sure what "Initialized" means in this context.. "-Reached" seems clearer about what has to happen. Not the end of the world, though, if everyone else is happy Im happy.

Copy link
Member

Choose a reason for hiding this comment

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

I think it works because it's part of the PodAutoscaler spec

// ScaleTargetRef defines the /scale-able resource that this PodAutoscaler
// is responsible for quickly right-sizing.
ScaleTargetRef corev1.ObjectReference `json:"scaleTargetRef"`

@markusthoemmes markusthoemmes changed the title Propagate HasBeenActive to a terminal condition. Propagate HasBeenActive to a terminal condition as "ScaleTargetInitialized". Jul 8, 2020
@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 8, 2020
pa.Status.MarkHasBeenActive()
pa.Status.MarkScaleTargetInitialized()
// SKS should already be active.
pa.Status.MarkActive()
Copy link
Member

Choose a reason for hiding this comment

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

Could MarkActive also set the MarkScaleTargetInitialized or do you prefer to keep the two methods separate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I prefer them to be separate. I tried that too, but it felt slightly awkward.

@dprotaso
Copy link
Member

dprotaso commented Jul 8, 2020

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 8, 2020
Copy link
Contributor

@vagababov vagababov left a comment

Choose a reason for hiding this comment

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

/lgtm

@vagababov
Copy link
Contributor

/unhold

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 8, 2020
Copy link
Contributor

@julz julz left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/autoscaling/hpa/hpa.go 96.7% 96.8% 0.1

@knative-prow-robot knative-prow-robot merged commit ddd6bd9 into knative:master Jul 8, 2020
@julz julz mentioned this pull request Jul 23, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/API API objects and controllers area/autoscale area/test-and-release It flags unit/e2e/conformance/perf test issues for product features cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants