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

Revert "Reduce deployment resync duration" #5741

Merged
merged 2 commits into from
Jun 16, 2023
Merged

Conversation

youngbupark
Copy link

@youngbupark youngbupark commented Jun 16, 2023

Description

This reverts commit 6d16267.

Issue reference

Fixes: #issue_number

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Adds necessary unit tests for change
  • Adds necessary E2E tests for change
  • Unit tests passing
  • Extended the documentation / Created issue for it

Auto-generated summary

🤖 Generated by Copilot at a80b7b6

Summary

🧹🧪🔧

This pull request simplifies and improves the timeout configuration and deployment status checking logic for the corerp package. It removes unused and redundant code, refactors the handlers package to use the API server as the source of truth, and updates the unit tests accordingly. It also deletes the timeout.go file, which is no longer needed.

Simplify the timeout, remove the dead code
handler package is ready to explode
Refactor the status, handle the error
waitUntilDeploymentIsReady is our terror

Walkthrough

  • Remove unused corerp_config package import from handler and handlers packages (link, link)
  • Add MaxDeploymentTimeout constant to handler and handlers packages and use it to set the maximum duration for waiting for a deployment to be ready in AddRoutes and NewKubernetesHandler functions (link, link, link, link)
  • Change waitUntilDeploymentIsReady function to use errCh channel instead of statusCh channel to communicate errors, and to get the final deployment status from the API server and use the status message and reason from the latest condition as the error message when the context is done (link, link, link)
  • Change startDeploymentInformer function to pass only doneCh channel to checkDeploymentStatus function and to receive errors from errCh channel (link, link)
  • Change checkDeploymentStatus function to only check for the complete deployment condition and log the status type, status, and reason when the condition is true (link)
  • Modify TestWaitUntilDeploymentIsReady_Timeout function to use a single test case with a fixed timeout value, and to expect the error message and reason from the latest condition of the deployment (link, link, link)
  • Modify TestWaitUntilDeploymentIsReady_DifferentResourceName function to expect the error message to be wrapped with the failure to get the deployment from the API server (link)
  • Add metav1 package import to handlers package to access the GetOptions type in waitUntilDeploymentIsReady function (link)
  • Change the value of DefaultCacheResyncInterval constant in handlers package (link)
  • Delete pkg/corerp/config/timeout.go file (link)

@youngbupark youngbupark requested a review from a team as a code owner June 16, 2023 18:15
@github-actions
Copy link

github-actions bot commented Jun 16, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref a80b7b6
Unique ID 2d8e8e648b
Image tag pr-2d8e8e648b
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-2d8e8e648b
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-2d8e8e648b
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-2d8e8e648b

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp functional tests...
⌛ Starting ucp functional tests...
⌛ Starting samples functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
✅ corerp functional tests succeeded

@github-actions
Copy link

github-actions bot commented Jun 16, 2023

Radius functional test overview

🔍 Go to test action run

Name Value
Repository project-radius/radius
Commit ref e7ff841
Unique ID d185631959
Image tag pr-d185631959
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.18.0
  • Dapr: 1.10.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.0.0
  • recipe location radiusdev.azurecr.io/test/functional/corerp/recipes/<name>:pr-d185631959
  • appcore-rp test image location: radiusdev.azurecr.io/appcore-rp:pr-d185631959
  • ucp test image location: radiusdev.azurecr.io/ucpd:pr-d185631959

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp functional tests...
⌛ Starting ucp functional tests...
⌛ Starting samples functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
✅ corerp functional tests succeeded

@github-actions
Copy link

github-actions bot commented Jun 16, 2023

Test Results

2 714 tests   - 2   2 707 ✔️  - 2   2m 0s ⏱️ -7s
   240 suites  - 1          7 💤 ±0 
       1 files   ±0          0 ±0 

Results for commit e7ff841. ± Comparison against base commit 952e214.

This pull request removes 4 and adds 2 tests. Note that renamed tests count towards both.
github.com/project-radius/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/fcc7ad05-73ee-4c74-bfdc-b38df30b8de5
github.com/project-radius/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/fcc7ad05-73ee-4c74-bfdc-b38df30b8de5#01
github.com/project-radius/radius/pkg/corerp/handlers ‑ TestWaitUntilDeploymentIsReady_Timeout/context_timeout
github.com/project-radius/radius/pkg/corerp/handlers ‑ TestWaitUntilDeploymentIsReady_Timeout/deployment_timeout
github.com/project-radius/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/a5a8c5ca-8338-4171-b95a-f875a0487474
github.com/project-radius/radius/pkg/armrpc/frontend/controller ‑ TestValidateEtag_IfMatch/a5a8c5ca-8338-4171-b95a-f875a0487474#01

♻️ This comment has been updated with latest results.

@github-actions

This comment has been minimized.

@youngbupark youngbupark merged commit bf8dc0b into main Jun 16, 2023
@youngbupark youngbupark deleted the youngp/revert-container branch June 16, 2023 19:04
@youngbupark
Copy link
Author

I will push this fix in the next sprint after 0.22 release.

youngbupark added a commit that referenced this pull request Jun 16, 2023
nithyatsu pushed a commit that referenced this pull request Jun 21, 2023
# Description

This reverts commit 6d16267.


## Issue reference

<!--
We strive to have all PR being opened based on an issue, where the
problem or feature have been discussed prior to implementation.
-->

Fixes: #issue_number

## Checklist

Please make sure you've completed the relevant tasks for this PR, out of
the following list:

* [ ] Code compiles correctly
* [ ] Adds necessary unit tests for change
* [ ] Adds necessary E2E tests for change
* [ ] Unit tests passing
* [ ] Extended the documentation / Created issue for it

## Auto-generated summary

<!--
GitHub Copilot for docs will auto-generate a summary of the PR
-->

<!--
copilot:all
-->
### <samp>🤖 Generated by Copilot at a80b7b6</samp>

### Summary
🧹🧪🔧

<!--
1. 🧹 for simplifying the timeout configuration and removing unused code.
2.  🧪 for updating the unit tests and improving the test coverage.
3.  🔧 for refactoring the code and enhancing the functionality.
-->
This pull request simplifies and improves the timeout configuration and
deployment status checking logic for the `corerp` package. It removes
unused and redundant code, refactors the `handlers` package to use the
API server as the source of truth, and updates the unit tests
accordingly. It also deletes the `timeout.go` file, which is no longer
needed.

> _Simplify the timeout, remove the dead code_
> _`handler` package is ready to explode_
> _Refactor the status, handle the error_
> _`waitUntilDeploymentIsReady` is our terror_

### Walkthrough
* Remove unused `corerp_config` package import from `handler` and
`handlers` packages
([link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-2bdfa10a8abd451bfb18e729290e9182d1b8e6280d8a9e47dd0ce70f6e8d48d6L35-L36),
[link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L26))
* Add `MaxDeploymentTimeout` constant to `handler` and `handlers`
packages and use it to set the maximum duration for waiting for a
deployment to be ready in `AddRoutes` and `NewKubernetesHandler`
functions
([link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-2bdfa10a8abd451bfb18e729290e9182d1b8e6280d8a9e47dd0ce70f6e8d48d6L315),
[link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-2bdfa10a8abd451bfb18e729290e9182d1b8e6280d8a9e47dd0ce70f6e8d48d6L333),
[link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L45-R49),
[link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L52-R57))
* Change `waitUntilDeploymentIsReady` function to use `errCh` channel
instead of `statusCh` channel to communicate errors, and to get the
final deployment status from the API server and use the status message
and reason from the latest condition as the error message when the
context is done
([link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L129-R131),
[link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L135-R137),
[link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L141-R168))
* Change `startDeploymentInformer` function to pass only `doneCh`
channel to `checkDeploymentStatus` function and to receive errors from
`errCh` channel
([link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L172-R178),
[link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L184-R190))
* Change `checkDeploymentStatus` function to only check for the complete
deployment condition and log the status type, status, and reason when
the condition is true
([link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L201-R220))
* Modify `TestWaitUntilDeploymentIsReady_Timeout` function to use a
single test case with a fixed timeout value, and to expect the error
message and reason from the latest condition of the deployment
([link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-1539f100bbb77ae21828edd7fd8b07a632dc9629ff90ce80d3067626f8051947L309-R309),
[link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-1539f100bbb77ae21828edd7fd8b07a632dc9629ff90ce80d3067626f8051947L340-R322),
[link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-1539f100bbb77ae21828edd7fd8b07a632dc9629ff90ce80d3067626f8051947L347-R338))
* Modify `TestWaitUntilDeploymentIsReady_DifferentResourceName` function
to expect the error message to be wrapped with the failure to get the
deployment from the API server
([link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-1539f100bbb77ae21828edd7fd8b07a632dc9629ff90ce80d3067626f8051947L400-R378))
* Add `metav1` package import to `handlers` package to access the
`GetOptions` type in `waitUntilDeploymentIsReady` function
([link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7R35))
* Change the value of `DefaultCacheResyncInterval` constant in
`handlers` package
([link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L45-R49))
* Delete `pkg/corerp/config/timeout.go` file
([link](https://github.com/project-radius/radius/pull/5741/files?diff=unified&w=0#diff-9e80ec717929fd422805a06a07858d4f9871437e41ec36df9f0cd583ea46f428))
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