From 5c525d470ff2104585a2b21152abbeb1a684e3fe Mon Sep 17 00:00:00 2001 From: Will Smith Date: Mon, 12 Feb 2024 16:34:13 -0800 Subject: [PATCH 1/5] Fixing AWS RDS Purge workflow (#970) --- .github/workflows/purge-aws-rds-snapshots.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/purge-aws-rds-snapshots.yaml b/.github/workflows/purge-aws-rds-snapshots.yaml index ad8fd4e3..6f582140 100644 --- a/.github/workflows/purge-aws-rds-snapshots.yaml +++ b/.github/workflows/purge-aws-rds-snapshots.yaml @@ -3,11 +3,15 @@ on: schedule: # Runs at 00:30 and 12:30 - cron: "30 0,12 * * *" +env: + GH_TOKEN: ${{ github.token }} jobs: purge_rds_snapshots: name: Purge AWS RDS DBInstance snapshots runs-on: [ubuntu-latest] steps: + - name: Checkout code + uses: actions/checkout@v4 - name: Purge AWS RDS DBInstance snapshots run: | ./.github/scripts/purge-aws-rds-snapshots.sh From 9700e143720e7c0c6f14595d2c4463354b30ef4c Mon Sep 17 00:00:00 2001 From: Will Smith Date: Wed, 14 Feb 2024 09:19:42 -0800 Subject: [PATCH 2/5] Add aws login (#974) Signed-off-by: willdavsmith --- .github/workflows/purge-aws-rds-snapshots.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/purge-aws-rds-snapshots.yaml b/.github/workflows/purge-aws-rds-snapshots.yaml index 6f582140..257dd7ba 100644 --- a/.github/workflows/purge-aws-rds-snapshots.yaml +++ b/.github/workflows/purge-aws-rds-snapshots.yaml @@ -5,6 +5,7 @@ on: - cron: "30 0,12 * * *" env: GH_TOKEN: ${{ github.token }} + AWS_REGION: us-west-2 jobs: purge_rds_snapshots: name: Purge AWS RDS DBInstance snapshots @@ -12,6 +13,12 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + - name: Login to AWS + run: | + aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} + aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws configure set region ${{ env.AWS_REGION }} + aws configure set output json - name: Purge AWS RDS DBInstance snapshots run: | ./.github/scripts/purge-aws-rds-snapshots.sh From 26aaa6f4289784fa0b946f46ad577fa2a30e6049 Mon Sep 17 00:00:00 2001 From: Karishma Chawla Date: Fri, 16 Feb 2024 15:07:56 -0800 Subject: [PATCH 3/5] Add GH action to close stale PRs (#977) * Add GH action to close stale PRs Signed-off-by: karishma-chawla <74574173+karishma-chawla@users.noreply.github.com> * Update CONTRIBUTING.md Co-authored-by: Aaron Crawfis Signed-off-by: Karishma Chawla * Update radius repo link Signed-off-by: Karishma Chawla --------- Signed-off-by: karishma-chawla <74574173+karishma-chawla@users.noreply.github.com> Signed-off-by: Karishma Chawla Co-authored-by: karishma-chawla <74574173+karishma-chawla@users.noreply.github.com> Co-authored-by: Aaron Crawfis --- .github/workflows/close-stale-prs.yml | 27 +++++++++++ CONTRIBUTING.md | 70 +++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 .github/workflows/close-stale-prs.yml create mode 100644 CONTRIBUTING.md diff --git a/.github/workflows/close-stale-prs.yml b/.github/workflows/close-stale-prs.yml new file mode 100644 index 00000000..2ac1cd25 --- /dev/null +++ b/.github/workflows/close-stale-prs.yml @@ -0,0 +1,27 @@ +# This workflow warns and then closes PRs that have had no activity for 90 days. +# +# For more information, see: +# https://github.com/actions/stale +name: Close stale pull requests + +on: + schedule: + - cron: '0 18 * * *' # Run the workflow every day at 6PM UTC (10AM PST). + +jobs: + stale: + + runs-on: ubuntu-latest + permissions: + pull-requests: write + + steps: + - uses: actions/stale@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-pr-message: 'This pull request has been automatically marked as stale because it has been inactive for 90 days. Remove stale label or comment or this PR will be closed in 7 days.' + stale-pr-label: 'stale' + days-before-pr-stale: 90 # 3 months + days-before-pr-close: 7 + days-before-issue-stale: -1 + days-before-issue-close: -1 \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..5d94265e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,70 @@ +# Contributing Pull Requests + +## What to work on + +We welcome small pull request contributions from anyone (docs improvements, bug fixes, minor features.) as long as they follow a few guidelines: + +- For very minor changes like correcting a typo feel free to just send a pull request without any ceremony. Otherwise ... +- Please start by [choosing an existing issue](https://github.com/radius-project/samples/issues), or [opening an issue](https://github.com/radius-project/samples/issues/new/choose) to work on. +- The maintainers will respond to your issue, please work with the maintainers to ensure that what you're doing is in scope for the project before writing any code. +- If you have any doubt whether a contribution would be valuable, feel free to ask. + +We the maintainers have discretion over what features and pull requests we accept. Please understand that we are responsible for the long-term support and maintenance of Radius, and so we sometimes need to make hard decisions to limit the scope. For another perspective on this, we really like this [article](https://www.igvita.com/2011/12/19/dont-push-your-pull-requests/). + +## Sending a pull request + +Please submit pull requests using a forked repo and open pull requests against: + +- The default, versioned branch (`v0.30` for example) if you are adding/fixing a sample and it is compatible with the latest release of Radius. +- The `edge` branch if you are contributing a sample that requires a feature that will be available in the next release of Radius. + +When opening a pull request, the form will be pre-populated with our template. Please fill out the template to provide structure to your PR message. If you've already written a good commit message (see below) it will be easy to use with our template. + +A pull request will need to pass the following checkpoints to be accepted: + +- Initial review: a maintainer will review your summary and make sure an appropriate issue is linked +- Testing: automated tests will run against your changes +- Code review: you will get feedback from a maintainer or other contributors in the form of comments + +## Writing a good commit message + +We value good commit messages that are descriptive and meaningful at a glance. A good format to follow is like the following: + +```txt + + +Fixes: # + + + +- a summary of the changes being made +- the rationale for the change +- (optional) anything tricky or difficult as a heads up for reviewers +- (optional) additional follow up work that should be done (with links) +``` + +We **squash** pull-requests as part of the merge process, which means that intermediate commits will have their messages appended. We prefer to have a single commit in the git history for each PR. + +## Code review + +The maintainers or other contributors will add comments to your pull request giving feedback, asking questions, and making suggestions. Please respond to these comments to either continue the discussion or explain whether or not you plan to address the feedback. Ultimately, accepting a pull request is at the maintainer's discretion. + +### Being proactive + +It can be helpful for you to comment on your own PR to point out relevant locations, decisions, opportunities for feedback, and tricky parts. This will help reviewers focus their attention as well as save them time. + +### Resolving Feedback + +You can "resolve" comments on your pull request when you've addressed the feedback: either through discussion or through making a code change. As the contributor of the pull-request feel free to mark comments as resolved when you feel like you've done a reasonable job addressing the feedback. + +If you are the code reviewer, it's your responsibility to follow up (politely) if you feel your feedback has not been addressed adequately. + +### Participating in code review + +We welcome **any contributor or community member** to engage with **any pull request** on our repository. Feel free to make suggestions for improvements and ask questions that are relevant. If you're asking questions for your learning, please make it clear that your questions are "non-blocking" for the pull request. + +See the [code reviewing documentation](https://github.com/radius-project/radius/blob/main/docs/contributing/contributing-code/contributing-code-reviewing/README.md) for guidance on code reviewing. + +## Inactive Pull Requests + +Pull requests that have been inactive for 90 days will be marked with a stale label. They will automatically be closed after a subsequent 7 days of inactivity. This timeframe may be adjusted in the future based on project needs. \ No newline at end of file From 678363c1444f565d65428190871df06bbfcc876a Mon Sep 17 00:00:00 2001 From: Yetkin Timocin Date: Wed, 21 Feb 2024 16:38:12 -0800 Subject: [PATCH 4/5] Adding a secton that waits until the app is ready (#980) Signed-off-by: ytimocin --- .github/workflows/test.yaml | 8 +- playwright/package-lock.json | 176 +++++++++++++++++++---- playwright/package.json | 11 +- playwright/tests/demo/demo.app.spec.ts | 3 + playwright/tests/eshop/eshop.app.spec.ts | 3 + playwright/tests/util/helper.ts | 24 ++++ 6 files changed, 187 insertions(+), 38 deletions(-) create mode 100644 playwright/tests/util/helper.ts diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0bee5a8a..3139a3ec 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,9 +4,9 @@ on: workflow_dispatch: inputs: version: - description: 'Radius version number to use (e.g. 0.1.0, 0.1.0-rc1, edge). Defaults to edge.' + description: "Radius version number to use (e.g. 0.1.0, 0.1.0-rc1, edge). Defaults to edge." required: false - default: 'edge' + default: "edge" type: string push: branches: @@ -76,7 +76,7 @@ jobs: enableDapr: false - name: eshop-azure os: ubuntu-latest - runOnPullRequest: false + runOnPullRequest: true app: eshop env: azure path: ./samples/eshop/eshop.bicep @@ -85,7 +85,7 @@ jobs: enableDapr: false - name: eshop-aws os: ubuntu-latest - runOnPullRequest: false + runOnPullRequest: true app: eshop env: aws path: ./samples/eshop/eshop.bicep diff --git a/playwright/package-lock.json b/playwright/package-lock.json index 0cd663b4..b76d1ac7 100644 --- a/playwright/package-lock.json +++ b/playwright/package-lock.json @@ -9,46 +9,112 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "uuid": "^9.0.0" + "axios": "^1.6.7", + "uuid": "^9.0.1" }, "devDependencies": { - "@playwright/test": "^1.35.0", - "@types/node": "^20.6.0", - "@types/uuid": "^9.0.3", - "typescript": "^5.2.2" + "@playwright/test": "^1.41.2", + "@types/node": "^20.11.19", + "@types/uuid": "^9.0.8", + "typescript": "^5.3.3" } }, "node_modules/@playwright/test": { - "version": "1.35.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.35.0.tgz", - "integrity": "sha512-6qXdd5edCBynOwsz1YcNfgX8tNWeuS9fxy5o59D0rvHXxRtjXRebB4gE4vFVfEMXl/z8zTnAzfOs7aQDEs8G4Q==", + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.41.2.tgz", + "integrity": "sha512-qQB9h7KbibJzrDpkXkYvsmiDJK14FULCCZgEcoe2AvFAS64oCirWTwzTlAYEbKaRxWs5TFesE1Na6izMv3HfGg==", "dev": true, "dependencies": { - "@types/node": "*", - "playwright-core": "1.35.0" + "playwright": "1.41.2" }, "bin": { "playwright": "cli.js" }, "engines": { "node": ">=16" - }, - "optionalDependencies": { - "fsevents": "2.3.2" } }, "node_modules/@types/node": { - "version": "20.6.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.0.tgz", - "integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==", - "dev": true + "version": "20.11.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", + "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/uuid": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.3.tgz", - "integrity": "sha512-taHQQH/3ZyI3zP8M/puluDEIEvtQHVYcC6y3N8ijFtAd28+Ey/G4sg1u2gB01S8MwybLOKAp9/yCMu/uR5l3Ug==", + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", + "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", "dev": true }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "dependencies": { + "follow-redirects": "^1.15.4", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", + "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -63,10 +129,47 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/playwright": { + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.2.tgz", + "integrity": "sha512-v0bOa6H2GJChDL8pAeLa/LZC4feoAMbSQm1/jF/ySsWWoaNItvrMP7GEkvEEFyCTUYKMxjQKaTSg5up7nR6/8A==", + "dev": true, + "dependencies": { + "playwright-core": "1.41.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, "node_modules/playwright-core": { - "version": "1.35.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.35.0.tgz", - "integrity": "sha512-muMXyPmIx/2DPrCHOD1H1ePT01o7OdKxKj2ebmCAYvqhUy+Y1bpal7B0rdoxros7YrXI294JT/DWw2LqyiqTPA==", + "version": "1.41.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.2.tgz", + "integrity": "sha512-VaTvwCA4Y8kxEe+kfm2+uUUw5Lubf38RxF7FpBxLPmGe5sdNkSg5e3ChEigaGrX7qdqT3pt2m/98LiyvU2x6CA==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -75,10 +178,15 @@ "node": ">=16" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -88,10 +196,20 @@ "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { "uuid": "dist/bin/uuid" } diff --git a/playwright/package.json b/playwright/package.json index 1a52aee0..a6d72f61 100644 --- a/playwright/package.json +++ b/playwright/package.json @@ -8,12 +8,13 @@ "author": "", "license": "ISC", "devDependencies": { - "@playwright/test": "^1.35.0", - "@types/node": "^20.6.0", - "@types/uuid": "^9.0.3", - "typescript": "^5.2.2" + "@playwright/test": "^1.41.2", + "@types/node": "^20.11.19", + "@types/uuid": "^9.0.8", + "typescript": "^5.3.3" }, "dependencies": { - "uuid": "^9.0.0" + "axios": "^1.6.7", + "uuid": "^9.0.1" } } diff --git a/playwright/tests/demo/demo.app.spec.ts b/playwright/tests/demo/demo.app.spec.ts index 1d69fa67..84256f5e 100644 --- a/playwright/tests/demo/demo.app.spec.ts +++ b/playwright/tests/demo/demo.app.spec.ts @@ -1,5 +1,6 @@ import { test, expect } from "@playwright/test"; import { v4 as uuidv4 } from "uuid"; +import { waitForWebApp } from "../util/helper"; test("To-Do App Basic UI Checks", async ({ page }) => { // Listen for all console events and handle errors @@ -9,6 +10,8 @@ test("To-Do App Basic UI Checks", async ({ page }) => { } }); + await waitForWebApp("http://localhost:3000/"); + // Go to http://localhost:3000/ await page.goto("http://localhost:3000/"); diff --git a/playwright/tests/eshop/eshop.app.spec.ts b/playwright/tests/eshop/eshop.app.spec.ts index 0b67ab26..68d58691 100644 --- a/playwright/tests/eshop/eshop.app.spec.ts +++ b/playwright/tests/eshop/eshop.app.spec.ts @@ -1,4 +1,5 @@ import { test, expect } from "@playwright/test"; +import { waitForWebApp } from "../util/helper"; test("eShop on Containers App Basic UI and Functionality Checks", async ({ page }) => { // Listen for all console events and handle errors @@ -13,6 +14,8 @@ test("eShop on Containers App Basic UI and Functionality Checks", async ({ page // Remove quotes from the endpoint if they exist endpoint = (endpoint as string).replace(/['"]+/g, '') + + await waitForWebApp(endpoint); await page.goto(endpoint); diff --git a/playwright/tests/util/helper.ts b/playwright/tests/util/helper.ts new file mode 100644 index 00000000..45a5b500 --- /dev/null +++ b/playwright/tests/util/helper.ts @@ -0,0 +1,24 @@ +import axios from "axios"; + +export async function waitForWebApp(url: string | undefined, timeout = 30000) { + if (!url) { + throw new Error("URL is not defined"); + } + + const startTime = Date.now(); + while (true) { + try { + await axios.get(url); + console.log(`Web application is ready: ${url}`); + break; + } catch (error) { + console.log(`Web application is not ready: ${url}`); + if (Date.now() - startTime > timeout) { + throw new Error( + `Web application not ready after ${timeout} ms: ${url}` + ); + } + await new Promise((resolve) => setTimeout(resolve, 1000)); + } + } +} From 939ee4107161cb14e410c02ed17bd0280c639a7c Mon Sep 17 00:00:00 2001 From: Will <28876888+willtsai@users.noreply.github.com> Date: Thu, 22 Feb 2024 11:01:11 -0800 Subject: [PATCH 5/5] Update images for guestbook sample app (#986) * update images for guestbook sample app Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com> * update images for guestbook sample app Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com> * move images to /samples path Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com> --------- Signed-off-by: Will Tsai <28876888+willtsai@users.noreply.github.com> --- samples/kubernetes/guestbook/deploy/frontend-deployment.yaml | 2 +- .../kubernetes/guestbook/deploy/redis-replica-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/kubernetes/guestbook/deploy/frontend-deployment.yaml b/samples/kubernetes/guestbook/deploy/frontend-deployment.yaml index 2b08cc9d..9c8b42d5 100644 --- a/samples/kubernetes/guestbook/deploy/frontend-deployment.yaml +++ b/samples/kubernetes/guestbook/deploy/frontend-deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: php-redis - image: gcr.io/google-samples/gb-frontend:v4 + image: ghcr.io/radius-project/samples/gb-frontend:v4 resources: requests: cpu: 100m diff --git a/samples/kubernetes/guestbook/deploy/redis-replica-deployment.yaml b/samples/kubernetes/guestbook/deploy/redis-replica-deployment.yaml index c1e8ca31..9ce86511 100644 --- a/samples/kubernetes/guestbook/deploy/redis-replica-deployment.yaml +++ b/samples/kubernetes/guestbook/deploy/redis-replica-deployment.yaml @@ -18,7 +18,7 @@ spec: spec: containers: - name: slave - image: gcr.io/google_samples/gb-redisslave:v1 + image: ghcr.io/radius-project/samples/gb-redisreplica:v1 resources: requests: cpu: 100m