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

User-Defined Resource Types #6688

Open
Tracked by #14
AaronCrawfis opened this issue Nov 10, 2023 · 3 comments
Open
Tracked by #14

User-Defined Resource Types #6688

AaronCrawfis opened this issue Nov 10, 2023 · 3 comments
Labels
feature This issue describes a feature request in Radius triaged This issue has been reviewed and triaged

Comments

@AaronCrawfis
Copy link
Contributor

AaronCrawfis commented Nov 10, 2023

Overview of feature request

Today, there are a fixed set of portable Radius resources:

  • Applications.Dapr/stateStores
  • Applications.Dapr/pubSubBrokers
  • Applications.Datastores/redisCaches
  • Applications.Datastores/sqlDatabases
  • ...

These resources have a fixed schema and it allows teams to only select from a pre-defined list.

What's missing is a way for a team at an organization like Contoso to model their own schema and abstractions to work with.

For example, Contoso may want a resource type like:

resource storage 'Contoso.Storage/database' = {
  name: 'inventory'
  properties: {...}
}

This would allow developers to select from resource types that are custom to Contoso. This also doesn't have to be limited to storage/messaging resources. Custom types could also encapsulate entire services or dependencies such as:

resource storage 'Contoso.Monitoring/diagnostics' = {
  name: 'inventory'
  properties: {...}
}

Acceptance criteria

  • Users can define their own types + schema
  • These resources can be modeled in Bicep, acting as a key/value store for the properties
  • Recipes should work with the resources, allowing IT operators to define Recipe templates that spin up the actual backing infrastructure.

Additional context

AB#10284

Tasks

No tasks being tracked yet.
@AaronCrawfis AaronCrawfis added the feature This issue describes a feature request in Radius label Nov 10, 2023
@radius-triage-bot
Copy link

👋 @AaronCrawfis Thanks for filing this feature request.

A project maintainer will review this feature request and get back to you soon.

We also welcome community contributions! If you would like to pick this item up sooner and submit a pull request, please visit our contribution guidelines and assign this to yourself by commenting "/assign" on this issue.

For more information on our triage process please visit our triage overview

@nicolejms nicolejms added the triaged This issue has been reviewed and triaged label Nov 13, 2023
@radius-triage-bot
Copy link

👍 We've reviewed this issue and have agreed to add it to our backlog. Please subscribe to this issue for notifications, we'll provide updates when we pick it up.

We also welcome community contributions! If you would like to pick this item up sooner and submit a pull request, please visit our contribution guidelines and assign this to yourself by commenting "/assign" on this issue.

For more information on our triage process please visit our triage overview

@nicolejms
Copy link
Contributor

on the roadmap. keeping in backlog

@AaronCrawfis AaronCrawfis changed the title Custom Resource Types User-Defined Resource Types Nov 13, 2023
rynowak added a commit that referenced this issue Jun 19, 2024
# Description

This change implements the skeleton of user-defined types. The changes
here enable the following:

- Users can author a resource of type
`System.Resources/resourceProviders` to create a user-defined-type.
- Users can use the UCP API to register and query `resourceProviders`.
- Users can use the UCP API to execute the full lifecycle of a
user-defined-type.

Right now the user-defined-type RP will use our default operation
(synchronous) controllers to implement the resource lifecycle. There is
no background processing.

The next step will include the ability to execute asynchronous
operations like recipes.

## 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).


Part of: #6688 

## Feature Branch

**note: This change is going into a feature-branch where we can iterate
on the user-defined-type design before integrating it with main. The PR
is an FYI 😆.**

---------

Signed-off-by: ytimocin <ytimocin@microsoft.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: willdavsmith <willdavsmith@gmail.com>
Signed-off-by: Ryan Nowak <nowakra@gmail.com>
Co-authored-by: Yetkin Timocin <ytimocin@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Will Smith <willdavsmith@gmail.com>
rynowak added a commit that referenced this issue Jun 19, 2024
This change implements the skeleton of user-defined types. The changes
here enable the following:

- Users can author a resource of type
`System.Resources/resourceProviders` to create a user-defined-type.
- Users can use the UCP API to register and query `resourceProviders`.
- Users can use the UCP API to execute the full lifecycle of a
user-defined-type.

Right now the user-defined-type RP will use our default operation
(synchronous) controllers to implement the resource lifecycle. There is
no background processing.

The next step will include the ability to execute asynchronous
operations like recipes.

- 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).

Part of: #6688

**note: This change is going into a feature-branch where we can iterate
on the user-defined-type design before integrating it with main. The PR
is an FYI 😆.**

---------

Signed-off-by: ytimocin <ytimocin@microsoft.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: willdavsmith <willdavsmith@gmail.com>
Signed-off-by: Ryan Nowak <nowakra@gmail.com>
Co-authored-by: Yetkin Timocin <ytimocin@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Will Smith <willdavsmith@gmail.com>
rynowak added a commit that referenced this issue Jun 20, 2024
# Description

This commit adds new commands and capabilities for working with
user-defined-types in the CLI.

Some new commands:

- `rad resourceprovider *`: CRUDL lifecycle management for a resource
provider.
- `rad resourceprovider new`: Scaffolding a template for a resource
provider.
- `rad resourcetype [show|list]`: RL lifecycle management for resource
types (read-only).
- `rad resource create`: CU lifecycle management for any resource type.

Also updated `rad resource delete` and similar commands to work with
user-defined-types. Many commands validate a fixed list of resource
types, this update allows commands to work with an arbitrary resource
type.

## Type of change

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


Part of: #6688

Signed-off-by: Ryan Nowak <nowakra@gmail.com>
rynowak added a commit that referenced this issue Jun 24, 2024
This change implements the skeleton of user-defined types. The changes
here enable the following:

- Users can author a resource of type
`System.Resources/resourceProviders` to create a user-defined-type.
- Users can use the UCP API to register and query `resourceProviders`.
- Users can use the UCP API to execute the full lifecycle of a
user-defined-type.

Right now the user-defined-type RP will use our default operation
(synchronous) controllers to implement the resource lifecycle. There is
no background processing.

The next step will include the ability to execute asynchronous
operations like recipes.

- 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).

Part of: #6688

**note: This change is going into a feature-branch where we can iterate
on the user-defined-type design before integrating it with main. The PR
is an FYI 😆.**

---------

Signed-off-by: ytimocin <ytimocin@microsoft.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: willdavsmith <willdavsmith@gmail.com>
Signed-off-by: Ryan Nowak <nowakra@gmail.com>
Co-authored-by: Yetkin Timocin <ytimocin@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Will Smith <willdavsmith@gmail.com>
rynowak added a commit that referenced this issue Jun 24, 2024
# Description

This commit adds new commands and capabilities for working with
user-defined-types in the CLI.

Some new commands:

- `rad resourceprovider *`: CRUDL lifecycle management for a resource
provider.
- `rad resourceprovider new`: Scaffolding a template for a resource
provider.
- `rad resourcetype [show|list]`: RL lifecycle management for resource
types (read-only).
- `rad resource create`: CU lifecycle management for any resource type.

Also updated `rad resource delete` and similar commands to work with
user-defined-types. Many commands validate a fixed list of resource
types, this update allows commands to work with an arbitrary resource
type.

## Type of change

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


Part of: #6688

Signed-off-by: Ryan Nowak <nowakra@gmail.com>
rynowak added a commit that referenced this issue Jun 25, 2024
This change implements the skeleton of user-defined types. The changes
here enable the following:

- Users can author a resource of type
`System.Resources/resourceProviders` to create a user-defined-type.
- Users can use the UCP API to register and query `resourceProviders`.
- Users can use the UCP API to execute the full lifecycle of a
user-defined-type.

Right now the user-defined-type RP will use our default operation
(synchronous) controllers to implement the resource lifecycle. There is
no background processing.

The next step will include the ability to execute asynchronous
operations like recipes.

- 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).

Part of: #6688

**note: This change is going into a feature-branch where we can iterate
on the user-defined-type design before integrating it with main. The PR
is an FYI 😆.**

---------

Signed-off-by: ytimocin <ytimocin@microsoft.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: willdavsmith <willdavsmith@gmail.com>
Signed-off-by: Ryan Nowak <nowakra@gmail.com>
Co-authored-by: Yetkin Timocin <ytimocin@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Will Smith <willdavsmith@gmail.com>
Signed-off-by: Ryan Nowak <nowakra@gmail.com>
rynowak added a commit that referenced this issue Jun 25, 2024
This commit adds new commands and capabilities for working with
user-defined-types in the CLI.

Some new commands:

- `rad resourceprovider *`: CRUDL lifecycle management for a resource
provider.
- `rad resourceprovider new`: Scaffolding a template for a resource
provider.
- `rad resourcetype [show|list]`: RL lifecycle management for resource
types (read-only).
- `rad resource create`: CU lifecycle management for any resource type.

Also updated `rad resource delete` and similar commands to work with
user-defined-types. Many commands validate a fixed list of resource
types, this update allows commands to work with an arbitrary resource
type.

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

Part of: #6688

Signed-off-by: Ryan Nowak <nowakra@gmail.com>
rynowak added a commit that referenced this issue Oct 9, 2024
…7967)

# 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

Signed-off-by: Ryan Nowak <nowakra@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue describes a feature request in Radius triaged This issue has been reviewed and triaged
Projects
None yet
Development

No branches or pull requests

2 participants