Skip to content

Conversation

@2uasimojo
Copy link
Member

@2uasimojo 2uasimojo commented Sep 3, 2021

Adds ClusterPool.Spec.RunningCount, the number of pool clusters to try to keep active at any time.

Note that when ClusterPool.Spec.HibernateAfter is set, we count from when it was claimed rather than when it was started so it doesn't hibernate early.

HIVE-1576

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 3, 2021
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 3, 2021
@2uasimojo
Copy link
Member Author

WIP: Test

@2uasimojo 2uasimojo force-pushed the HIVE-1576.code branch 2 times, most recently from 253e2c1 to 0aa8e48 Compare September 9, 2021 23:05
@codecov
Copy link

codecov bot commented Sep 9, 2021

Codecov Report

Merging #1528 (60d73ef) into master (22c6da1) will increase coverage by 0.16%.
The diff coverage is 76.34%.

❗ Current head 60d73ef differs from pull request most recent head 52de679. Consider uploading reports for the commit 52de679 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1528      +/-   ##
==========================================
+ Coverage   41.50%   41.66%   +0.16%     
==========================================
  Files         336      336              
  Lines       30691    30690       -1     
==========================================
+ Hits        12737    12788      +51     
+ Misses      16867    16809      -58     
- Partials     1087     1093       +6     
Impacted Files Coverage Δ
...shift/hive/apis/hive/v1/clusterdeployment_types.go 100.00% <ø> (ø)
...m/openshift/hive/apis/hive/v1/clusterpool_types.go 100.00% <ø> (ø)
pkg/controller/clusterpool/collections.go 75.82% <70.37%> (-0.79%) ⬇️
...g/controller/clusterpool/clusterpool_controller.go 56.31% <76.19%> (+1.47%) ⬆️
...g/controller/hibernation/hibernation_controller.go 59.58% <78.94%> (+0.13%) ⬆️
pkg/test/clusterdeployment/clusterdeployment.go 96.66% <100.00%> (+0.07%) ⬆️
pkg/test/clusterpool/clusterpool.go 97.53% <100.00%> (+0.09%) ⬆️
pkg/operator/util/apply.go 0.00% <0.00%> (-3.28%) ⬇️
pkg/operator/hive/hive.go 0.00% <0.00%> (ø)
pkg/operator/assets/bindata.go 0.00% <0.00%> (ø)
... and 2 more

@2uasimojo
Copy link
Member Author

Rebase picks up #1534 which should reduce e2e-pool flakes.
Still likely to run into #1535 though.

@2uasimojo
Copy link
Member Author

Tested live. Works gooood. Still pending UT.

@2uasimojo
Copy link
Member Author

UT done

/hold cancel

@2uasimojo 2uasimojo changed the title WIP: ClusterPool RunningCount ClusterPool RunningCount Sep 13, 2021
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 13, 2021
@2uasimojo
Copy link
Member Author

/retest

@2uasimojo
Copy link
Member Author

/assign @joelddiaz

@2uasimojo
Copy link
Member Author

/test e2e-pool

@2uasimojo 2uasimojo force-pushed the HIVE-1576.code branch 2 times, most recently from 60d73ef to de8c987 Compare September 14, 2021 18:10
@joelddiaz
Copy link
Contributor

One overarching thought I've had around this PR is adding the new field to the ClusterDeployment for tracking the claimed timestamp. I understand its purpose, but it does feel a bit like leaking details about ClusterPools down into the ClusterDeployment (which we've already done as I look through other part of the ClusterDeployment.Spec).

I suppose my question is: does everyone feel okay with this (I don't know what to call it: separation of concerns or leaky abstractions or something else)?

@2uasimojo
Copy link
Member Author

One overarching thought I've had around this PR is adding the new field to the ClusterDeployment for tracking the claimed timestamp. I understand its purpose, but it does feel a bit like leaking details about ClusterPools down into the ClusterDeployment (which we've already done as I look through other part of the ClusterDeployment.Spec).

Would it be more comfortable if it was ClusterDeployment.Spec.ClusterPoolRef.ClaimedTimestamp instead? There are tradeoffs either way.

  • The timestamp seems like more of a status-y thing than a spec-y thing.
  • It feels a lot like InstalledTimestamp.
  • It's used by the hibernation controller right alongside ⬆️

...but it's set a the same time as ClusterPoolRef.ClaimName; and putting it in there would save us having to do a separate status update.

I'm happy either way, just lmk.

@2uasimojo
Copy link
Member Author

/test e2e-pool

@2uasimojo
Copy link
Member Author

/hold

Team met today and we decided to do this:

Would it be more comfortable if it was ClusterDeployment.Spec.ClusterPoolRef.ClaimedTimestamp instead?

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 20, 2021
Resolve a TODO whereby clusters added to satisfy capacity weren't being
registered in the cdCollection tracking the state of all the pool
clusters. Previously this didn't matter because there was no code after
that point that cared; we're about to add some.

Prep for HIVE-1576
@2uasimojo
Copy link
Member Author

4acce17 rebase only. ClaimedTimestamp changes still forthcoming.

Adds ClusterPool.Spec.RunningCount, the number of pool clusters to try
to keep active at any time.

Note that when ClusterPool.Spec.HibernateAfter is set, we count from
when it was claimed rather than when it was started so it doesn't
hibernate early. Adds a
ClusterDeployment.Spec.ClusterPoolref.ClaimedTimestamp to track this.

HIVE-1576
@2uasimojo
Copy link
Member Author

Would it be more comfortable if it was ClusterDeployment.Spec.ClusterPoolRef.ClaimedTimestamp instead?

This is done.

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 21, 2021
Copy link
Contributor

@joelddiaz joelddiaz left a comment

Choose a reason for hiding this comment

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

looks good to go
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 21, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 2uasimojo, joelddiaz

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:
  • OWNERS [2uasimojo,joelddiaz]

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

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 8bd974e into openshift:master Sep 21, 2021
@2uasimojo 2uasimojo deleted the HIVE-1576.code branch September 22, 2021 13:32
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants