From b98b1190f451ccd5b42fc22ab20034c8c9dae912 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 20:13:21 +0000 Subject: [PATCH 1/4] Initial plan From 92813b197de43484691e897f10a1dc5156d6147a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 20:20:02 +0000 Subject: [PATCH 2/4] Add Bicep template and test for application graph with container, Redis, and volume Co-authored-by: nicolejms <101607760+nicolejms@users.noreply.github.com> --- .../noncloud/resources/application_test.go | 103 ++++++++++++++++++ ...erp-resources-container-redis-volume.bicep | 98 +++++++++++++++++ 2 files changed, 201 insertions(+) create mode 100644 test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume.bicep diff --git a/test/functional-portable/corerp/noncloud/resources/application_test.go b/test/functional-portable/corerp/noncloud/resources/application_test.go index 211374e61d..1772163379 100644 --- a/test/functional-portable/corerp/noncloud/resources/application_test.go +++ b/test/functional-portable/corerp/noncloud/resources/application_test.go @@ -135,3 +135,106 @@ func Test_ApplicationGraph(t *testing.T) { test.Test(t) } + +func Test_ApplicationGraphWithRedisAndVolume(t *testing.T) { + // Deploy an app with a container, redis cache (via recipe), and a volume + template := "testdata/corerp-resources-container-redis-volume.bicep" + name := "corerp-app-redis-volume" + appNamespace := "corerp-app-redis-volume-ns" + + test := rp.NewRPTest(t, name, []rp.TestStep{ + { + Executor: step.NewDeployExecutor( + template, + testutil.GetMagpieImage(), + testutil.GetBicepRecipeRegistry(), + testutil.GetBicepRecipeVersion(), + ), + RPResources: &validation.RPResourceSet{ + Resources: []validation.RPResource{ + { + Name: "corerp-app-redis-volume-env", + Type: validation.EnvironmentsResource, + }, + { + Name: name, + Type: validation.ApplicationsResource, + }, + { + Name: "redis-app-container", + Type: validation.ContainersResource, + App: name, + }, + { + Name: "redis-cache", + Type: validation.ExtendersResource, + App: name, + }, + }, + }, + K8sObjects: &validation.K8sObjectSet{ + Namespaces: map[string][]validation.K8sObject{ + appNamespace: { + validation.NewK8sPodForResource(name, "redis-app-container"), + validation.NewK8sServiceForResource(name, "redis-app-container").ValidateLabels(false), + }, + }, + }, + PostStepVerify: func(ctx context.Context, t *testing.T, ct rp.RPTest) { + // Verify the application graph + options := rp.NewRPTestOptions(t) + client := options.ManagementClient + require.IsType(t, client, &clients.UCPApplicationsManagementClient{}) + + appManagementClient := client.(*clients.UCPApplicationsManagementClient) + appGraphClient, err := v20231001preview.NewApplicationsClient(appManagementClient.RootScope, &aztoken.AnonymousCredential{}, appManagementClient.ClientOptions) + require.NoError(t, err) + + res, err := appGraphClient.GetGraph(ctx, name, map[string]any{}, nil) + require.NoError(t, err) + + // Verify that the graph contains the expected resources + require.NotEmpty(t, res.Resources) + t.Logf("Graph contains %d resources", len(res.Resources)) + + // Sort by name for consistent comparison + sort.Slice(res.Resources, func(i, j int) bool { + return *res.Resources[i].Name < *res.Resources[j].Name + }) + + // Log the graph structure for debugging + for _, resource := range res.Resources { + t.Logf("Resource: %s (%s)", *resource.Name, *resource.Type) + t.Logf(" Connections: %d", len(resource.Connections)) + for _, conn := range resource.Connections { + t.Logf(" - %s (%s)", *conn.ID, *conn.Direction) + } + t.Logf(" Output Resources: %d", len(resource.OutputResources)) + for _, out := range resource.OutputResources { + t.Logf(" - %s (%s)", *out.Name, *out.Type) + } + } + + // Verify specific resources exist in the graph + foundContainer := false + foundRedis := false + + for _, resource := range res.Resources { + if *resource.Name == "redis-app-container" && *resource.Type == "Applications.Core/containers" { + foundContainer = true + // Container should have a connection to redis + require.NotEmpty(t, resource.Connections, "Container should have connections") + } + if *resource.Name == "redis-cache" && *resource.Type == "Applications.Core/extenders" { + foundRedis = true + } + } + + require.True(t, foundContainer, "Container not found in graph") + require.True(t, foundRedis, "Redis cache not found in graph") + }, + }, + }) + + test.Test(t) +} diff --git a/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume.bicep b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume.bicep new file mode 100644 index 0000000000..1192bd8edd --- /dev/null +++ b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume.bicep @@ -0,0 +1,98 @@ +extension radius + +@description('Specifies the location for resources.') +param location string = 'local' + +@description('Specifies the image for the container resource.') +param magpieimage string + +@description('The OCI registry for test Bicep recipes.') +param registry string + +@description('The OCI tag for test Bicep recipes.') +param version string + +// Environment with Redis recipe configured +resource env 'Applications.Core/environments@2023-10-01-preview' = { + name: 'corerp-app-redis-volume-env' + location: location + properties: { + compute: { + kind: 'kubernetes' + resourceId: 'self' + namespace: 'corerp-app-redis-volume-env' + } + recipes: { + 'Applications.Core/extenders': { + default: { + templateKind: 'bicep' + templatePath: '${registry}/test/testrecipes/test-bicep-recipes/corerp-redis-recipe:${version}' + } + } + } + } +} + +resource app 'Applications.Core/applications@2023-10-01-preview' = { + name: 'corerp-app-redis-volume' + location: location + properties: { + environment: env.id + extensions: [ + { + kind: 'kubernetesNamespace' + namespace: 'corerp-app-redis-volume-ns' + } + ] + } +} + +// Container with ephemeral volume +resource container 'Applications.Core/containers@2023-10-01-preview' = { + name: 'redis-app-container' + location: location + properties: { + application: app.id + container: { + image: magpieimage + ports: { + web: { + containerPort: 3000 + } + } + readinessProbe: { + kind: 'httpGet' + containerPort: 3000 + path: '/healthz' + } + volumes: { + cache: { + kind: 'ephemeral' + managedStore: 'disk' + mountPath: '/var/cache' + } + } + } + connections: { + redis: { + source: redisCache.id + } + } + } +} + +// Redis cache using recipe +resource redisCache 'Applications.Core/extenders@2023-10-01-preview' = { + name: 'redis-cache' + location: location + properties: { + application: app.id + environment: env.id + recipe: { + name: 'default' + parameters: { + redisName: 'myredis' + } + } + } +} From 8724dd2932ee60f67df1f6da79212f9c3e6067a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 20:21:44 +0000 Subject: [PATCH 3/4] Add documentation and expected output for application graph example Co-authored-by: nicolejms <101607760+nicolejms@users.noreply.github.com> --- ...resources-container-redis-volume-README.md | 121 ++++++++++++++++++ ...es-container-redis-volume-graph-output.txt | 19 +++ ...esources-container-redis-volume-graph.json | 65 ++++++++++ 3 files changed, 205 insertions(+) create mode 100644 test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume-README.md create mode 100644 test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume-graph-output.txt create mode 100644 test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume-graph.json diff --git a/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume-README.md b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume-README.md new file mode 100644 index 0000000000..00cbee5ad1 --- /dev/null +++ b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume-README.md @@ -0,0 +1,121 @@ +# Application Graph Example: Container with Redis Cache and Volume + +This example demonstrates creating a Radius application that includes: +- A Kubernetes container +- A Redis cache (provisioned via a Bicep recipe) +- An ephemeral volume + +The example showcases how Radius creates an application graph that visualizes the relationships between these resources. + +## Architecture Diagram + +``` +┌─────────────────────────────────────────────────────┐ +│ Application: corerp-app-redis-volume │ +│ Namespace: corerp-app-redis-volume-ns │ +├─────────────────────────────────────────────────────┤ +│ │ +│ ┌─────────────────────────────────────────┐ │ +│ │ Container: redis-app-container │ │ +│ │ ──────────────────────────────────── │ │ +│ │ • Image: magpie │ │ +│ │ • Port: 3000 │ │ +│ │ • Readiness: /healthz │ │ +│ │ • Volume: /var/cache (ephemeral/disk) │ │ +│ └────────────┬────────────────────────────┘ │ +│ │ │ +│ │ Connection │ +│ │ (outbound) │ +│ ▼ │ +│ ┌─────────────────────────────────────────┐ │ +│ │ Redis Cache: redis-cache │ │ +│ │ ──────────────────────────────────── │ │ +│ │ • Provisioned via Recipe │ │ +│ │ • Recipe: corerp-redis-recipe │ │ +│ │ • Parameter: redisName=myredis │ │ +│ └─────────────────────────────────────────┘ │ +│ │ +└─────────────────────────────────────────────────────┘ + +Generated Kubernetes Resources: +├── Container Resources: +│ ├── Deployment/redis-app-container +│ ├── Service/redis-app-container +│ ├── ServiceAccount/redis-app-container +│ ├── Role/redis-app-container +│ └── RoleBinding/redis-app-container +└── Redis Resources (from recipe): + ├── Deployment/redis-cache + └── Service/redis-cache +``` + +## Files + +- **corerp-resources-container-redis-volume.bicep**: The main Bicep template that defines the application +- **Test_ApplicationGraphWithRedisAndVolume**: Go test function in `application_test.go` + +## Application Components + +### 1. Environment +The environment is configured with: +- Kubernetes compute (`kind: 'kubernetes'`) +- A Redis recipe from the test recipe registry (`corerp-redis-recipe`) + +### 2. Application +The application (`corerp-app-redis-volume`) includes: +- A custom Kubernetes namespace (`corerp-app-redis-volume-ns`) + +### 3. Container +The container (`redis-app-container`) features: +- A container image (magpie test image) +- Port 3000 exposed +- HTTP readiness probe on `/healthz` +- An ephemeral volume mounted at `/var/cache` (using disk storage) +- A connection to the Redis cache + +### 4. Redis Cache +The Redis cache (`redis-cache`) is provisioned via a recipe: +- Uses the `corerp-redis-recipe` from the test recipe registry +- Configured with a custom Redis name parameter + +## How to Deploy (when Radius is installed) + +```bash +# Deploy the application +rad deploy test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume.bicep \ + --parameters magpieimage= \ + --parameters registry= \ + --parameters version= +``` + +## Visualizing the Application Graph + +Once deployed, you can visualize the application graph using: + +```bash +# Show the application graph +rad app graph corerp-app-redis-volume +``` + +This will display: +1. **redis-app-container** (Applications.Core/containers) + - Connections: Outbound connection to redis-cache + - Resources: Kubernetes Deployment, Service, ServiceAccount, Role, RoleBinding + +2. **redis-cache** (Applications.Core/extenders) + - Resources: Provisioned by the Bicep recipe (e.g., Redis deployment, service) + +## Expected Graph Structure + +The application graph shows: +- The container has an **outbound connection** to the Redis cache +- Both resources generate Kubernetes resources (deployments, services, etc.) +- The volume is part of the container's configuration (not a separate graph node) + +## Testing + +The test validates: +- All resources are created successfully +- The application graph API returns the expected resources +- The container has a connection to Redis +- Both the container and Redis cache appear in the graph diff --git a/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume-graph-output.txt b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume-graph-output.txt new file mode 100644 index 0000000000..8b37e176b6 --- /dev/null +++ b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume-graph-output.txt @@ -0,0 +1,19 @@ +Displaying application: corerp-app-redis-volume + +Name: redis-app-container (Applications.Core/containers) +Connections: + redis-app-container -> redis-cache (Applications.Core/extenders) +Resources: + redis-app-container (apps/Deployment) + redis-app-container (core/Service) + redis-app-container (core/ServiceAccount) + redis-app-container (rbac.authorization.k8s.io/Role) + redis-app-container (rbac.authorization.k8s.io/RoleBinding) + +Name: redis-cache (Applications.Core/extenders) +Connections: + redis-app-container (Applications.Core/containers) -> redis-cache +Resources: + redis-cache (apps/Deployment) + redis-cache (core/Service) + diff --git a/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume-graph.json b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume-graph.json new file mode 100644 index 0000000000..7115b45a42 --- /dev/null +++ b/test/functional-portable/corerp/noncloud/resources/testdata/corerp-resources-container-redis-volume-graph.json @@ -0,0 +1,65 @@ +[ + { + "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/containers/redis-app-container", + "name": "redis-app-container", + "type": "Applications.Core/containers", + "provisioningState": "Succeeded", + "connections": [ + { + "direction": "Outbound", + "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/redis-cache" + } + ], + "outputResources": [ + { + "id": "/planes/kubernetes/local/namespaces/corerp-app-redis-volume-ns/providers/apps/Deployment/redis-app-container", + "name": "redis-app-container", + "type": "apps/Deployment" + }, + { + "id": "/planes/kubernetes/local/namespaces/corerp-app-redis-volume-ns/providers/core/Service/redis-app-container", + "name": "redis-app-container", + "type": "core/Service" + }, + { + "id": "/planes/kubernetes/local/namespaces/corerp-app-redis-volume-ns/providers/core/ServiceAccount/redis-app-container", + "name": "redis-app-container", + "type": "core/ServiceAccount" + }, + { + "id": "/planes/kubernetes/local/namespaces/corerp-app-redis-volume-ns/providers/rbac.authorization.k8s.io/Role/redis-app-container", + "name": "redis-app-container", + "type": "rbac.authorization.k8s.io/Role" + }, + { + "id": "/planes/kubernetes/local/namespaces/corerp-app-redis-volume-ns/providers/rbac.authorization.k8s.io/RoleBinding/redis-app-container", + "name": "redis-app-container", + "type": "rbac.authorization.k8s.io/RoleBinding" + } + ] + }, + { + "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/redis-cache", + "name": "redis-cache", + "type": "Applications.Core/extenders", + "provisioningState": "Succeeded", + "connections": [ + { + "direction": "Inbound", + "id": "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/containers/redis-app-container" + } + ], + "outputResources": [ + { + "id": "/planes/kubernetes/local/namespaces/corerp-app-redis-volume-env/providers/apps/Deployment/redis-cache", + "name": "redis-cache", + "type": "apps/Deployment" + }, + { + "id": "/planes/kubernetes/local/namespaces/corerp-app-redis-volume-env/providers/core/Service/redis-cache", + "name": "redis-cache", + "type": "core/Service" + } + ] + } +] From cb8f87eb670e63bc608e2afceaf3d89f2fbfd92a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 Jan 2026 20:23:10 +0000 Subject: [PATCH 4/4] Add usage script and comprehensive summary documentation Co-authored-by: nicolejms <101607760+nicolejms@users.noreply.github.com> --- .../resources/testdata/EXAMPLE-SUMMARY.md | 183 ++++++++++++++++++ .../resources/testdata/example-usage.sh | 94 +++++++++ 2 files changed, 277 insertions(+) create mode 100644 test/functional-portable/corerp/noncloud/resources/testdata/EXAMPLE-SUMMARY.md create mode 100755 test/functional-portable/corerp/noncloud/resources/testdata/example-usage.sh diff --git a/test/functional-portable/corerp/noncloud/resources/testdata/EXAMPLE-SUMMARY.md b/test/functional-portable/corerp/noncloud/resources/testdata/EXAMPLE-SUMMARY.md new file mode 100644 index 0000000000..5c9ea1b595 --- /dev/null +++ b/test/functional-portable/corerp/noncloud/resources/testdata/EXAMPLE-SUMMARY.md @@ -0,0 +1,183 @@ +# Application Graph Visualization Example - Summary + +## Overview + +This implementation demonstrates building a Radius application definition that uses: +1. **Kubernetes Container** - Running the magpie test application +2. **Redis Cache** - Provisioned via a Bicep recipe from the test recipe registry +3. **Volume** - An ephemeral volume with disk storage + +The application definition generates a complete **application graph** that visualizes the relationships between these components. + +## What Was Created + +### 1. Application Definition (`corerp-resources-container-redis-volume.bicep`) + +A complete Bicep template that defines: +- **Environment** with Kubernetes compute and Redis recipe configuration +- **Application** with a custom namespace +- **Container** with: + - Image configuration (magpie test app) + - Port 3000 exposed with HTTP readiness probe + - Ephemeral volume mounted at `/var/cache` (disk-backed) + - Connection to the Redis cache +- **Redis Cache** (extender resource) provisioned via the `corerp-redis-recipe` + +### 2. Test Implementation (`application_test.go`) + +Added `Test_ApplicationGraphWithRedisAndVolume` which: +- Deploys the application using the Bicep template +- Verifies all resources are created (environment, app, container, Redis) +- Validates Kubernetes objects (pods, services, etc.) +- Tests the application graph API +- Verifies connections between resources +- Logs detailed graph structure for debugging + +### 3. Documentation Files + +#### README (`corerp-resources-container-redis-volume-README.md`) +- Architecture diagram showing component relationships +- Deployment instructions +- Graph visualization explanation +- Testing details + +#### Expected Graph Output (`corerp-resources-container-redis-volume-graph.json`) +JSON representation showing: +- Two main resources (container and Redis cache) +- Outbound connection from container to Redis +- Inbound connection to Redis from container +- Generated Kubernetes resources (deployments, services, RBAC) + +#### CLI Output Example (`corerp-resources-container-redis-volume-graph-output.txt`) +Text visualization showing how `rad app graph` displays the relationships: +``` +Name: redis-app-container (Applications.Core/containers) +Connections: + redis-app-container -> redis-cache (Applications.Core/extenders) +Resources: + redis-app-container (apps/Deployment) + [... other Kubernetes resources ...] + +Name: redis-cache (Applications.Core/extenders) +Connections: + redis-app-container (Applications.Core/containers) -> redis-cache +Resources: + redis-cache (apps/Deployment) + [... other Kubernetes resources ...] +``` + +#### Usage Script (`example-usage.sh`) +Step-by-step demonstration script showing: +1. How to deploy the application +2. How to verify the deployment +3. How to visualize the application graph +4. How to inspect Kubernetes resources +5. How to view resource connections +6. Cleanup instructions + +## Key Features Demonstrated + +### 1. Recipe Integration +- Environment configured with a Bicep recipe for Redis +- Recipe sourced from the test recipe registry +- Parameters passed to the recipe (redisName) + +### 2. Resource Connections +- Container explicitly connects to Redis via `connections` property +- Graph shows both outbound (from container) and inbound (to Redis) connections +- Demonstrates service-to-service relationships + +### 3. Volume Management +- Ephemeral volume with disk backing +- Mounted at `/var/cache` in the container +- Shows how Radius handles storage in containerized applications + +### 4. Application Graph Visualization +- Graph API returns structured data about resources and connections +- CLI command (`rad app graph`) provides human-readable visualization +- Test validates graph structure programmatically + +## How to Use + +### Prerequisites +- Radius installed and configured +- Kubernetes cluster available +- Access to the test recipe registry + +### Deployment +```bash +cd test/functional-portable/corerp/noncloud/resources/testdata/ +rad deploy corerp-resources-container-redis-volume.bicep \ + --parameters magpieimage= \ + --parameters registry= \ + --parameters version= +``` + +### Visualization +```bash +# View the application graph +rad app graph corerp-app-redis-volume + +# Expected output shows: +# - Container with outbound connection to Redis +# - Redis cache receiving inbound connection +# - All generated Kubernetes resources +``` + +### Testing +```bash +# Run the functional test +cd test/functional-portable/corerp/noncloud/resources/ +go test -run Test_ApplicationGraphWithRedisAndVolume -v +``` + +## Architecture + +``` +┌────────────────────────────────────────┐ +│ Radius Application │ +│ ┌──────────────┐ Connection │ +│ │ Container │ ─────────────┐ │ +│ │ + Volume │ ▼ │ +│ └──────────────┘ ┌──────────────┐ │ +│ │ Redis Cache │ │ +│ │ (via Recipe)│ │ +│ └──────────────┘ │ +└────────────────────────────────────────┘ + │ + ▼ +┌────────────────────────────────────────┐ +│ Generated Kubernetes Resources │ +│ • Deployments │ +│ • Services │ +│ • ServiceAccounts │ +│ • RBAC (Roles, RoleBindings) │ +└────────────────────────────────────────┘ +``` + +## Testing Strategy + +The test validates: +1. **Resource Creation**: All expected resources are created +2. **Kubernetes Objects**: Pods and services are deployed correctly +3. **Graph Structure**: Application graph API returns correct data +4. **Connections**: Container-to-Redis connection exists +5. **Resource Presence**: Both container and Redis appear in the graph + +## Value Demonstrated + +This example showcases how Radius: +1. **Simplifies Infrastructure**: Recipes abstract away Redis deployment complexity +2. **Visualizes Dependencies**: Graph shows how services relate to each other +3. **Manages Kubernetes**: Automatically generates and manages K8s resources +4. **Connects Services**: Declaratively expresses service dependencies +5. **Integrates Storage**: Seamlessly adds volumes to containerized applications + +## Future Enhancements + +Potential additions to this example: +- Add more complex volume types (persistent volumes, ConfigMaps) +- Include multiple containers with different connection patterns +- Add HTTP routes and gateways +- Demonstrate recipe parameters and outputs +- Show environment variable injection from recipe outputs diff --git a/test/functional-portable/corerp/noncloud/resources/testdata/example-usage.sh b/test/functional-portable/corerp/noncloud/resources/testdata/example-usage.sh new file mode 100755 index 0000000000..7fc688384d --- /dev/null +++ b/test/functional-portable/corerp/noncloud/resources/testdata/example-usage.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# Example script showing how to deploy and visualize the application graph +# This script is for demonstration purposes and requires Radius to be installed and configured + +set -e + +# Colors for output +GREEN='\033[0;32m' +BLUE='\033[0;34m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +echo -e "${BLUE}================================================${NC}" +echo -e "${BLUE}Radius Application Graph Example${NC}" +echo -e "${BLUE}Container + Redis Cache + Volume${NC}" +echo -e "${BLUE}================================================${NC}" +echo + +# Configuration +APP_NAME="corerp-app-redis-volume" +BICEP_FILE="corerp-resources-container-redis-volume.bicep" +NAMESPACE="corerp-app-redis-volume-ns" + +# Check if rad CLI is installed +if ! command -v rad &> /dev/null; then + echo -e "${YELLOW}Error: rad CLI not found. Please install Radius first.${NC}" + echo "Visit: https://docs.radapp.io/getting-started/" + exit 1 +fi + +echo -e "${GREEN}Step 1: Deploy the application${NC}" +echo "Deploying Bicep template: ${BICEP_FILE}" +echo + +# Deploy the application +# Note: Replace these parameters with actual values +rad deploy "${BICEP_FILE}" \ + --parameters magpieimage="ghcr.io/radius-project/magpiego:latest" \ + --parameters registry="ghcr.io/radius-project/dev" \ + --parameters version="latest" + +echo +echo -e "${GREEN}Step 2: Verify the deployment${NC}" +echo "Checking application status..." +echo + +# List the application +rad app show "${APP_NAME}" + +echo +echo -e "${GREEN}Step 3: Visualize the application graph${NC}" +echo "Generating application graph..." +echo + +# Show the application graph +rad app graph "${APP_NAME}" + +echo +echo -e "${GREEN}Step 4: Inspect Kubernetes resources${NC}" +echo "Listing resources in namespace: ${NAMESPACE}" +echo + +# List pods in the namespace +kubectl get pods -n "${NAMESPACE}" + +echo +echo -e "${GREEN}Step 5: Check connections${NC}" +echo "Viewing resource details..." +echo + +# Show container details +rad resource show containers redis-app-container -a "${APP_NAME}" + +echo +echo -e "${GREEN}Step 6: Inspect the Redis cache${NC}" +echo "Viewing Redis cache details..." +echo + +# Show Redis cache details +rad resource show extenders redis-cache -a "${APP_NAME}" + +echo +echo -e "${BLUE}================================================${NC}" +echo -e "${GREEN}✓ Application graph example complete!${NC}" +echo -e "${BLUE}================================================${NC}" +echo +echo "The application includes:" +echo " • A Kubernetes container (redis-app-container)" +echo " • A Redis cache (redis-cache) provisioned via recipe" +echo " • An ephemeral volume mounted at /var/cache" +echo " • A connection from the container to the Redis cache" +echo +echo "To clean up:" +echo " rad app delete ${APP_NAME}"