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

Support AppGraph connection for direct route #7063

Closed
wants to merge 13 commits into from
Closed

Support AppGraph connection for direct route #7063

wants to merge 13 commits into from

Conversation

youngbupark
Copy link

@youngbupark youngbupark commented Jan 22, 2024

Description

  • Fixed the possible nil panicking issues with to package
  • Handled http connection source without httproute
  • Refactored test code

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

Fixes: #7004 #6937

Signed-off-by: Young Bu Park <youngp@microsoft.com>
@youngbupark youngbupark requested review from a team as code owners January 22, 2024 16:47
Name: &appName,
Type: &appType,
ProvisioningState: &provisioningState,
return &corerpv20231001preview.ApplicationGraphResource{
Copy link
Author

Choose a reason for hiding this comment

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

I understand that input resource can be version-specific. Ideally, the appgraph's response needs to be version agnostic datamodel. @nithyatsu is there any reason why we use the version-specific response here ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally the app graph API would follow the same versioning principles we have for other APIs 👍

I think we just didn't think about versioning since it was the first one, but the idea makes sense.

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 22, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository youngbupark/radius
Commit ref 590e100
Unique ID b081cd7d20
Image tag pr-b081cd7d20
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/functional/shared/recipes/<name>:pr-b081cd7d20
  • 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-b081cd7d20
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-b081cd7d20
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-b081cd7d20
  • 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 daprrp functional tests...
⌛ Starting msgrp functional tests...
⌛ Starting ucp functional tests...
⌛ Starting kubernetes functional tests...
⌛ Starting shared functional tests...
⌛ Starting datastoresrp functional tests...
⌛ Starting samples functional tests...
✅ msgrp functional tests succeeded
✅ kubernetes functional tests succeeded
✅ ucp functional tests succeeded
✅ samples functional tests succeeded
✅ daprrp functional tests succeeded
✅ datastoresrp functional tests succeeded
✅ shared functional tests succeeded

}

sourceID := strings.Join([]string{parentIDParsed.RootScope(), resources.ProvidersSegment, parentIDParsed.Type(), sourceURL.Hostname()}, resources.SegmentSeparator)
return sourceID, true
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this assume that the resource being connected to is in the same scope? So if I use multiple resource groups this will fall a part?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, what if I have a connection to something outside of Radius? eg: http://example.com.

Copy link
Author

Choose a reason for hiding this comment

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

I thought that we would support only <scheme>://<resourcename> format for connection, so the parser is designed for the case. To support the external endpoint, I would modify the connection format like below:

"connections": [
    {
        "direction": "Inbound | Outbound",
        // "id": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/backendapp"
         "target": "/planes/radius/local/resourcegroups/default/providers/Applications.Core/containers/backendapp"
         "type": "Resource | URL"
    }
],

instead of having id, we can have target and type (or something else) to define connection. Putting url on id field doesn't seem right.

cc/ @nithyatsu @rynowak

Copy link
Contributor

Choose a reason for hiding this comment

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

Design doc for the features that connections support are here: #6375 @nithyatsu is the best resource for what parts of this have been implemented so far.

I don't think we discussed yet how an "external" URL should be represented in the app graph API, so I'm open to suggestions.

I want to make sure that we can represent a connection from container a -> container b and translate from URL -> resource ID in the app graph. The design for service-discovery was chosen to a support this.

Copy link
Author

Choose a reason for hiding this comment

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

I found the bug. The following direction must be OutBound.

dir := corerpv20231001preview.DirectionInbound

@nithyatsu @rynowak Please review the new testdata to see if each resource connection has the right direction.

Signed-off-by: Young Bu Park <youngp@microsoft.com>
Signed-off-by: Young Bu Park <youngp@microsoft.com>
Signed-off-by: Young Bu Park <youngp@microsoft.com>
@@ -493,25 +487,60 @@ func connectionsFromAPIData(resource generated.GenericResource) []*corerpv202310
// If we encounter an error processing this data, just skip "invalid" connection entry.
entries := []*corerpv20231001preview.ApplicationGraphConnection{}
for _, connection := range connections {
dir := corerpv20231001preview.DirectionInbound
dir := corerpv20231001preview.DirectionOutbound
Copy link
Author

@youngbupark youngbupark Jan 24, 2024

Choose a reason for hiding this comment

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

@nithyatsu @rynowak I think this must be Outbound because this function resolves outbound connection.

Copy link
Author

Choose a reason for hiding this comment

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

functional test is failing duplicated connections.

{
            "connections": [
                {
                    "direction": "Inbound",
                    "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/containers/http-front-ctnr-simple1"
                },
                // DUPE. this route should be backend container only. 
                {
                    "direction": "Inbound",
                    "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/containers/http-front-ctnr-simple1"
                }
            ],
            "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/httpRoutes/http-back-rte-simple1",
            "name": "http-back-rte-simple1",
            "outputResources": [
                {
                    "id": "/planes/kubernetes/local/namespaces/default-corerp-application-simple1/providers/core/Service/http-back-rte-simple1",
                    "name": "http-back-rte-simple1",
                    "type": "core/Service"
                }
            ],
            "provisioningState": "Succeeded",
            "type": "Applications.Core/httpRoutes"
        }

@youngbupark youngbupark changed the title [WIP] Support appgraph without httproute Support AppGraph connection for direct route Jan 24, 2024
Signed-off-by: Young Bu Park <youngp@microsoft.com>
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 24, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository youngbupark/radius
Commit ref f601cb5
Unique ID 79a39de61c
Image tag pr-79a39de61c
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/functional/shared/recipes/<name>:pr-79a39de61c
  • 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-79a39de61c
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-79a39de61c
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-79a39de61c
  • 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 samples functional tests...
⌛ Starting shared functional tests...
⌛ Starting kubernetes functional tests...
⌛ Starting ucp functional tests...
⌛ Starting daprrp functional tests...
⌛ Starting datastoresrp functional tests...
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
✅ kubernetes functional tests succeeded
✅ msgrp functional tests succeeded
✅ datastoresrp functional tests succeeded
✅ daprrp functional tests succeeded
❌ shared functional test failed. Please check the logs for more details

Signed-off-by: Young Bu Park <youngp@microsoft.com>
Signed-off-by: Young Bu Park <youngp@microsoft.com>
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 24, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository youngbupark/radius
Commit ref 4dbcefc
Unique ID e503a5962e
Image tag pr-e503a5962e
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/functional/shared/recipes/<name>:pr-e503a5962e
  • 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-e503a5962e
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-e503a5962e
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-e503a5962e
  • 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 kubernetes functional tests...
⌛ Starting samples functional tests...
⌛ Starting daprrp functional tests...
⌛ Starting ucp functional tests...
✅ kubernetes functional tests succeeded
✅ datastoresrp functional tests succeeded
✅ daprrp functional tests succeeded
✅ msgrp functional tests succeeded
✅ samples functional tests succeeded
✅ ucp functional tests succeeded
❌ shared functional test failed. Please check the logs for more details

Signed-off-by: Young Bu Park <youngp@microsoft.com>
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 24, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository youngbupark/radius
Commit ref f43ef05
Unique ID 6e789ef2ec
Image tag pr-6e789ef2ec
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/functional/shared/recipes/<name>:pr-6e789ef2ec
  • 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-6e789ef2ec
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-6e789ef2ec
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-6e789ef2ec
  • 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 shared functional tests...
⌛ Starting datastoresrp functional tests...
⌛ Starting msgrp functional tests...
⌛ Starting kubernetes functional tests...
⌛ Starting daprrp functional tests...
⌛ Starting samples functional tests...
⌛ Starting ucp functional tests...
✅ kubernetes functional tests succeeded
✅ msgrp functional tests succeeded
✅ samples functional tests succeeded
✅ datastoresrp functional tests succeeded
✅ daprrp functional tests succeeded
❌ shared functional test failed. Please check the logs for more details
❌ ucp functional test cancelled. Please check the logs for more details

Signed-off-by: Young Bu Park <youngp@microsoft.com>
Signed-off-by: Young Bu Park <youngp@microsoft.com>
@youngbupark
Copy link
Author

closed by #7072

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.

Panic while getting application graph
4 participants