Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement tracked resources (radius-project#6204)
# Description This change implements 'tracked' resources for for every resource created in the Radius plane. This means that UCP will observe each operation and maintain its own state for the lifecycle of each resource. The purpose of this is to power multiple other pieces of infrastructure. New in this pull-request it's possible to list the resources (of all types) in a resource group. This is served from the 'tracked' resources maintained by UCP and does not need to query all resource providers or their databases. Future changes will implement cascading deletion for resource groups as well as notifications for resource modifications. ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). - This pull request adds or changes features of Radius and has an approved issue (issue link required). ## Auto-generated summary <!-- GitHub Copilot for docs will auto-generate a summary of the PR --> <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at 969afb9</samp> ### Summary 📝🌐🔄 <!-- 1. 📝 - This emoji represents the addition of comments, documentation, and test fixtures, which are all related to writing and explaining the code. 2. 🌐 - This emoji represents the addition of the `location` field, which is related to the global scope and distribution of the UCP service. 3. 🔄 - This emoji represents the addition of conversion functions, serialization and deserialization methods, and async operation controllers, which are all related to transforming and processing data. --> This pull request adds support for generic and proxy resources in the UCP service. It introduces a new `GenericResource` type in the UCP API and datamodel packages, and implements the conversion, serialization, and client functions for it. It also adds a new `Resources` group to the UCP API, which allows listing and querying resources in UCP. It updates the UCP backend service and controller to use the new resource type and operation method for tracked resources. It adds unit tests, documentation, and configuration settings for the new features. It also improves the logging and error handling of async operations, and removes some unused dependencies. > _Sing, O Muse, of the mighty deeds of the UCP service_ > _That tracks and lists the myriad resources in the cloud_ > _And how the skillful coders added new fields and types_ > _To make the `GenericResource` more versatile and proud_ ### Walkthrough * Add a new `GenericResource` type and its conversion functions to support storing and listing resources in UCP regardless of their actual type ([link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-f2d1781ff7fc84fff544f3a071c4bad77c26a30777d6d95f39cbd49ee16b6ba7R1-R49), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-f845c7096c463030307454c370c23460c9a806f229fe959e226cc9e81222ad70R1-R73), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-893ab293df1ca8739cc792cd8e8c5c5691cb0a308cec7f4ef2f06ecce4019761L1-R21), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-6f7e7aae5544d15eeb60fd6452c8cdcdd56c68c1c6c5a9910511ef0aef14aa77R170-R188), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-6f7e7aae5544d15eeb60fd6452c8cdcdd56c68c1c6c5a9910511ef0aef14aa77R232-R258), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-6f300088351b430ca2464beef84ad3069228f02d95a3dcd3641926ad1c2620fbR387-R429), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-6f300088351b430ca2464beef84ad3069228f02d95a3dcd3641926ad1c2620fbR558-R631), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-4f5a8ccf4f4002068030786c91856b61579168b6c60a91b815f6d525552bf907R1-R47), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-c71c1646c3c381abc13b22a43803aadd6725bdc1b956f957452fa0955032a723R1-R86)) * Add a new `Resources` group and its client to the UCP API, which contains the methods for listing and querying resources in UCP ([link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-df683afb7070d6ba64f3b2a742db37199c9827b9ba03cc95b48777ad2e601644R57-R61), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-416356e403db5b572d2c0f372baef2abfeb3000363efc6d41f55bdc65f47ebafR121-R125), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-a0503cdfd9eb8e97f731ed907b35daf38dde994f995701b0fd69ca1699883adfR1-R108), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-c74c23d29da9a5ac2ea4388c4cfd23f42018e45c93a29f71c4c5eeadebdfa4c6R132-R137)) * Add a new `TrackedResourceProcessController` type and its tests to the UCP backend, which performs background processing on tracked resources ([link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-58df6e92977a97ec7d0156ae7e0dafc869190c32b82b448d3e684ad7586170bfR1-R94), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-f966a886f9d05281b158e9739ff6c1e1e0bffe560230e7d5d8305dbedef6e309R1-R180), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-8aded038840f1f8802bdb81f53055a340da414b4d53a57b2af19bc6463599388L68-R93)) * Update the `UCPProviderName` constant to `System.Resources` to align with the new resource type for tracked resources ([link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-8aded038840f1f8802bdb81f53055a340da414b4d53a57b2af19bc6463599388L23-R33)) * Add some logging and error handling to the `updateResourceAndOperationStatus` function in the `worker.go` file, which updates the resource and operation status in the storage ([link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-5d9b9964242d77606f4868e3fe049978ea1c3f1903afcfeb60c76e19d9785fc5R254-R261), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-5d9b9964242d77606f4868e3fe049978ea1c3f1903afcfeb60c76e19d9785fc5L350-R360)) * Add a comment to the `generate-openapi-spec` target in the `Makefile` to describe its purpose ([link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-cc76a2a14994ce1ed06bd12ba9665a1d20a17992f345a7f8ca06afc934da2a92L35-R35)) * Add a new field `location` to the UCP service configuration and deployment files, and document its meaning ([link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-ceba0600c7e49ffd65b0a2fd7bf1798d9f6f6f531db64e051bb00ff29c7dcd93R12), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-be9c0b61a26165c87503e667cec005520aea94da66f0dd1eedfff863efd266acR13), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-c5a6e900bac29ec26476b731e62862ee9afb8f9f67225da0aa8fd1d052f8183fR220)) * Remove some unused dependencies and imports from the `go.mod` and `worker.go` files ([link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6L14), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6L70), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R99), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6L107), [link](https://github.com/radius-project/radius/pull/6204/files?diff=unified&w=0#diff-5d9b9964242d77606f4868e3fe049978ea1c3f1903afcfeb60c76e19d9785fc5L24)) Signed-off-by: ytimocin <ytimocin@microsoft.com> Signed-off-by: Ryan Nowak <nowakra@gmail.com> Co-authored-by: Yetkin Timocin <ytimocin@microsoft.com>
- Loading branch information