From de5db675ccaef7795543efb921d698542675a799 Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Thu, 2 Nov 2023 10:43:09 -0700 Subject: [PATCH 01/15] Add install-radius script Signed-off-by: willdavsmith --- .github/scripts/install-radius.sh | 40 +++++++++++++++++++++++++++++++ .github/workflows/test.yaml | 19 +-------------- 2 files changed, 41 insertions(+), 18 deletions(-) create mode 100644 .github/scripts/install-radius.sh diff --git a/.github/scripts/install-radius.sh b/.github/scripts/install-radius.sh new file mode 100644 index 00000000..48e9ebab --- /dev/null +++ b/.github/scripts/install-radius.sh @@ -0,0 +1,40 @@ +# ------------------------------------------------------------ +# Copyright 2023 The Radius Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ------------------------------------------------------------ + +set -xe + +VERSION=$1 +RAD_CLI_URL=https://raw.githubusercontent.com/radius-project/radius/main/deploy/install.sh +RAD_CLI_EDGE_URL=ghcr.io/radius-project/rad/linux-amd64:latest + +if [[ $VERSION == "edge" ]]; then + echo Downloading rad CLI edge version + oras pull $RAD_CLI_EDGE_URL + # TEMP: https://github.com/radius-project/radius/issues/6633 + mv ./dist/linux_amd64/release/rad ./rad + chmod +x ./rad + mv ./rad /usr/local/bin/rad +elif [[ $VERSION != *"rc"* ]]; then + INPUT_CHANNEL=$(echo $VERSION | cut -d '.' -f 1,2) + echo "Downloading rad CLI version $INPUT_CHANNEL" + wget -q $RAD_CLI_URL -O - | /bin/bash -s $INPUT_CHANNEL +elif [[ -n $VERSION ]]; then + echo Downloading rad CLI version $VERSION + wget -q $RAD_CLI_URL -O - | /bin/bash -s $VERSION +else + echo Downloading latest rad CLI + wget -q $RAD_CLI_URL -O - | /bin/bash +fi diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1905fde2..4b275720 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,7 +23,6 @@ on: schedule: # 7:45 AM Pacific Time - cron: "45 15 * * *" env: - RAD_CLI_URL: https://raw.githubusercontent.com/radius-project/radius/main/deploy/install.sh RUN_IDENTIFIER: samplestest-${{ github.run_id }}-${{ github.run_attempt }} jobs: test: @@ -182,23 +181,7 @@ jobs: - name: Download rad CLI if: steps.gen-id.outputs.RUN_TEST == 'true' run: | - for attempt in 1 2 3 4 5; do - if [[ -n "${{ inputs.version }}" && "${{ inputs.version }}" != "edge" && "${{ inputs.version }}" != *"rc"* ]]; then - INPUT_CHANNEL=$(echo "${{ inputs.version }}" | cut -d '.' -f 1,2) - echo "Downloading rad CLI version $INPUT_CHANNEL" - wget -q "${{ env.RAD_CLI_URL }}" -O - | /bin/bash -s $INPUT_CHANNEL - elif [[ -n "${{ inputs.version }}" ]]; then - echo "Downloading rad CLI version ${{ inputs.version }}" - wget -q "${{ env.RAD_CLI_URL }}" -O - | /bin/bash -s ${{ inputs.version }} - else - echo "Downloading latest rad CLI" - wget -q "${{ env.RAD_CLI_URL }}" -O - | /bin/bash - fi - - if [ $? -eq 0 ]; then - break - fi - done + ./.github/scripts/install-radius.sh ${{ inputs.version }} - name: Initialize local environment if: steps.gen-id.outputs.RUN_TEST == 'true' run: | From d7699abc59ff4734cbbe2a6b4b76863e9fd5c5a8 Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Thu, 2 Nov 2023 10:47:40 -0700 Subject: [PATCH 02/15] chmod Signed-off-by: willdavsmith --- .github/scripts/install-radius.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/scripts/install-radius.sh diff --git a/.github/scripts/install-radius.sh b/.github/scripts/install-radius.sh old mode 100644 new mode 100755 From aa2178aaff08c3057e48248b4c740892314603ad Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Thu, 2 Nov 2023 12:12:51 -0700 Subject: [PATCH 03/15] test Signed-off-by: willdavsmith --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4b275720..4cdc8ce4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -215,6 +215,7 @@ jobs: namespace="default-${{ matrix.app }}" label="radapp.io/application=${{ matrix.app }}" kubectl wait --for=condition=Ready pod -l $label -n $namespace --timeout=5m + k describe pods -l $label -n $namespace - name: Run Playwright Test if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.uiTestFile != '' id: run-playwright-test From deff66ad259adaaaad6b191a4d913f8a792e31ab Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Thu, 2 Nov 2023 12:24:32 -0700 Subject: [PATCH 04/15] test Signed-off-by: willdavsmith --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4cdc8ce4..61f1c807 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -215,7 +215,7 @@ jobs: namespace="default-${{ matrix.app }}" label="radapp.io/application=${{ matrix.app }}" kubectl wait --for=condition=Ready pod -l $label -n $namespace --timeout=5m - k describe pods -l $label -n $namespace + kubectl describe pods -l $label -n $namespace - name: Run Playwright Test if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.uiTestFile != '' id: run-playwright-test From b50fccf74334585196977ecc0b453afdc7704f8a Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Thu, 2 Nov 2023 12:34:32 -0700 Subject: [PATCH 05/15] test Signed-off-by: willdavsmith --- .github/workflows/test.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 61f1c807..c74b716f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -216,6 +216,10 @@ jobs: label="radapp.io/application=${{ matrix.app }}" kubectl wait --for=condition=Ready pod -l $label -n $namespace --timeout=5m kubectl describe pods -l $label -n $namespace + - name: Wait for all pods to be ready2 + if: steps.gen-id.outputs.RUN_TEST == 'true' + run: | + kubectl describe pods -l $label -n $namespace - name: Run Playwright Test if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.uiTestFile != '' id: run-playwright-test From 64e900c34d54eec81699766771671aa5d6505fe9 Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Thu, 2 Nov 2023 13:06:22 -0700 Subject: [PATCH 06/15] test Signed-off-by: willdavsmith --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c74b716f..da97e107 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -217,7 +217,7 @@ jobs: kubectl wait --for=condition=Ready pod -l $label -n $namespace --timeout=5m kubectl describe pods -l $label -n $namespace - name: Wait for all pods to be ready2 - if: steps.gen-id.outputs.RUN_TEST == 'true' + if: always() run: | kubectl describe pods -l $label -n $namespace - name: Run Playwright Test From 00d6c5121e326d2ebb01066ca5149cedd8ce22ff Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Thu, 2 Nov 2023 13:34:19 -0700 Subject: [PATCH 07/15] test Signed-off-by: willdavsmith --- .github/workflows/test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index da97e107..8e4881fc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -215,10 +215,11 @@ jobs: namespace="default-${{ matrix.app }}" label="radapp.io/application=${{ matrix.app }}" kubectl wait --for=condition=Ready pod -l $label -n $namespace --timeout=5m - kubectl describe pods -l $label -n $namespace - name: Wait for all pods to be ready2 if: always() run: | + namespace="default-${{ matrix.app }}" + label="radapp.io/application=${{ matrix.app }}" kubectl describe pods -l $label -n $namespace - name: Run Playwright Test if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.uiTestFile != '' From 246fcf8392938903791d410f700c3048bc6499fe Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Thu, 2 Nov 2023 14:03:00 -0700 Subject: [PATCH 08/15] test Signed-off-by: willdavsmith --- .github/workflows/test.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8e4881fc..8e0e7f24 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -214,12 +214,16 @@ jobs: run: | namespace="default-${{ matrix.app }}" label="radapp.io/application=${{ matrix.app }}" + kubectl get pods -l $label -n $namespace + kubectl get pod -A --no-headers |awk '{arr[$4]++}END{for (a in arr) print a, arr[a]}' kubectl wait --for=condition=Ready pod -l $label -n $namespace --timeout=5m - name: Wait for all pods to be ready2 if: always() run: | namespace="default-${{ matrix.app }}" label="radapp.io/application=${{ matrix.app }}" + kubectl get pod -A --no-headers |awk '{arr[$4]++}END{for (a in arr) print a, arr[a]}' + kubectl get pods -l $label -n $namespace kubectl describe pods -l $label -n $namespace - name: Run Playwright Test if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.uiTestFile != '' From 3c67c62a2d9583baccfdac174d18ec5b1748ce7f Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Thu, 2 Nov 2023 15:02:44 -0700 Subject: [PATCH 09/15] test Signed-off-by: willdavsmith --- .github/scripts/install-radius.sh | 2 +- .github/workflows/test.yaml | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/scripts/install-radius.sh b/.github/scripts/install-radius.sh index 48e9ebab..23d0265f 100755 --- a/.github/scripts/install-radius.sh +++ b/.github/scripts/install-radius.sh @@ -27,7 +27,7 @@ if [[ $VERSION == "edge" ]]; then mv ./dist/linux_amd64/release/rad ./rad chmod +x ./rad mv ./rad /usr/local/bin/rad -elif [[ $VERSION != *"rc"* ]]; then +elif [[ -n $VERSION && $VERSION != *"rc"* ]]; then INPUT_CHANNEL=$(echo $VERSION | cut -d '.' -f 1,2) echo "Downloading rad CLI version $INPUT_CHANNEL" wget -q $RAD_CLI_URL -O - | /bin/bash -s $INPUT_CHANNEL diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8e0e7f24..7a49e185 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -214,17 +214,7 @@ jobs: run: | namespace="default-${{ matrix.app }}" label="radapp.io/application=${{ matrix.app }}" - kubectl get pods -l $label -n $namespace - kubectl get pod -A --no-headers |awk '{arr[$4]++}END{for (a in arr) print a, arr[a]}' - kubectl wait --for=condition=Ready pod -l $label -n $namespace --timeout=5m - - name: Wait for all pods to be ready2 - if: always() - run: | - namespace="default-${{ matrix.app }}" - label="radapp.io/application=${{ matrix.app }}" - kubectl get pod -A --no-headers |awk '{arr[$4]++}END{for (a in arr) print a, arr[a]}' - kubectl get pods -l $label -n $namespace - kubectl describe pods -l $label -n $namespace + k rollout status deployment -n $namespace -l $label --timeout=5m - name: Run Playwright Test if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.uiTestFile != '' id: run-playwright-test From 3b5dbc14ca64e48452c4826d492030de2fb54801 Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Fri, 3 Nov 2023 12:54:17 -0700 Subject: [PATCH 10/15] PR Signed-off-by: willdavsmith --- .github/scripts/install-radius.sh | 2 -- .github/workflows/test.yaml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/scripts/install-radius.sh b/.github/scripts/install-radius.sh index 23d0265f..23af31e2 100755 --- a/.github/scripts/install-radius.sh +++ b/.github/scripts/install-radius.sh @@ -23,8 +23,6 @@ RAD_CLI_EDGE_URL=ghcr.io/radius-project/rad/linux-amd64:latest if [[ $VERSION == "edge" ]]; then echo Downloading rad CLI edge version oras pull $RAD_CLI_EDGE_URL - # TEMP: https://github.com/radius-project/radius/issues/6633 - mv ./dist/linux_amd64/release/rad ./rad chmod +x ./rad mv ./rad /usr/local/bin/rad elif [[ -n $VERSION && $VERSION != *"rc"* ]]; then diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7a49e185..b8bee469 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -214,7 +214,7 @@ jobs: run: | namespace="default-${{ matrix.app }}" label="radapp.io/application=${{ matrix.app }}" - k rollout status deployment -n $namespace -l $label --timeout=5m + kubectl rollout status deployment -n $namespace -l $label --timeout=5m - name: Run Playwright Test if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.uiTestFile != '' id: run-playwright-test From eff21b02900d13507efe208340048575269bc097 Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Fri, 3 Nov 2023 13:39:22 -0700 Subject: [PATCH 11/15] PR Signed-off-by: willdavsmith --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b8bee469..4b275720 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -214,7 +214,7 @@ jobs: run: | namespace="default-${{ matrix.app }}" label="radapp.io/application=${{ matrix.app }}" - kubectl rollout status deployment -n $namespace -l $label --timeout=5m + kubectl wait --for=condition=Ready pod -l $label -n $namespace --timeout=5m - name: Run Playwright Test if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.uiTestFile != '' id: run-playwright-test From 9c9a7cad6e63c051ad6b72078c7a921e8d84fe79 Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Fri, 3 Nov 2023 13:54:47 -0700 Subject: [PATCH 12/15] PR Signed-off-by: willdavsmith --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4b275720..fb787cbc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -214,6 +214,7 @@ jobs: run: | namespace="default-${{ matrix.app }}" label="radapp.io/application=${{ matrix.app }}" + kubectl rollout status deployment -n $namespace -l $label--timeout=5m kubectl wait --for=condition=Ready pod -l $label -n $namespace --timeout=5m - name: Run Playwright Test if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.uiTestFile != '' From 695db28d8c27f4770a511041dbabc2d038b5a214 Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Fri, 3 Nov 2023 14:47:58 -0700 Subject: [PATCH 13/15] PR Signed-off-by: willdavsmith --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fb787cbc..4604c5b8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -214,7 +214,7 @@ jobs: run: | namespace="default-${{ matrix.app }}" label="radapp.io/application=${{ matrix.app }}" - kubectl rollout status deployment -n $namespace -l $label--timeout=5m + kubectl rollout status deployment -n $namespace -l $label --timeout=5m kubectl wait --for=condition=Ready pod -l $label -n $namespace --timeout=5m - name: Run Playwright Test if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.uiTestFile != '' From 44ec433e9cb2e17a93371522761693f89ffc26ca Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Fri, 3 Nov 2023 14:59:30 -0700 Subject: [PATCH 14/15] PR Signed-off-by: willdavsmith --- .github/workflows/test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4604c5b8..4b275720 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -214,7 +214,6 @@ jobs: run: | namespace="default-${{ matrix.app }}" label="radapp.io/application=${{ matrix.app }}" - kubectl rollout status deployment -n $namespace -l $label --timeout=5m kubectl wait --for=condition=Ready pod -l $label -n $namespace --timeout=5m - name: Run Playwright Test if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.uiTestFile != '' From 75f4b7d8d8c40ba67a96a6c3afe12582860ba83d Mon Sep 17 00:00:00 2001 From: willdavsmith Date: Mon, 6 Nov 2023 10:38:08 -0800 Subject: [PATCH 15/15] PR Signed-off-by: willdavsmith --- .github/workflows/test.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4b275720..4b0462fe 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -181,7 +181,11 @@ jobs: - name: Download rad CLI if: steps.gen-id.outputs.RUN_TEST == 'true' run: | - ./.github/scripts/install-radius.sh ${{ inputs.version }} + RADIUS_VERSION="${{ inputs.version }}" + if [[ -z "${{ inputs.version }}" ]]; then + RADIUS_VERSION=edge + fi + ./.github/scripts/install-radius.sh $RADIUS_VERSION - name: Initialize local environment if: steps.gen-id.outputs.RUN_TEST == 'true' run: |