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

Add recipe support to dynamic RP #8191

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rynowak
Copy link
Contributor

@rynowak rynowak commented Jan 6, 2025

Description

This change implements recipe support for the dynamic RP. With this feature, a user-defined-type can declare the SupportsRecipes capability, and then it will be processed by the recipe engine.

The main change here is to the core datamodel interfaces used by our shared controllers. These interfaces have some problematic definitions that rely on returning pointers to go-structs so they can be mutated and saved to the database. This general approach does not work for UDT, or any other design besides the portable resources.

To understand this problem in more detail, consider that ".properties.status" is user-defined for a UDT. The existing interfaces assume that all resources have the same go struct at ".properties.status". Because UDT is extensible, we cannot write a single go-struct that captures all possible status values, but that's required by the current interfaces. Clearly we need something more flexible.

I took the approach of making minimal changes in this PR, but we should improve the design longer-term.

Type of change

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

Part of: #6688

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
  • A design document PR is created in the design-notes repository, if new APIs are being introduced.
  • If applicable, design document has been reviewed and approved by Radius maintainers/approvers.
  • A PR for the samples repository is created, if existing samples are affected by the changes in this PR.
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
  • A PR for the recipes repository is created, if existing recipes are affected by the changes in this PR.

This change implements recipe support fo the dynamic RP. With this feature, a user-defined-type can declare the SupportsRecipes capability, and then it will be processed by the recipe engine.

The main change here is to the core datamodel interfaces used by our shared controllers. These interfaces have some problematic definitions that rely on returning pointers to go-structs so they can be mutated and saved to the database. This general approach does not work for UDT, or any other design besides the portable resources.

To understand this problem in more detail, consider that ".properties.status" is user-defined for a UDT. The existing interfaces assume that all resources have the same go struct at ".properties.status". Because UDT is extensible, we cannot write a single go-struct that captures all possible status values, but that's required by the current interfaces. Clearly we need something more flexible.

I took the approach of making minimal changes in this PR, but we should improve the design longer-term.

Signed-off-by: Ryan Nowak <[email protected]>
@rynowak rynowak requested review from a team as code owners January 6, 2025 00:16
@rynowak
Copy link
Contributor Author

rynowak commented Jan 6, 2025

/cc @lakshmimsft - this is still like 2% in progress. I have a few test regressions to chase down. I think I made a few small mistakes in the refactor that broke non-UDT tests.

@rynowak rynowak temporarily deployed to functional-tests January 6, 2025 02:00 — with GitHub Actions Inactive
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 6, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository rynowak/radius
Commit ref f9c85b5
Unique ID func5986431538
Image tag pr-func5986431538
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • 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-func5986431538
  • 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-func5986431538
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func5986431538
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func5986431538
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func5986431538
  • 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 ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
❌ corerp-cloud functional test failed. Please check the logs for more details

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.

1 participant