diff --git a/.github/actions/setup-rad-cli/action.yaml b/.github/actions/setup-rad-cli/action.yaml index 1f1054acd5..02623c9cb2 100644 --- a/.github/actions/setup-rad-cli/action.yaml +++ b/.github/actions/setup-rad-cli/action.yaml @@ -7,6 +7,7 @@ runs: uses: actions/setup-go@v5 with: go-version: ${{ env.GOVER }} + cache: false - name: Get Go Cache path shell: bash id: go-cache-paths diff --git a/.github/workflows/functional-test-cloud.yaml b/.github/workflows/functional-test-cloud.yaml index 7017dc7c11..a15b0c6e22 100644 --- a/.github/workflows/functional-test-cloud.yaml +++ b/.github/workflows/functional-test-cloud.yaml @@ -85,8 +85,6 @@ env: FUNCTIONAL_TEST_APP_ID: 425843 # Private Git repository where terraform module for testing is stored. TF_RECIPE_PRIVATE_GIT_SOURCE: "git::https://github.com/radius-project/terraform-private-modules//kubernetes-redis" - # The number of failed tests to report. - ISSUE_CREATE_THRESHOLD: 2 # bicep-types ACR url for uploading Radius Bicep types BICEP_TYPES_REGISTRY: 'biceptypes.azurecr.io' @@ -495,6 +493,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GOVER }} + cache: false - name: Get Go Cache path id: go-cache-paths @@ -549,7 +548,17 @@ jobs: - uses: azure/setup-helm@v4 with: version: ${{ env.HELM_VER }} + + # The role-to-assume is the role that the github action will assume to execute aws commands and + # construct cloud control client in test code. + - name: configure aws credentials using assumed role + uses: aws-actions/configure-aws-credentials@v4.0.2 + with: + role-to-assume: ${{ secrets.AWS_GH_ACTIONS_ROLE }} + role-session-name: GitHub_to_AWS_via_FederatedOIDC + aws-region: ${{ env.AWS_REGION }} + # create kind cluster with OIDC provider. - name: Create KinD cluster run: | curl -sSLo "kind" "https://github.com/kubernetes-sigs/kind/releases/download/${{ env.KIND_VER }}/kind-linux-amd64" @@ -632,7 +641,6 @@ jobs: append: true message: | :x: Test tool installation for ${{ matrix.name }} failed. Please check [the logs](${{ env.ACTION_LINK }}) for more details - - name: Install Radius run: | export PATH=$GITHUB_WORKSPACE/bin:$PATH @@ -646,8 +654,9 @@ jobs: --set controller.image=${{ env.CONTAINER_REGISTRY }}/controller,controller.tag=${{ env.REL_VERSION }} \ --set ucp.image=${{ env.CONTAINER_REGISTRY }}/ucpd,ucp.tag=${{ env.REL_VERSION }} \ --set de.image=${{ env.DE_IMAGE }},de.tag=${{ env.DE_TAG }} \ - --set global.azureWorkloadIdentity.enabled=true - + --set global.azureWorkloadIdentity.enabled=true \ + --set global.aws.irsa.enabled=true + echo "*** Create workspace, group and environment for test ***" rad workspace create kubernetes rad group create kind-radius @@ -666,9 +675,10 @@ jobs: echo "*** Configuring AWS provider ***" rad env update kind-radius --aws-region ${{ env.AWS_REGION }} --aws-account-id ${{ secrets.FUNCTEST_AWS_ACCOUNT_ID }} - rad credential register aws access-key \ - --access-key-id ${{ secrets.FUNCTEST_AWS_ACCESS_KEY_ID }} --secret-access-key ${{ secrets.FUNCTEST_AWS_SECRET_ACCESS_KEY }} - + + rad credential register aws irsa \ + --iam-role ${{ secrets.FUNC_TEST_RAD_IRSA_ROLE }} + - uses: marocchino/sticky-pull-request-comment@v2 if: failure() && env.PR_NUMBER != '' continue-on-error: true @@ -726,9 +736,8 @@ jobs: DOCKER_REGISTRY: ${{ env.CONTAINER_REGISTRY }} TEST_TIMEOUT: ${{ env.FUNCTIONALTEST_TIMEOUT }} RADIUS_CONTAINER_LOG_PATH: ${{ github.workspace }}/${{ env.RADIUS_CONTAINER_LOG_BASE }} - AWS_ACCESS_KEY_ID: ${{ secrets.FUNCTEST_AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.FUNCTEST_AWS_SECRET_ACCESS_KEY }} AWS_REGION: ${{ env.AWS_REGION }} + AWS_ACCOUNT_ID: ${{ secrets.FUNCTEST_AWS_ACCOUNT_ID }} RADIUS_SAMPLES_REPO_ROOT: ${{ github.workspace }}/samples # Test_MongoDB_Recipe_Parameters is using the following environment variable. INTEGRATION_TEST_RESOURCE_GROUP_NAME: ${{ env.AZURE_TEST_RESOURCE_GROUP }} @@ -884,33 +893,8 @@ jobs: runs-on: ubuntu-latest if: failure() && github.event_name == 'schedule' && github.repository == 'radius-project/radius' steps: - - name: Count recently failed tests - id: count_failures - uses: actions/github-script@v7 - with: - script: | - response = await github.rest.actions.listWorkflowRuns({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'functional-test-cloud.yaml', - event: 'schedule', - per_page: 10 - }); - - failureCount = 1; - for (const run of response.data.workflow_runs) { - if (run.conclusion === 'failure') { - failureCount++; - } else { - break; - } - } - return failureCount; - - name: Create failure issue for failing scheduled run uses: actions/github-script@v7 - # Only create an issue if there are (env.ISSUE_CREATE_THRESHOLD) failures of the recent tests. - if: steps.count_failures.outputs.result >= env.ISSUE_CREATE_THRESHOLD with: github-token: ${{ secrets.GH_RAD_CI_BOT_PAT }} script: | @@ -918,5 +902,5 @@ jobs: ...context.repo, title: `Scheduled functional test failed - Run ID: ${context.runId}`, labels: ['bug', 'test-failure'], - body: `## Bug information \n\nThis bug is generated automatically if the scheduled functional test fails at least ${process.env.ISSUE_CREATE_THRESHOLD} times in a row. The Radius functional test operates on a schedule of every 4 hours during weekdays and every 12 hours over the weekend. It's important to understand that the test may fail due to workflow infrastructure issues, like network problems, rather than the flakiness of the test itself. For the further investigation, please visit [here](${process.env.ACTION_LINK}).` + body: `## Bug information \n\nThis issue is automatically generated if the scheduled functional test fails. The Radius functional test operates on a schedule of every 4 hours during weekdays and every 12 hours over the weekend. It's important to understand that the test may fail due to workflow infrastructure issues, like network problems, rather than the flakiness of the test itself. For the further investigation, please visit [here](${process.env.ACTION_LINK}).` }) diff --git a/.github/workflows/functional-test-noncloud.yaml b/.github/workflows/functional-test-noncloud.yaml index 7560b7aa38..a0af5c4844 100644 --- a/.github/workflows/functional-test-noncloud.yaml +++ b/.github/workflows/functional-test-noncloud.yaml @@ -66,10 +66,6 @@ env: TF_RECIPE_MODULE_SERVER_URL: "http://tf-module-server.radius-test-tf-module-server.svc.cluster.local" # Private Git repository where terraform module for testing is stored. TF_RECIPE_PRIVATE_GIT_SOURCE: "git::https://github.com/radius-project/terraform-private-modules//kubernetes-redis" - - # The number of failed tests to report. - ISSUE_CREATE_THRESHOLD: 2 - # Local Docker registry name LOCAL_REGISTRY_NAME: "radius-registry" # Local Docker registry server @@ -183,6 +179,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GOVER }} + cache: false - name: Get Go Cache path id: go-cache-paths @@ -453,32 +450,8 @@ jobs: runs-on: ubuntu-latest if: failure() && github.event_name == 'schedule' && github.repository == 'radius-project/radius' steps: - - name: Count recently failed tests - id: count_failures - uses: actions/github-script@v7 - with: - script: | - response = await github.rest.actions.listWorkflowRuns({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'functional-test-noncloud.yaml', - event: 'schedule', - per_page: 10 - }); - - failureCount = 1; - for (const run of response.data.workflow_runs) { - if (run.conclusion === 'failure') { - failureCount++; - } else { - break; - } - } - return failureCount; - name: Create failure issue for failing scheduled run uses: actions/github-script@v7 - # Only create an issue if there are (env.ISSUE_CREATE_THRESHOLD) failures of the recent tests. - if: steps.count_failures.outputs.result >= env.ISSUE_CREATE_THRESHOLD with: github-token: ${{ secrets.GH_RAD_CI_BOT_PAT }} script: | @@ -486,5 +459,5 @@ jobs: ...context.repo, title: `Scheduled functional test (noncloud) failed - Run ID: ${context.runId}`, labels: ['bug', 'test-failure'], - body: `## Bug information \n\nThis bug is generated automatically if the scheduled functional test fails at least ${process.env.ISSUE_CREATE_THRESHOLD} times in a row. The Radius functional test operates on a schedule of every 4 hours during weekdays and every 12 hours over the weekend. It's important to understand that the test may fail due to workflow infrastructure issues, like network problems, rather than the flakiness of the test itself. For the further investigation, please visit [here](${process.env.ACTION_LINK}).` + body: `## Bug information \n\nThis issue is automatically generated if the scheduled functional test fails. The Radius functional test operates on a schedule of every 4 hours during weekdays and every 12 hours over the weekend. It's important to understand that the test may fail due to workflow infrastructure issues, like network problems, rather than the flakiness of the test itself. For the further investigation, please visit [here](${process.env.ACTION_LINK}).` }) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 93cc92fcdd..685ec57e1f 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -104,6 +104,7 @@ jobs: node-version: "22" - name: Run `make format-check` id: format-check + continue-on-error: true run: | make format-check - name: Check for formatting failures diff --git a/.github/workflows/long-running-azure.yaml b/.github/workflows/long-running-azure.yaml index ce30023e82..94f2e38cbe 100644 --- a/.github/workflows/long-running-azure.yaml +++ b/.github/workflows/long-running-azure.yaml @@ -95,9 +95,6 @@ env: # The current GitHub action link ACTION_LINK: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - # The number of failed tests to report. - ISSUE_CREATE_THRESHOLD: 2 - jobs: build: name: Build Radius for test @@ -522,32 +519,8 @@ jobs: runs-on: ubuntu-latest if: failure() && github.repository == 'radius-project/radius' && github.event_name == 'schedule' steps: - - name: Count recently failed tests - id: count_failures - uses: actions/github-script@v7 - with: - script: | - response = await github.rest.actions.listWorkflowRuns({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'long-running-azure.yaml', - event: 'schedule', - per_page: 10 - }); - - failureCount = 1; - for (const run of response.data.workflow_runs) { - if (run.conclusion === 'failure') { - failureCount++; - } else { - break; - } - } - return failureCount; - name: Create failure issue for failing long running test run uses: actions/github-script@v7 - # Only create an issue if there are (env.ISSUE_CREATE_THRESHOLD) failures of the recent tests. - if: steps.count_failures.outputs.result >= env.ISSUE_CREATE_THRESHOLD with: github-token: ${{ secrets.GH_RAD_CI_BOT_PAT }} script: | @@ -555,5 +528,5 @@ jobs: ...context.repo, title: `Scheduled long running test failed - Run ID: ${context.runId}`, labels: ['bug', 'test-failure'], - body: `## Bug information \n\nThis bug is generated automatically if the scheduled long running test fails at least ${process.env.ISSUE_CREATE_THRESHOLD} times in a row. The Radius long running test operates on a schedule of every 2 hours everyday. It's important to understand that the test may fail due to workflow infrastructure issues, like network problems, rather than the flakiness of the test itself. For the further investigation, please visit [here](${process.env.ACTION_LINK}).` + body: `## Bug information \n\nThis issue is automatically generated if the scheduled long running test fails. The Radius long running test operates on a schedule of every 2 hours everyday. It's important to understand that the test may fail due to workflow infrastructure issues, like network problems, rather than the flakiness of the test itself. For the further investigation, please visit [here](${process.env.ACTION_LINK}).` }) diff --git a/.github/workflows/purge-aws-test-resources.yaml b/.github/workflows/purge-aws-test-resources.yaml index 32dc3a2359..67e947eaae 100644 --- a/.github/workflows/purge-aws-test-resources.yaml +++ b/.github/workflows/purge-aws-test-resources.yaml @@ -36,7 +36,7 @@ jobs: - name: Checkout the repository uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v4.0.2 with: aws-access-key-id: ${{ secrets.FUNCTEST_AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.FUNCTEST_AWS_SECRET_ACCESS_KEY }} diff --git a/.vscode/launch.json b/.vscode/launch.json index d98ac8286c..0c2f7a8967 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -31,13 +31,6 @@ "mode": "auto", "preLaunchTask": "Build Radius (all)", "program": "${workspaceFolder}/cmd/applications-rp/main.go", - "args": [ - "--config-file", - "${workspaceFolder}/cmd/applications-rp/radius-self-hosted.yaml" - ], - "env": { - "RADIUS_ENV": "self-hosted" - } }, { "name": "Launch Dynamic RP", @@ -54,16 +47,6 @@ "mode": "auto", "preLaunchTask": "Build Radius (all)", "program": "${workspaceFolder}/cmd/ucpd/main.go", - "cwd": "${workspaceFolder}", - "args": [ - "--config-file", - "${workspaceFolder}/cmd/ucpd/ucp-dev.yaml" - ], - "env": { - "BASE_PATH": "/apis/api.ucp.dev/v1alpha3", - "PORT": "9000", - "UCP_CONFIG": "${workspaceFolder}/cmd/ucpd/ucp-self-hosted-dev.yaml" - } }, { "name": "Launch Controller", @@ -72,23 +55,17 @@ "mode": "auto", "preLaunchTask": "Build Radius (all)", "program": "${workspaceFolder}/cmd/controller/main.go", - "cwd": "${workspaceFolder}", "args": [ - "--config-file", - "${workspaceFolder}/cmd/controller/controller-self-hosted.yaml", "--cert-dir", "" ], - "env": { - "RADIUS_ENV": "self-hosted" - } }, { "name": "Launch Deployment Engine", "type": "coreclr", "request": "launch", "preLaunchTask": "Build Deployment Engine", - "program": "${workspaceFolder}/../deployment-engine/src/DeploymentEngine/bin/Debug/net6.0/arm-de.dll", + "program": "${workspaceFolder}/../deployment-engine/src/DeploymentEngine/bin/Debug/net8.0/arm-de.dll", "args": [], "cwd": "${workspaceFolder}/../deployment-engine/src/DeploymentEngine", "stopAtEntry": false, diff --git a/bicep-types b/bicep-types index c86fc24d81..3676a8bf68 160000 --- a/bicep-types +++ b/bicep-types @@ -1 +1 @@ -Subproject commit c86fc24d81c562edba3035eb453772b4c2275c9a +Subproject commit 3676a8bf689e62780c64c79bdca42f1799958cd4 diff --git a/build/generate.mk b/build/generate.mk index e0a969f997..0685a0ed59 100644 --- a/build/generate.mk +++ b/build/generate.mk @@ -62,8 +62,8 @@ generate-controller-gen-installed: .PHONY: generate-ucp-crd generate-ucp-crd: generate-controller-gen-installed ## Generates the CRDs for UCP APIServer store. @echo "$(ARROW) Generating CRDs for ucp.dev..." - controller-gen object:headerFile=./boilerplate.go.txt paths=./pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1/... - controller-gen crd paths=./pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1/... output:crd:dir=./deploy/Chart/crds/ucpd + controller-gen object:headerFile=./boilerplate.go.txt paths=./pkg/components/database/apiserverstore/api/ucp.dev/v1alpha1/... + controller-gen crd paths=./pkg/components/database/apiserverstore/api/ucp.dev/v1alpha1/... output:crd:dir=./deploy/Chart/crds/ucpd .PHONY: generate-controller generate-controller: generate-controller-gen-installed ## Generates the CRDs for the Radius controller. diff --git a/build/prettier.mk b/build/prettier.mk index 5425a4508b..f680af93f9 100644 --- a/build/prettier.mk +++ b/build/prettier.mk @@ -14,16 +14,18 @@ # limitations under the License. # ------------------------------------------------------------ -.PHONY: prettier-check prettier-format me prettier +##@ Formatting (of JSON files) PRETTIER_VERSION := 3.3.3 -format-check: +.PHONY: format-check +format-check: ## Checks the formatting of JSON files. @echo "$(ARROW) Checking for formatting issues using prettier..." @echo "" - @npx prettier@$(PRETTIER_VERSION) --check "*/**/*.{ts,js,mjs,json}" + @npx --yes prettier@$(PRETTIER_VERSION) --check "*/**/*.{ts,js,mjs,json}" -format-write: +.PHONY: format-write +format-write: ## Updates the formatting of JSON files. @echo "$(ARROW) Reformatting files using prettier..." @echo "" - @npx prettier@$(PRETTIER_VERSION) --write "*/**/*.{ts,js,mjs,json}" + @npx --yes prettier@$(PRETTIER_VERSION) --write "*/**/*.{ts,js,mjs,json}" diff --git a/cmd/applications-rp/radius-self-hosted.yaml b/cmd/applications-rp/applications-rp-dev.yaml similarity index 90% rename from cmd/applications-rp/radius-self-hosted.yaml rename to cmd/applications-rp/applications-rp-dev.yaml index 2b9dd9368d..e2a1c7a6e6 100644 --- a/cmd/applications-rp/radius-self-hosted.yaml +++ b/cmd/applications-rp/applications-rp-dev.yaml @@ -8,9 +8,9 @@ # - Disables metrics and profiler # environment: - name: Dev + name: "dev" roleLocation: "global" -storageProvider: +databaseProvider: provider: "apiserver" apiserver: context: '' @@ -24,8 +24,9 @@ queueProvider: secretProvider: provider: "kubernetes" metricsProvider: + enabled: false + serviceName: applications-rp prometheus: - enabled: true path: "/metrics" port: 9092 profilerProvider: @@ -49,7 +50,8 @@ logging: json: false # Tracing configuration tracerProvider: - serviceName: "applications.core" + enabled: false + serviceName: applications-rp zipkin: url: "http://localhost:9411/api/v2/spans" bicep: diff --git a/cmd/applications-rp/cmd/root.go b/cmd/applications-rp/cmd/root.go index 88650ee966..0a66a87cab 100644 --- a/cmd/applications-rp/cmd/root.go +++ b/cmd/applications-rp/cmd/root.go @@ -22,20 +22,17 @@ import ( "github.com/go-logr/logr" "github.com/spf13/cobra" - etcdclient "go.etcd.io/etcd/client/v3" runtimelog "sigs.k8s.io/controller-runtime/pkg/log" "github.com/radius-project/radius/pkg/armrpc/builder" "github.com/radius-project/radius/pkg/armrpc/hostoptions" - metricsservice "github.com/radius-project/radius/pkg/metrics/service" - profilerservice "github.com/radius-project/radius/pkg/profiler/service" + "github.com/radius-project/radius/pkg/components/metrics/metricsservice" + "github.com/radius-project/radius/pkg/components/profiler/profilerservice" + "github.com/radius-project/radius/pkg/components/trace/traceservice" "github.com/radius-project/radius/pkg/recipes/controllerconfig" "github.com/radius-project/radius/pkg/server" - "github.com/radius-project/radius/pkg/trace" - "github.com/radius-project/radius/pkg/ucp/data" - "github.com/radius-project/radius/pkg/ucp/dataprovider" - "github.com/radius-project/radius/pkg/ucp/hosting" + "github.com/radius-project/radius/pkg/components/hosting" "github.com/radius-project/radius/pkg/ucp/ucplog" corerp_setup "github.com/radius-project/radius/pkg/corerp/setup" @@ -57,19 +54,6 @@ var rootCmd = &cobra.Command{ return err } - hostingSvc := []hosting.Service{} - - metricOptions := metricsservice.NewHostOptionsFromEnvironment(*options.Config) - metricOptions.Config.ServiceName = serviceName - if metricOptions.Config.Prometheus.Enabled { - hostingSvc = append(hostingSvc, metricsservice.NewService(metricOptions)) - } - - profilerOptions := profilerservice.NewHostOptionsFromEnvironment(*options.Config) - if profilerOptions.Config.Enabled { - hostingSvc = append(hostingSvc, profilerservice.NewService(profilerOptions)) - } - logger, flush, err := ucplog.NewLogger(serviceName, &options.Config.Logging) if err != nil { return err @@ -79,17 +63,17 @@ var rootCmd = &cobra.Command{ // Must set the logger before using controller-runtime. runtimelog.SetLogger(logger) - if options.Config.StorageProvider.Provider == dataprovider.TypeETCD && - options.Config.StorageProvider.ETCD.InMemory { - // For in-memory etcd we need to register another service to manage its lifecycle. - // - // The client will be initialized asynchronously. - logger.Info("Enabled in-memory etcd") - client := hosting.NewAsyncValue[etcdclient.Client]() - options.Config.StorageProvider.ETCD.Client = client - options.Config.SecretProvider.ETCD.Client = client - - hostingSvc = append(hostingSvc, data.NewEmbeddedETCDService(data.EmbeddedETCDServiceOptions{ClientConfigSink: client})) + services := []hosting.Service{} + if options.Config.MetricsProvider.Enabled { + services = append(services, &metricsservice.Service{Options: &options.Config.MetricsProvider}) + } + + if options.Config.ProfilerProvider.Enabled { + services = append(services, &profilerservice.Service{Options: &options.Config.ProfilerProvider}) + } + + if options.Config.TracerProvider.Enabled { + services = append(services, &traceservice.Service{Options: &options.Config.TracerProvider}) } builders, err := builders(options) @@ -97,28 +81,29 @@ var rootCmd = &cobra.Command{ return err } - hostingSvc = append( - hostingSvc, + services = append( + services, server.NewAPIService(options, builders), server.NewAsyncWorker(options, builders), ) - tracerOpts := options.Config.TracerProvider - tracerOpts.ServiceName = serviceName - hostingSvc = append(hostingSvc, &trace.Service{Options: tracerOpts}) - host := &hosting.Host{ - Services: hostingSvc, + Services: services, } + // Make the logger available to the services. ctx := logr.NewContext(context.Background(), logger) + + // Make the hosting configuration available to the services. + ctx = hostoptions.WithContext(ctx, options.Config) + return hosting.RunWithInterrupts(ctx, host) }, } func Execute() { // Let users override the configuration via `--config-file`. - rootCmd.Flags().String("config-file", fmt.Sprintf("radius-%s.yaml", hostoptions.Environment()), "The service configuration file.") + rootCmd.Flags().String("config-file", fmt.Sprintf("applications-rp-%s.yaml", hostoptions.Environment()), "The service configuration file.") cobra.CheckErr(rootCmd.ExecuteContext(context.Background())) } diff --git a/cmd/applications-rp/radius-cloud.yaml b/cmd/applications-rp/radius-cloud.yaml deleted file mode 100644 index acbcbe2401..0000000000 --- a/cmd/applications-rp/radius-cloud.yaml +++ /dev/null @@ -1,56 +0,0 @@ -# This is an example of configuration file. -environment: - name: AzureCloud - roleLocation: West US -identity: # 1P AAD APP authentication - clientId: "PLACEHOLDER" - instance: "https://login.windows.net" - tenantId: "common" - armEndpoint: "https://management.azure.com:443" - audience: "https://management.core.windows.net" - pemCertPath: "/var/certs/rp-aad-app.pem" -storageProvider: - provider: "cosmosdb" - cosmosdb: - # Create your own SQL API Cosmos DB account and set url in this configuration or to RADIUS_STORAGEPROVIDER_COSMOSDB_URL environment variable - url: https://radius-eastus-test.documents.azure.com:443/ - database: applicationscore - # Set primary key to in this configuration or to RADIUS_STORAGEPROVIDER_COSMOSDB_MASTERKEY environment variable - masterKey: set-me-in-a-different-way -queueProvider: - provider: inmemory - name: radius -profilerProvider: - enabled: true - port: 6060 -secretProvider: - provider: etcd - etcd: - inmemory: true -server: - host: "0.0.0.0" - port: 8080 - authType: "ClientCertificate" - enableArmAuth: true - armMetadataEndpoint: "https://admin.api-dogfood.resources.windows-int.net/metadata/authentication?api-version=2015-01-01" -workerServer: - maxOperationConcurrency: 10 - maxOperationRetryCount: 2 -metricsProvider: - prometheus: - enabled: true - path: "/metrics" - port: 9090 -featureFlags: - - "PLACEHOLDER" -ucp: - kind: kubernetes - # Logging configuration -logging: - level: "info" - json: false -bicep: - deleteRetryCount: 20 - deleteRetryDelaySeconds: 60 -terraform: - path: "/terraform" diff --git a/cmd/applications-rp/radius-dev.yaml b/cmd/applications-rp/radius-dev.yaml deleted file mode 100644 index c13ad6ada4..0000000000 --- a/cmd/applications-rp/radius-dev.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# This is an example of configuration file. -environment: - name: Dev - roleLocation: "global" -storageProvider: - provider: "etcd" - etcd: - inmemory: true -queueProvider: - provider: inmemory - name: radius -profilerProvider: - enabled: true - port: 6060 -secretProvider: - provider: etcd - etcd: - inmemory: true -metricsProvider: - prometheus: - enabled: true - path: "/metrics" - port: 9090 -featureFlags: - - "PLACEHOLDER" -server: - host: "0.0.0.0" - port: 8080 - enableArmAuth: false -workerServer: - maxOperationConcurrency: 10 - maxOperationRetryCount: 2 -ucp: - kind: kubernetes - # Logging configuration -logging: - level: "info" - json: false -bicep: - deleteRetryCount: 20 - deleteRetryDelaySeconds: 60 -terraform: - path: "/terraform" \ No newline at end of file diff --git a/cmd/controller/cmd/root.go b/cmd/controller/cmd/root.go index 88137025c4..4ac4c42f5a 100644 --- a/cmd/controller/cmd/root.go +++ b/cmd/controller/cmd/root.go @@ -28,9 +28,9 @@ import ( "github.com/go-logr/logr" "github.com/radius-project/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/components/hosting" + "github.com/radius-project/radius/pkg/components/trace/traceservice" "github.com/radius-project/radius/pkg/controller" - "github.com/radius-project/radius/pkg/trace" - "github.com/radius-project/radius/pkg/ucp/hosting" "github.com/radius-project/radius/pkg/ucp/ucplog" "github.com/spf13/cobra" runtimelog "sigs.k8s.io/controller-runtime/pkg/log" @@ -62,11 +62,15 @@ var rootCmd = &cobra.Command{ logger.Info("Loaded options", "configfile", configFilePath) - host := &hosting.Host{Services: []hosting.Service{ - &trace.Service{Options: options.Config.TracerProvider}, + services := []hosting.Service{ &controller.Service{Options: options, TLSCertDir: tlsCertDir}, - }} + } + + if options.Config.TracerProvider.Enabled { + services = append(services, &traceservice.Service{Options: &options.Config.TracerProvider}) + } + host := &hosting.Host{Services: services} return hosting.RunWithInterrupts(ctx, host) }, } diff --git a/cmd/controller/controller-self-hosted.yaml b/cmd/controller/controller-dev.yaml similarity index 70% rename from cmd/controller/controller-self-hosted.yaml rename to cmd/controller/controller-dev.yaml index a3c4274dc5..b3f398d158 100644 --- a/cmd/controller/controller-self-hosted.yaml +++ b/cmd/controller/controller-dev.yaml @@ -1,14 +1,20 @@ environment: - name: Dev + name: "dev" roleLocation: "global" profilerProvider: enabled: true port: 6063 metricsProvider: + enabled: true + serviceName: "controller" prometheus: - enabled: true path: "/metrics" port: 9093 +tracerProvider: + enabled: false + serviceName: "controller" + zipkin: + url: "http://localhost:9411/api/v2/spans" server: host: "0.0.0.0" port: 8083 diff --git a/cmd/dynamic-rp/cmd/root.go b/cmd/dynamic-rp/cmd/root.go index 046ce4002d..1b5513ad7f 100644 --- a/cmd/dynamic-rp/cmd/root.go +++ b/cmd/dynamic-rp/cmd/root.go @@ -26,9 +26,9 @@ import ( runtimelog "sigs.k8s.io/controller-runtime/pkg/log" "github.com/radius-project/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/components/hosting" "github.com/radius-project/radius/pkg/dynamicrp" "github.com/radius-project/radius/pkg/dynamicrp/server" - "github.com/radius-project/radius/pkg/ucp/hosting" "github.com/radius-project/radius/pkg/ucp/ucplog" ) diff --git a/cmd/dynamic-rp/dynamicrp-dev.yaml b/cmd/dynamic-rp/dynamicrp-dev.yaml index 4794a02ce0..31ab67d13b 100644 --- a/cmd/dynamic-rp/dynamicrp-dev.yaml +++ b/cmd/dynamic-rp/dynamicrp-dev.yaml @@ -1,8 +1,8 @@ # This is an example of configuration file. environment: - name: Dev + name: "dev" roleLocation: "global" -storageProvider: +databaseProvider: provider: "apiserver" apiserver: context: '' @@ -19,10 +19,18 @@ profilerProvider: enabled: false port: 6062 metricsProvider: + enabled: false + serviceName: "dynamic-rp" prometheus: - enabled: false path: "/metrics" port: 9092 +tracerProvider: + enabled: false + serviceName: "dynamic-rp" + zipkin: + url: "http://localhost:9411/api/v2/spans" +kubernetes: + kind: default server: host: "0.0.0.0" port: 8082 diff --git a/cmd/rad/cmd/root.go b/cmd/rad/cmd/root.go index 466c26e0b0..e360d5ba00 100644 --- a/cmd/rad/cmd/root.go +++ b/cmd/rad/cmd/root.go @@ -36,6 +36,7 @@ import ( app_show "github.com/radius-project/radius/pkg/cli/cmd/app/show" app_status "github.com/radius-project/radius/pkg/cli/cmd/app/status" bicep_publish "github.com/radius-project/radius/pkg/cli/cmd/bicep/publish" + bicep_publishextension "github.com/radius-project/radius/pkg/cli/cmd/bicep/publishextension" credential "github.com/radius-project/radius/pkg/cli/cmd/credential" cmd_deploy "github.com/radius-project/radius/pkg/cli/cmd/deploy" env_create "github.com/radius-project/radius/pkg/cli/cmd/env/create" @@ -61,6 +62,7 @@ import ( resourceprovider_delete "github.com/radius-project/radius/pkg/cli/cmd/resourceprovider/delete" resourceprovider_list "github.com/radius-project/radius/pkg/cli/cmd/resourceprovider/list" resourceprovider_show "github.com/radius-project/radius/pkg/cli/cmd/resourceprovider/show" + resourcetype_create "github.com/radius-project/radius/pkg/cli/cmd/resourcetype/create" resourcetype_delete "github.com/radius-project/radius/pkg/cli/cmd/resourcetype/delete" resourcetype_list "github.com/radius-project/radius/pkg/cli/cmd/resourcetype/list" resourcetype_show "github.com/radius-project/radius/pkg/cli/cmd/resourcetype/show" @@ -82,8 +84,11 @@ import ( "github.com/radius-project/radius/pkg/cli/kubernetes/portforward" "github.com/radius-project/radius/pkg/cli/output" "github.com/radius-project/radius/pkg/cli/prompt" - "github.com/radius-project/radius/pkg/trace" "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/sdk/resource" + sdktrace "go.opentelemetry.io/otel/sdk/trace" + semconv "go.opentelemetry.io/otel/semconv/v1.17.0" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -144,9 +149,7 @@ func prettyPrintJSON(o any) (string, error) { func Execute() error { ctx := context.WithValue(context.Background(), ConfigHolderKey, ConfigHolder) - shutdown, err := trace.InitTracer(trace.Options{ - ServiceName: serviceName, - }) + shutdown, err := initTracer() if err != nil { fmt.Println("Error:", err) return err @@ -182,6 +185,23 @@ func Execute() error { return nil } +func initTracer() (func(context.Context) error, error) { + // Intialize the tracer provider + tp := sdktrace.NewTracerProvider( + sdktrace.WithSampler(sdktrace.AlwaysSample()), + sdktrace.WithResource(resource.NewWithAttributes( + semconv.SchemaURL, + semconv.ServiceNameKey.String(serviceName), + )), + ) + + // Set the tracer provider as "global" for the CLI process. + otel.SetTracerProvider(tp) + otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{})) + + return tp.Shutdown, nil +} + func init() { cobra.OnInitialize(initConfig) @@ -254,6 +274,9 @@ func initSubCommands() { resourceTypeDeleteCmd, _ := resourcetype_delete.NewCommand(framework) resourceTypeCmd.AddCommand(resourceTypeDeleteCmd) + resourceTypeCreateCmd, _ := resourcetype_create.NewCommand(framework) + resourceTypeCmd.AddCommand(resourceTypeCreateCmd) + listRecipeCmd, _ := recipe_list.NewCommand(framework) recipeCmd.AddCommand(listRecipeCmd) @@ -326,6 +349,9 @@ func initSubCommands() { bicepPublishCmd, _ := bicep_publish.NewCommand(framework) bicepCmd.AddCommand(bicepPublishCmd) + bicepPublishExtensionCmd, _ := bicep_publishextension.NewCommand(framework) + bicepCmd.AddCommand(bicepPublishExtensionCmd) + installCmd := install.NewCommand() RootCmd.AddCommand(installCmd) diff --git a/cmd/ucpd/cmd/root.go b/cmd/ucpd/cmd/root.go index c6672ea03f..e108b4e9fb 100644 --- a/cmd/ucpd/cmd/root.go +++ b/cmd/ucpd/cmd/root.go @@ -19,15 +19,15 @@ package cmd import ( "context" "fmt" + "os" "github.com/go-logr/logr" "github.com/spf13/cobra" - etcdclient "go.etcd.io/etcd/client/v3" runtimelog "sigs.k8s.io/controller-runtime/pkg/log" "github.com/radius-project/radius/pkg/armrpc/hostoptions" - "github.com/radius-project/radius/pkg/ucp/dataprovider" - "github.com/radius-project/radius/pkg/ucp/hosting" + "github.com/radius-project/radius/pkg/components/hosting" + "github.com/radius-project/radius/pkg/ucp" "github.com/radius-project/radius/pkg/ucp/server" "github.com/radius-project/radius/pkg/ucp/ucplog" ) @@ -38,12 +38,23 @@ var rootCmd = &cobra.Command{ Long: `Server process for the Universal Control Plane (UCP).`, RunE: func(cmd *cobra.Command, args []string) error { configFilePath := cmd.Flag("config-file").Value.String() - options, err := server.NewServerOptionsFromEnvironment(configFilePath) + + bs, err := os.ReadFile(configFilePath) if err != nil { - return err + return fmt.Errorf("failed to read configuration file: %w", err) + } + + config, err := ucp.LoadConfig(bs) + if err != nil { + return fmt.Errorf("failed to parse configuration file: %w", err) } - logger, flush, err := ucplog.NewLogger(ucplog.LoggerName, &options.LoggingOptions) + options, err := ucp.NewOptions(cmd.Context(), config) + if err != nil { + return fmt.Errorf("failed to create server options: %w", err) + } + + logger, flush, err := ucplog.NewLogger(ucplog.LoggerName, &options.Config.Logging) if err != nil { return err } @@ -52,17 +63,7 @@ var rootCmd = &cobra.Command{ // Must set the logger before using controller-runtime. runtimelog.SetLogger(logger) - if options.StorageProviderOptions.Provider == dataprovider.TypeETCD && - options.StorageProviderOptions.ETCD.InMemory { - // For in-memory etcd we need to register another service to manage its lifecycle. - // - // The client will be initialized asynchronously. - clientconfigSource := hosting.NewAsyncValue[etcdclient.Client]() - options.StorageProviderOptions.ETCD.Client = clientconfigSource - options.SecretProviderOptions.ETCD.Client = clientconfigSource - } - - host, err := server.NewServer(&options) + host, err := server.NewServer(options) if err != nil { return err } @@ -74,6 +75,6 @@ var rootCmd = &cobra.Command{ func Execute() { // Let users override the configuration via `--config-file`. - rootCmd.Flags().String("config-file", fmt.Sprintf("radius-%s.yaml", hostoptions.Environment()), "The service configuration file.") + rootCmd.Flags().String("config-file", fmt.Sprintf("ucp-%s.yaml", hostoptions.Environment()), "The service configuration file.") cobra.CheckErr(rootCmd.ExecuteContext(context.Background())) } diff --git a/cmd/ucpd/ucp-dev.yaml b/cmd/ucpd/ucp-dev.yaml index 32f1a465cf..ddabe6bb0b 100644 --- a/cmd/ucpd/ucp-dev.yaml +++ b/cmd/ucpd/ucp-dev.yaml @@ -9,8 +9,14 @@ # - Talk to Portable Resources' Providers on port 8081 # - Disables metrics and profiler # -location: 'global' -storageProvider: +environment: + name: "dev" + roleLocation: "global" +server: + port: 9000 + pathBase: /apis/api.ucp.dev/v1alpha3 + +databaseProvider: provider: "apiserver" apiserver: context: '' @@ -32,19 +38,22 @@ profilerProvider: #Default planes configuration with which ucp starts # TODO: Remove azure and aws planes once rad provider commands are supported -planes: - - id: "/planes/aws/aws" - properties: - kind: "AWS" - - id: "/planes/radius/local" - properties: - resourceProviders: - Applications.Core: "http://localhost:8080" - Applications.Messaging: "http://localhost:8080" - Applications.Dapr: "http://localhost:8080" - Applications.Datastores: "http://localhost:8080" - Microsoft.Resources: "http://localhost:5017" - kind: "UCPNative" +initialization: + planes: + - id: "/planes/aws/aws" + properties: + kind: "AWS" + - id: "/planes/radius/local" + properties: + resourceProviders: + Applications.Core: "http://localhost:8080" + Applications.Messaging: "http://localhost:8080" + Applications.Dapr: "http://localhost:8080" + Applications.Datastores: "http://localhost:8080" + Microsoft.Resources: "http://localhost:5017" + kind: "UCPNative" + # This is the directory location which contains manifests to be registered. + manifestDirectory: "" identity: authMethod: default @@ -62,8 +71,9 @@ routing: # port is not the same as metrics configuration in radius-self-hosted.yaml # so that we can run both services in debug mode. metricsProvider: + enabled: false + serviceName: "ucp" prometheus: - enabled: false path: "/metrics" port: 9091 @@ -74,6 +84,7 @@ logging: # Tracing configuration tracerProvider: + enabled: false serviceName: "ucp" zipkin: - url: "http://localhost:9411/api/v2/spans" + url: "http://localhost:9411/api/v2/spans" \ No newline at end of file diff --git a/deploy/Chart/templates/controller/configmaps.yaml b/deploy/Chart/templates/controller/configmaps.yaml index 314213647b..281a05404e 100644 --- a/deploy/Chart/templates/controller/configmaps.yaml +++ b/deploy/Chart/templates/controller/configmaps.yaml @@ -12,7 +12,7 @@ data: host: "0.0.0.0" port: 9443 - storageProvider: + databaseProvider: provider: "apiserver" apiserver: context: "" @@ -36,8 +36,9 @@ data: kind: kubernetes metricsProvider: + enabled: true + serviceName: "controller" prometheus: - enabled: true path: "/metrics" port: 9090 @@ -50,6 +51,7 @@ data: {{- if and .Values.global.zipkin .Values.global.zipkin.url }} tracerProvider: + enabled: true serviceName: "controller" zipkin: url: {{ .Values.global.zipkin.url }} diff --git a/deploy/Chart/templates/dynamic-rp/configmaps.yaml b/deploy/Chart/templates/dynamic-rp/configmaps.yaml index 31368b5db0..7f4c9e0d74 100644 --- a/deploy/Chart/templates/dynamic-rp/configmaps.yaml +++ b/deploy/Chart/templates/dynamic-rp/configmaps.yaml @@ -13,7 +13,7 @@ data: environment: name: self-hosted roleLocation: "global" - storageProvider: + databaseProvider: provider: "apiserver" apiserver: context: "" @@ -25,8 +25,9 @@ data: context: "" namespace: "radius-system" metricsProvider: + enabled: true + serviceName: "dynamic-rp" prometheus: - enabled: true path: "/metrics" port: 9092 profilerProvider: @@ -34,6 +35,8 @@ data: port: 6062 secretProvider: provider: kubernetes + kubernetes: + kind: default server: host: "0.0.0.0" port: 8082 @@ -47,6 +50,7 @@ data: json: true {{- if and .Values.global.zipkin .Values.global.zipkin.url }} tracerProvider: + enabled: true serviceName: "dynamic-rp" zipkin: url: {{ .Values.global.zipkin.url }} diff --git a/deploy/Chart/templates/rp/configmaps.yaml b/deploy/Chart/templates/rp/configmaps.yaml index e444f31999..78aeb8ac98 100644 --- a/deploy/Chart/templates/rp/configmaps.yaml +++ b/deploy/Chart/templates/rp/configmaps.yaml @@ -13,7 +13,7 @@ data: environment: name: self-hosted roleLocation: "global" - storageProvider: + databaseProvider: provider: "apiserver" apiserver: context: "" @@ -25,8 +25,9 @@ data: context: "" namespace: "radius-system" metricsProvider: + enabled: true + serviceName: "applications-rp" prometheus: - enabled: true path: "/metrics" port: 9090 profilerProvider: @@ -47,7 +48,8 @@ data: json: true {{- if and .Values.global.zipkin .Values.global.zipkin.url }} tracerProvider: - serviceName: "applications.core" + enabled: true + serviceName: "applications-rp" zipkin: url: {{ .Values.global.zipkin.url }} {{- end }} diff --git a/deploy/Chart/templates/ucp/configmaps.yaml b/deploy/Chart/templates/ucp/configmaps.yaml index d56d0f4f30..2047e006a8 100644 --- a/deploy/Chart/templates/ucp/configmaps.yaml +++ b/deploy/Chart/templates/ucp/configmaps.yaml @@ -10,8 +10,14 @@ data: ucp-config.yaml: |- # Radius configuration file. # See https://github.com/radius-project/radius/blob/main/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md for more information. - location: 'global' - storageProvider: + environment: + name: self-hosted + roleLocation: "global" + server: + port: 9443 + pathBase: /apis/api.ucp.dev/v1alpha3 + tlsCertificateDirectory: /var/tls/cert + databaseProvider: provider: "apiserver" apiserver: context: "" @@ -30,20 +36,21 @@ data: profilerProvider: enabled: true port: 6060 - - planes: - - id: "/planes/radius/local" - properties: - resourceProviders: - Applications.Core: "http://applications-rp.radius-system:5443" - Applications.Dapr: "http://applications-rp.radius-system:5443" - Applications.Datastores: "http://applications-rp.radius-system:5443" - Applications.Messaging: "http://applications-rp.radius-system:5443" - Microsoft.Resources: "http://bicep-de.radius-system:6443" - kind: "UCPNative" - - id: "/planes/aws/aws" - properties: - kind: "AWS" + initialization: + planes: + - id: "/planes/radius/local" + properties: + resourceProviders: + Applications.Core: "http://applications-rp.radius-system:5443" + Applications.Dapr: "http://applications-rp.radius-system:5443" + Applications.Datastores: "http://applications-rp.radius-system:5443" + Applications.Messaging: "http://applications-rp.radius-system:5443" + Microsoft.Resources: "http://bicep-de.radius-system:6443" + kind: "UCPNative" + - id: "/planes/aws/aws" + properties: + kind: "AWS" + manifestDirectory: "" identity: authMethod: UCPCredential @@ -55,8 +62,9 @@ data: defaultDownstreamEndpoint: "http://dynamic-rp.radius-sytem:8082" metricsProvider: + enabled: true + serviceName: "ucp" prometheus: - enabled: true path: "/metrics" port: 9090 @@ -66,6 +74,7 @@ data: {{- if and .Values.global.zipkin .Values.global.zipkin.url }} tracerProvider: + enabled: true serviceName: "ucp" zipkin: url: {{ .Values.global.zipkin.url }} diff --git a/deploy/Chart/templates/ucp/deployment.yaml b/deploy/Chart/templates/ucp/deployment.yaml index 776b01ac7b..9c79557899 100644 --- a/deploy/Chart/templates/ucp/deployment.yaml +++ b/deploy/Chart/templates/ucp/deployment.yaml @@ -36,8 +36,6 @@ spec: args: - --config-file=/etc/config/ucp-config.yaml env: - - name: BASE_PATH - value: '/apis/api.ucp.dev/v1alpha3' # listen for APIService URLs - name: TLS_CERT_DIR value: '/var/tls/cert' - name: PORT diff --git a/deploy/Chart/templates/ucp/rbac.yaml b/deploy/Chart/templates/ucp/rbac.yaml index e41c1d6fe8..d1425f4c45 100644 --- a/deploy/Chart/templates/ucp/rbac.yaml +++ b/deploy/Chart/templates/ucp/rbac.yaml @@ -6,52 +6,38 @@ metadata: app.kubernetes.io/name: ucp app.kubernetes.io/part-of: radius rules: -- apiGroups: - - "" - resources: - - configmaps - - secrets - - services - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - apps - resources: - - deployments - - statefulsets - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - ucp.dev - resources: - - resources - - queuemessages - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - api.ucp.dev - resources: - - '*' - verbs: - - '*' + - apiGroups: + - "" + resources: + - secrets + verbs: + - create + - delete + - get + - update + + - apiGroups: + - ucp.dev + resources: + - resources + - queuemessages + verbs: + - create + - delete + - get + - list + - update + + - apiGroups: + - api.ucp.dev + resources: + - "*" + verbs: + - create + - delete + - get + - list + - update --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -65,6 +51,6 @@ roleRef: kind: ClusterRole name: ucp subjects: -- kind: ServiceAccount - name: ucp - namespace: {{ .Release.Namespace }} \ No newline at end of file + - kind: ServiceAccount + name: ucp + namespace: {{ .Release.Namespace }} diff --git a/deploy/manifest/built-in-providers/applications_core.yaml b/deploy/manifest/built-in-providers/applications_core.yaml index f7b256f5ee..d105acaf01 100644 --- a/deploy/manifest/built-in-providers/applications_core.yaml +++ b/deploy/manifest/built-in-providers/applications_core.yaml @@ -4,34 +4,34 @@ types: apiVersions: "2025-01-01-preview": schema: {} - capabilities: [] + capabilities: [] applications: apiVersions: "2025-01-01-preview": schema: {} - capabilities: [] + capabilities: [] environments: apiVersions: "2025-01-01-preview": schema: {} - capabilities: [] + capabilities: [] gateways: apiVersions: "2025-01-01-preview": schema: {} - capabilities: [] + capabilities: [] secretStores: apiVersions: "2025-01-01-preview": schema: {} - capabilities: [] + capabilities: [] extenders: apiVersions: "2025-01-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] volumes: apiVersions: "2025-01-01-preview": schema: {} - capabilities: [] + capabilities: [] diff --git a/deploy/manifest/built-in-providers/applications_dapr.yaml b/deploy/manifest/built-in-providers/applications_dapr.yaml index 9df3cfaae3..3738e87643 100644 --- a/deploy/manifest/built-in-providers/applications_dapr.yaml +++ b/deploy/manifest/built-in-providers/applications_dapr.yaml @@ -4,19 +4,19 @@ types: apiVersions: "2025-01-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] pubSubBrokers: apiVersions: "2025-01-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] secretStores: apiVersions: "2025-01-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] stateStores: apiVersions: "2025-01-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] diff --git a/deploy/manifest/built-in-providers/applications_datastores.yaml b/deploy/manifest/built-in-providers/applications_datastores.yaml index 2be3e75447..b8eb7d65b7 100644 --- a/deploy/manifest/built-in-providers/applications_datastores.yaml +++ b/deploy/manifest/built-in-providers/applications_datastores.yaml @@ -4,14 +4,14 @@ types: apiVersions: "2025-01-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] sqlDatabases: apiVersions: "2025-01-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] redisCaches: apiVersions: "2025-01-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] diff --git a/deploy/manifest/built-in-providers/applications_messaging.yaml b/deploy/manifest/built-in-providers/applications_messaging.yaml index fe8d490b10..cac03e8aa4 100644 --- a/deploy/manifest/built-in-providers/applications_messaging.yaml +++ b/deploy/manifest/built-in-providers/applications_messaging.yaml @@ -4,4 +4,4 @@ types: apiVersions: "2025-01-01-preview": schema: {} - capabilities: ["Recipes"] + capabilities: ["SupportsRecipes"] diff --git a/deploy/manifest/built-in-providers/microsoft_resources.yaml b/deploy/manifest/built-in-providers/microsoft_resources.yaml index bd1e905818..b2c24733bb 100644 --- a/deploy/manifest/built-in-providers/microsoft_resources.yaml +++ b/deploy/manifest/built-in-providers/microsoft_resources.yaml @@ -4,5 +4,5 @@ types: apiVersions: "2025-01-01-preview": schema: {} - capabilities: [] + capabilities: [] diff --git a/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md b/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md index c350891370..e95262fb0f 100644 --- a/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md +++ b/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md @@ -20,7 +20,7 @@ The following properties can be specified in configuration for all services: |-----|-------------|---------| | environment | Environment name and its role location | [**See below**](#environment) | | identity | AAD APP authentication for the resource provider | [**See below**](#identity) | -| storageProvider | Configuration options for the data storage provider | [**See below**](#storageprovider) | +| databaseProvider | Configuration options for the database provider | [**See below**](#databaseprovider) | | queueProvider | Configuration options for the provider to create and manage the queue client | [**See below**](#queueprovider) | | secretProvider | Configuration options for the provider to manage credential | [**See below**](#secretprovider) | | server | Configuration options for the HTTP server bootstrap | [**See below**](#server) | @@ -61,19 +61,18 @@ The following are properties that can be specified for UCP: | audience | The recipient of the certificate | `https://management.core.windows.net` | | pemCertPath | Path to certificate file | `/var/certs/rp-aad-app.pem` | -### storageProvider +### databaseProvider | Key | Description | Example | |-----|-------------|---------| -| provider | The type of storage provider | `apiServer` | -| apiServer | Object containing properties for Kubernetes APIServer store | [**See below**](#apiserver) | -| cosmosdb | Object containing properties for CosmosDB | [**See below**](#cosmosdb) | -| etcd | Object containing properties for ETCD store | [**See below**](#etcd)| +| provider | The type of database provider | `apiServer` | +| apiServer | Object containing properties for Kubernetes APIServer database | [**See below**](#apiserver) | +| etcd | Object containing properties for ETCD database | [**See below**](#etcd)| ### queueProvider | Key | Description | Example | |-----|-------------|---------| | provider | The type of queue provider | `apiServer` | -| apiServer | Object containing properties for Kubernetes APIServer store | [**See below**](#apiserver) | +| apiServer | Object containing properties for Kubernetes APIServer queue | [**See below**](#apiserver) | | inMemoryQueue | Object containing properties for InMemory Queue client | | ### secretProvider @@ -159,14 +158,6 @@ ucp: |-----|-------------|---------| | inMemory | Configures the etcd store to run in-memory with the resource provider (must be `true`/`false`) | `true` | -### cosmosdb -| Key | Description | Example | -|-----|-------------|---------| -| url | URL of CosmosDB account | `https://radius-eastus-test.documents.azure.com:443/` | -| database | Name of the database in account | `applicationscore` | -| masterKey | All access key token for database resources | `your-master-key` | -| CollectionThroughput | Throughput of database | `400` | - ## Plane properties | Key | Description | Example | @@ -183,68 +174,7 @@ ucp: ## Example configuration files -Below are completed examples of possible configurations: - -### Applications.Core and Portable Resources' Providers -```yaml -environment: - name: self-hosted - roleLocation: "global" -storageProvider: - provider: "apiserver" - apiserver: - context: "" - namespace: "radius-system" -queueProvider: - provider: "apiserver" - name: "radius" - apiserver: - context: "" - namespace: "radius-system" -metricsProvider: - prometheus: - enabled: true - path: "/metrics" - port: 9090 -server: - host: "0.0.0.0" - port: 5443 -workerServer: - maxOperationConcurrency: 10 - maxOperationRetryCount: 2 -ucp: - kind: kubernetes -``` - -### UCP -```yaml -location: 'global' -storageProvider: - provider: "apiserver" - apiserver: - context: "" - namespace: "radius-system" -secretProvider: - provider: "kubernetes" -planes: - - id: "/planes/radius/local" - properties: - resourceProviders: - Applications.Core: "http://applications-rp.radius-system:5443" - Applications.Dapr: "http://applications-rp.radius-system:5443" - Applications.Datastores: "http://applications-rp.radius-system:5443" - Applications.Messaging: "http://applications-rp.radius-system:5443" - Microsoft.Resources: "http://bicep-de.radius-system:6443" - kind: "UCPNative" - - id: "/planes/aws/aws" - properties: - kind: "AWS" -metricsProvider: - prometheus: - enabled: true - path: "/metrics" - port: 9090 -``` +See the configuration files in `cmd//*.yaml` for examples of configuration files. ## Environment Variables diff --git a/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md b/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md index 6e26d51511..c6c96f9be9 100644 --- a/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md +++ b/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md @@ -29,7 +29,7 @@ If you need to manually test APIs you can reach them at the following endpoints 1. Create a Kubernetes cluster, or set your current context to a cluster you want to use. The debug configuration will use your current cluster for storing data. 2. Clone the `radius-project/radius` and `radius-project/deployment-engine` repo next to each other. 3. Run `git submodule update --init` in the `deployment-engine` repo. -4. Install .NET 6.0 SDK - . +4. Install .NET 8.0 SDK - . 5. Install C# VS Code extension - . 6. (Optional) Configure any cloud provider credentials you want to use for developing Radius. @@ -161,7 +161,7 @@ dotnet --list-runtimes dotnet --list-sdks ``` -Make sure you see a `6.0` entry in `--list-runtimes` for `Microsoft.AspNetCore.App` and a `6.0` or newer entry for `--list-sdks`. +Make sure you see a `8.0` entry in `--list-runtimes` for `Microsoft.AspNetCore.App` and a `8.0` or newer entry for `--list-sdks`. If you run into issues here, please re-read the prerequisites related to installing .NET. diff --git a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-00-prerequisites/index.md b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-00-prerequisites/index.md index 2a134403f7..9af8e10c48 100644 --- a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-00-prerequisites/index.md +++ b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-00-prerequisites/index.md @@ -17,9 +17,9 @@ On our supported OSes using a package manager to install these dependencies is a ## Required installs -We recommend the usage of either GitHub Codespaces or dev containers to setup your development environment. Here are the links that provide more details: +We recommend the usage of dev containers to setup your development environment. Here are the links that provide more details: -- [Getting started - GitHub Codespaces](../contributing-code-prerequisites/README.md#github-codespaces) + - [Getting started - Dev Containers](../contributing-code-prerequisites/README.md#vs-code-and-dev-container) However, you can also install all tools locally. This is the list of core dependencies to install for the most common tasks. In general we expect all contributors to have all of these tools present: diff --git a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-01-development-tools/index.md b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-01-development-tools/index.md index 9069dff969..bf41422160 100644 --- a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-01-development-tools/index.md +++ b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-01-development-tools/index.md @@ -15,7 +15,7 @@ Alternatively, you can choose whichever editor you are most comfortable for work - [Visual Studio Code](https://code.visualstudio.com/) - [Go extension](https://marketplace.visualstudio.com/items?itemName=golang.go) -> 📝 **Tip** - If your are using GitHub Codespaces or Dev Containers, the Go extension is already installed for you. You find more details on these options in the [Repository Prerequisites](../contributing-code-prerequisites/README.md). +> 📝 **Tip** - If your are using Dev Containers, the Go extension is already installed for you. You find more details on these options in the [Repository Prerequisites](../contributing-code-prerequisites/README.md). Install both of these and then follow the steps in the *Quick Start* for the Go extension. diff --git a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-05-running-tests/index.md b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-05-running-tests/index.md index 18f9532339..f55098ea20 100644 --- a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-05-running-tests/index.md +++ b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-05-running-tests/index.md @@ -24,7 +24,6 @@ ok github.com/radius-project/radius/pkg/cli 0.250s ? github.com/radius-project/radius/pkg/azure/radclient [no test files] ? github.com/radius-project/radius/pkg/renderers [no test files] ok github.com/radius-project/radius/pkg/renderers/containerv1alpha3 -ok github.com/radius-project/radius/pkg/renderers/cosmosdbmongov1alpha3 ok github.com/radius-project/radius/pkg/renderers/dapr ok github.com/radius-project/radius/pkg/renderers/daprpubsubv1alpha3 ok github.com/radius-project/radius/pkg/renderers/daprstatestorev1alpha3 diff --git a/docs/contributing/contributing-code/contributing-code-organization/README.md b/docs/contributing/contributing-code/contributing-code-organization/README.md index ebcec4fd8d..dd7a5e9b63 100644 --- a/docs/contributing/contributing-code/contributing-code-organization/README.md +++ b/docs/contributing/contributing-code/contributing-code-organization/README.md @@ -28,10 +28,12 @@ In general you should ask for guidance before creating a new top-level folder in | `aws/` | Utility code and library integrations for working with AWS | | `azure/` | Utility code and library integrations for working with Azure | | `cli/` | Implementation code for the `rad` CLI | +| `components/` | Components and its folders hold the implementations of shared components used by the Radius control-plane services | | `controllers/` | Kubernetes controllers for Radius | | `corerp/` | Resource Provider implementation for `Applications.Core` resources | | `daprrp/` | Resource Provider implementation for `Applications.Dapr` resources | | `datastoresrp/` | Resource Provider implementation for `Applications.Datastores` resources | +| `dynamicrp/` | Implementation of the dynamic resource provider. The dynamicrp is responsible for managing the lifecycle of resources that are defined without their own resource provider implementation. | | `kubernetes/` | Utility code and library integrations for working with Kubernetes | | `kubeutil/` | Utility code and working with Kubernetes on client side | | `portableresources/` | Shared Resource Provider implementation for portable resources | diff --git a/docs/contributing/contributing-code/contributing-code-prerequisites/README.md b/docs/contributing/contributing-code/contributing-code-prerequisites/README.md index f592e98bdc..e25eb078dc 100644 --- a/docs/contributing/contributing-code/contributing-code-prerequisites/README.md +++ b/docs/contributing/contributing-code/contributing-code-prerequisites/README.md @@ -2,13 +2,13 @@ This page lists the prerequisites for working with the repository. In general, you have three options to get your development setup up and running: -- Remotely using GitHub Codespaces + - Using Visual Studio Code and dev containers - Locally by installing all prerequisites on your machine We will walk you through the options in the following sections. -> 📝 **Tip** - We recommend the usage of GitHub Codespaces or dev containers in Visual Studio Code as they are the most convenient way to get started. +> 📝 **Tip** - We recommend the usage of dev containers in Visual Studio Code as they are the most convenient way to get started. Depending on the task you need to perform, you may need to install more tools, but basic prerequisites should be sufficient for most contributors to get started. @@ -22,9 +22,9 @@ If you get stuck with any development setup option, please ask for help in our [ ## Development environment - setup options -The following sections describe the aforementioned alternatives of development setups in more detail. We recommend to use of _GitHub Codespaces_ or _dev containers_ in VS Code as they are the most convenient way to get started. +The following sections describe the aforementioned alternatives of development setups in more detail. We recommend use of _dev containers_ in VS Code as they are the most convenient way to get started. -### GitHub Codespaces + ### VS Code and Dev Container @@ -72,7 +72,7 @@ Once the container is up and running you can start with your contribution. Contributing to Radius requires several tools to get started. This section lists them grouped by their context -> 📝 **Tip** - If your are using [GitHub Codespaces](#github-codespaces) or [VS Code and Dev Container](#vs-code-and-dev-container), all these tools are already in place and available out-of-the-box. +> 📝 **Tip** - If your are using [VS Code and Dev Container](#vs-code-and-dev-container), all these tools are already in place and available out-of-the-box.