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

Implementation of resource providers and resource types registration #7967

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

rynowak
Copy link
Contributor

@rynowak rynowak commented Sep 26, 2024

Description

This change implements the API functionality for registering resource providers and related child-types through the Radius API. This is the first step towards making the Radius API surface extensible. For this first step there is no consumer of this data or these APIs. Subsequent changes will consume the data and implement the user-facing functionality.

What's possible in this commit:

  • CRUDL operations on resource provider and related types like:
    • resource type
    • api version (child of resource type)
    • location

Additionally, this change implements the resource provider "summary" API. The summary API provides a combined view of the most useful data from each resource provider and its children.


For reviewers there are a few important notes:

  • Routing in UCP is complex, and error prone to work on. I abandoned the existing code and rewrote it in a form that's more native to go-chi. This was a significant improvement and made it much easier to debug the code. UCP has good integration tests so I'm not very concerned about regressions.
  • This is our first use-case for child resources in Radius. I used the async controllers to implement cascading deletion.
  • The "summary" API uses cached data. The async controllers for resource provider and other types update the cache. This is our first use of this pattern, but it felt right to me.

Type of change

  • This pull request adds or changes features of Radius and has an approved issue (issue link required).

Part of: #6688

@rynowak rynowak requested review from a team as code owners September 26, 2024 19:38
@radius-functional-tests
Copy link

radius-functional-tests bot commented Sep 27, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository rynowak/radius
Commit ref 9f6be61
Unique ID func02676243a4
Image tag pr-func02676243a4
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func02676243a4
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func02676243a4
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func02676243a4
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func02676243a4
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

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 datastoresrp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ datastoresrp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 54.73790% with 449 lines in your changes missing coverage. Please review.

Project coverage is 60.36%. Comparing base (b2eb80b) to head (001dbf7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...oller/resourceproviders/resourceprovider_delete.go 0.00% 116 Missing ⚠️
...ontroller/resourceproviders/resourcetype_delete.go 7.24% 64 Missing ⚠️
...resourceproviders/listresourceprovidersummaries.go 0.00% 45 Missing ⚠️
...er/resourceproviders/getresourceprovidersummary.go 23.52% 39 Missing ⚠️
...d/controller/resourceproviders/resourcetype_put.go 29.03% 21 Missing and 1 partial ⚠️
.../controller/resourceproviders/apiversion_delete.go 43.47% 12 Missing and 1 partial ⚠️
...g/ucp/backend/controller/resourceproviders/util.go 70.45% 6 Missing and 7 partials ⚠️
...end/controller/resourceproviders/apiversion_put.go 50.00% 10 Missing and 2 partials ⚠️
pkg/armrpc/frontend/server/handler.go 0.00% 11 Missing ⚠️
...nd/controller/resourceproviders/location_delete.go 31.25% 11 Missing ⚠️
... and 21 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7967      +/-   ##
==========================================
- Coverage   60.63%   60.36%   -0.27%     
==========================================
  Files         534      560      +26     
  Lines       28484    29417     +933     
==========================================
+ Hits        17271    17759     +488     
- Misses       9697    10112     +415     
- Partials     1516     1546      +30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rynowak rynowak force-pushed the udt-registration branch 2 times, most recently from d0a412a to d154add Compare October 7, 2024 23:21
@rynowak
Copy link
Contributor Author

rynowak commented Oct 7, 2024

@kachawla @lakshmimsft @sk593 - updated.

Big updates:

  • Adding API examples
  • Refactor backend controllers and add unit tests

@radius-functional-tests
Copy link

radius-functional-tests bot commented Oct 8, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository rynowak/radius
Commit ref 9f09698
Unique ID func895ebfe9d9
Image tag pr-func895ebfe9d9
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func895ebfe9d9
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func895ebfe9d9
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func895ebfe9d9
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func895ebfe9d9
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

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-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
⌛ Starting datastoresrp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded
✅ datastoresrp-cloud functional tests succeeded

Copy link
Contributor

@sk593 sk593 left a comment

Choose a reason for hiding this comment

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

very cool changes. lgtm 🚀

This change implements the API functionality for registering resource providers and related child-types through the Radius API. This is the first step towards making the Radius API surface extensible. For this first step there is no consumer of this data or these APIs. Subsequent changes will consume the data and implement the user-facing functionality.

What's possible in this commit:

- CRUDL operations on resource provider and related types like:
  - resource type
  - api version (child of resource type)
  - location

Additionally, this change implements the resource provider "summary" API. The summary API provides a combined view of the most useful data from each resource provider and its children.

---

For reviewers there are a few important notes:

- Routing in UCP is complex, and error prone to work on. I abandoned the existing code and rewrote it in a form that's more native to go-chi. This was a significant improvement and made it much easier to debug the code. UCP has good integration tests so I'm not very concerned about regressions.
- This is our first use-case for child resources in Radius. I used the async controllers to implement cascading deletion.
- The "summary" API uses cached data. The async controllers for resource provider and other types update the cache. This is our first use of this pattern, but it felt right to me.

Signed-off-by: Ryan Nowak <[email protected]>
@rynowak
Copy link
Contributor Author

rynowak commented Oct 9, 2024

@lakshmimsft updated

@radius-functional-tests
Copy link

radius-functional-tests bot commented Oct 9, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository rynowak/radius
Commit ref 001dbf7
Unique ID func780def88d1
Image tag pr-func780def88d1
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func780def88d1
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func780def88d1
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func780def88d1
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func780def88d1
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

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 datastoresrp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ datastoresrp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@rynowak rynowak merged commit 9a9a4d2 into radius-project:main Oct 9, 2024
28 checks passed
@rynowak rynowak deleted the udt-registration branch October 9, 2024 17:12
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.

5 participants