From a77b24a3717b357445249c062e955dcfae04d97a Mon Sep 17 00:00:00 2001 From: sk593 Date: Mon, 12 Aug 2024 12:23:53 -0700 Subject: [PATCH 1/8] update credential precedence Signed-off-by: sk593 --- bicepconfig.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bicepconfig.json b/bicepconfig.json index 8dfaeb32b7..960cd173c9 100644 --- a/bicepconfig.json +++ b/bicepconfig.json @@ -9,6 +9,9 @@ "aws": "br:biceptypes.azurecr.io/aws:latest" }, "cloud": { - "credentialPrecedence": ["Environment"] + "credentialPrecedence": [ + "Environment", + "AzureCLI" + ] } } \ No newline at end of file From 3a8df142e686add5b0d80ffd895dc744bee390e2 Mon Sep 17 00:00:00 2001 From: sk593 Date: Mon, 12 Aug 2024 12:49:43 -0700 Subject: [PATCH 2/8] testing publish to acr Signed-off-by: sk593 --- bicepconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bicepconfig.json b/bicepconfig.json index 960cd173c9..298617fb69 100644 --- a/bicepconfig.json +++ b/bicepconfig.json @@ -10,7 +10,7 @@ }, "cloud": { "credentialPrecedence": [ - "Environment", + "Environment", "AzureCLI" ] } From f62e9cb03256520f8e089be1800b30c269bf306b Mon Sep 17 00:00:00 2001 From: sk593 Date: Mon, 12 Aug 2024 13:24:50 -0700 Subject: [PATCH 3/8] add temp bicepconfig to validate bicep Signed-off-by: sk593 --- .github/workflows/functional-test-cloud.yaml | 24 ++++++++++++++++++++ .github/workflows/validate-bicep.yaml | 8 +++++++ bicepconfig.json | 6 ----- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/functional-test-cloud.yaml b/.github/workflows/functional-test-cloud.yaml index e85f76e8b7..356db6fa78 100644 --- a/.github/workflows/functional-test-cloud.yaml +++ b/.github/workflows/functional-test-cloud.yaml @@ -315,6 +315,30 @@ jobs: message: | :hourglass: Publishing Bicep Recipes for functional tests... + - name: Generate test bicepconfig.json + run: | + if [[ "${{ env.REL_VERSION }}" == "edge" ]]; then + RADIUS_VERSION="latest" + else + RADIUS_VERSION="${{ env.REL_VERSION }}" + fi + cat < ./test/bicepconfig.json + { + "experimentalFeaturesEnabled": { + "extensibility": true, + "extensionRegistry": true, + "dynamicTypeLoading": true + }, + "extensions": { + "radius": "br:${{ env.BICEP_TYPES_REGISTRY }}/test/radius:$RADIUS_VERSION", + "aws": "br:${{ env.BICEP_TYPES_REGISTRY }}/aws:latest" + }, + "cloud": { + "credentialPrecedence": ["Environment"] + } + } + EOF + - name: Publish Bicep Test Recipes run: | mkdir ./bin diff --git a/.github/workflows/validate-bicep.yaml b/.github/workflows/validate-bicep.yaml index ea7fa50e2c..8fde59ea7d 100644 --- a/.github/workflows/validate-bicep.yaml +++ b/.github/workflows/validate-bicep.yaml @@ -44,6 +44,14 @@ jobs: bicep --version - name: Check out repo uses: actions/checkout@v4 + - name: Install jq + run: sudo apt-get install -y jq + - name: Modify bicepconfig.json + run: | + # Add credential preference to the bicepconfig.json file + jq '. + {"cloud": {"credentialPrecedence": ["Environment"]}}' bicepconfig.json > tmp.json && mv tmp.json bicepconfig.json + - name: Print updated bicepconfig.json + run: cat bicepconfig.json - name: Verify Bicep files run: ./build/validate-bicep.sh env: diff --git a/bicepconfig.json b/bicepconfig.json index 298617fb69..65aa584422 100644 --- a/bicepconfig.json +++ b/bicepconfig.json @@ -7,11 +7,5 @@ "extensions": { "radius": "br:biceptypes.azurecr.io/radius:latest", "aws": "br:biceptypes.azurecr.io/aws:latest" - }, - "cloud": { - "credentialPrecedence": [ - "Environment", - "AzureCLI" - ] } } \ No newline at end of file From ad17b1d9b0ba52b8c2508e2f81f153f4e78a3bc2 Mon Sep 17 00:00:00 2001 From: sk593 Date: Mon, 12 Aug 2024 13:34:42 -0700 Subject: [PATCH 4/8] nit Signed-off-by: sk593 --- .github/workflows/validate-bicep.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-bicep.yaml b/.github/workflows/validate-bicep.yaml index 8fde59ea7d..660e9806c2 100644 --- a/.github/workflows/validate-bicep.yaml +++ b/.github/workflows/validate-bicep.yaml @@ -50,7 +50,7 @@ jobs: run: | # Add credential preference to the bicepconfig.json file jq '. + {"cloud": {"credentialPrecedence": ["Environment"]}}' bicepconfig.json > tmp.json && mv tmp.json bicepconfig.json - - name: Print updated bicepconfig.json + - name: Print updated bicepconfig.json to verify changes run: cat bicepconfig.json - name: Verify Bicep files run: ./build/validate-bicep.sh From 850243a4a4fa50de1c2c413b9ed6e1838c10e833 Mon Sep 17 00:00:00 2001 From: sk593 Date: Mon, 12 Aug 2024 13:52:04 -0700 Subject: [PATCH 5/8] update cloud workflow Signed-off-by: sk593 --- .github/workflows/functional-test-cloud.yaml | 75 +++++++++----------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/.github/workflows/functional-test-cloud.yaml b/.github/workflows/functional-test-cloud.yaml index 356db6fa78..4296615ca1 100644 --- a/.github/workflows/functional-test-cloud.yaml +++ b/.github/workflows/functional-test-cloud.yaml @@ -314,6 +314,40 @@ jobs: append: true message: | :hourglass: Publishing Bicep Recipes for functional tests... + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '18' + + - name: Generate Bicep extensibility types from OpenAPI specs + run: | + make generate-bicep-types VERSION=${{ env.REL_VERSION == 'edge' && 'latest' || env.REL_VERSION }} + + - name: Upload Radius Bicep types artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.name }}_radius_bicep_types + path: ./hack/bicep-types-radius/generated + if-no-files-found: error + + - name: 'Login via Azure CLI' + uses: azure/login@v2 + with: + client-id: ${{ secrets.BICEPTYPES_CLIENT_ID }} + tenant-id: ${{ secrets.BICEPTYPES_TENANT_ID }} + subscription-id: ${{ secrets.BICEPTYPES_SUBSCRIPTION_ID }} + + - name: Setup and verify bicep CLI + run: | + curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64 + chmod +x ./bicep + sudo mv ./bicep /usr/local/bin/bicep + bicep --version + + - name: Publish bicep types + run: | + bicep publish-extension ./hack/bicep-types-radius/generated/index.json --target br:${{ env.BICEP_TYPES_REGISTRY }}/test/radius:${{ env.REL_VERSION == 'edge' && 'latest' || env.REL_VERSION }} --force - name: Generate test bicepconfig.json run: | @@ -375,47 +409,6 @@ jobs: message: | :x: Test recipe publishing failed - publish-test-bicep-types: - name: Publish Radius bicep types to ACR - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v4 - - name: Parse release version and set environment variables - run: python ./.github/scripts/get_release_version.py - - name: Set up Go ${{ env.GOVER }} - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GOVER }} - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: '18' - - name: Generate Bicep extensibility types from OpenAPI specs - run: | - make generate-bicep-types VERSION=${{ env.REL_VERSION == 'edge' && 'latest' || env.REL_VERSION }} - - name: Upload Radius Bicep types artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.name }}_radius_bicep_types - path: ./hack/bicep-types-radius/generated - if-no-files-found: error - - name: 'Login via Azure CLI' - uses: azure/login@v2 - with: - client-id: ${{ secrets.BICEPTYPES_CLIENT_ID }} - tenant-id: ${{ secrets.BICEPTYPES_TENANT_ID }} - subscription-id: ${{ secrets.BICEPTYPES_SUBSCRIPTION_ID }} - - name: Setup and verify bicep CLI - run: | - curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64 - chmod +x ./bicep - sudo mv ./bicep /usr/local/bin/bicep - bicep --version - - name: Publish bicep types - run: | - bicep publish-extension ./hack/bicep-types-radius/generated/index.json --target br:${{ env.BICEP_TYPES_REGISTRY }}/test/radius:${{ env.REL_VERSION == 'edge' && 'latest' || env.REL_VERSION }} --force - tests: name: Run ${{ matrix.name }} functional tests needs: [build, publish-test-bicep-types] From 45a446e43a63e0fd0769d92f992f9a5413c24d9c Mon Sep 17 00:00:00 2001 From: sk593 Date: Mon, 12 Aug 2024 14:08:57 -0700 Subject: [PATCH 6/8] nit Signed-off-by: sk593 --- .github/workflows/validate-bicep.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-bicep.yaml b/.github/workflows/validate-bicep.yaml index 660e9806c2..8fde59ea7d 100644 --- a/.github/workflows/validate-bicep.yaml +++ b/.github/workflows/validate-bicep.yaml @@ -50,7 +50,7 @@ jobs: run: | # Add credential preference to the bicepconfig.json file jq '. + {"cloud": {"credentialPrecedence": ["Environment"]}}' bicepconfig.json > tmp.json && mv tmp.json bicepconfig.json - - name: Print updated bicepconfig.json to verify changes + - name: Print updated bicepconfig.json run: cat bicepconfig.json - name: Verify Bicep files run: ./build/validate-bicep.sh From b2581bbd949fd05e6b067b9b57950c4aa08ed321 Mon Sep 17 00:00:00 2001 From: sk593 Date: Mon, 12 Aug 2024 14:21:13 -0700 Subject: [PATCH 7/8] nit Signed-off-by: sk593 --- .github/workflows/functional-test-cloud.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/functional-test-cloud.yaml b/.github/workflows/functional-test-cloud.yaml index 4296615ca1..74b7e9aad1 100644 --- a/.github/workflows/functional-test-cloud.yaml +++ b/.github/workflows/functional-test-cloud.yaml @@ -411,7 +411,7 @@ jobs: tests: name: Run ${{ matrix.name }} functional tests - needs: [build, publish-test-bicep-types] + needs: [build] if: github.event_name == 'repository_dispatch' || (github.event_name == 'schedule' && github.repository == 'radius-project/radius') || github.event_name == 'workflow_run' strategy: fail-fast: true From 0f85d87602181ba567bdf167b139f572fd521f68 Mon Sep 17 00:00:00 2001 From: sk593 Date: Mon, 12 Aug 2024 16:10:24 -0700 Subject: [PATCH 8/8] nit Signed-off-by: sk593 --- .github/workflows/functional-test-cloud.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/functional-test-cloud.yaml b/.github/workflows/functional-test-cloud.yaml index 74b7e9aad1..89f341b229 100644 --- a/.github/workflows/functional-test-cloud.yaml +++ b/.github/workflows/functional-test-cloud.yaml @@ -327,7 +327,7 @@ jobs: - name: Upload Radius Bicep types artifacts uses: actions/upload-artifact@v4 with: - name: ${{ matrix.name }}_radius_bicep_types + name: radius_bicep_types_cloud path: ./hack/bicep-types-radius/generated if-no-files-found: error