From 3717d59189591208a44793a232fe05fbd5888714 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Wed, 7 Aug 2024 13:22:19 +0300 Subject: [PATCH 01/28] Push workflow --- .github/workflows/issue_creation.yml | 55 ++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/issue_creation.yml diff --git a/.github/workflows/issue_creation.yml b/.github/workflows/issue_creation.yml new file mode 100644 index 0000000000..3f893a3d95 --- /dev/null +++ b/.github/workflows/issue_creation.yml @@ -0,0 +1,55 @@ +name: Create Issue if Not Exists + +on: + push: + branches: + - development_issue_creation + +jobs: + create_issue: + runs-on: ubuntu-latest + steps: + - name: Check out the repository + uses: actions/checkout@v3 + + - name: Set issue title and body + id: set_issue + run: | + ISSUE_TITLE="New Issue Title" + ISSUE_BODY="This is the body of the new issue." + echo "::set-output name=issue_title::$ISSUE_TITLE" + echo "::set-output name=issue_body::$ISSUE_BODY" + + - name: Check for existing issues + id: check_issue + uses: actions/github-script@v6 + with: + script: | + const title = process.env.ISSUE_TITLE; + const { data: issues } = await github.rest.issues.listForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + }); + + const issueExists = issues.some(issue => issue.title === title); + return { issueExists: issueExists }; + + - name: Create a new issue if not exists + if: steps.check_issue.outputs.issueExists == 'false' + uses: actions/github-script@v6 + with: + script: | + const title = process.env.ISSUE_TITLE; + const body = process.env.ISSUE_BODY; + + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: title, + body: body + }); + + - name: Issue already exists + if: steps.check_issue.outputs.issueExists == 'true' + run: echo "Issue with title '${{ steps.set_issue.outputs.issue_title }}' already exists." From e6675fd86835283c7c1ccaa05a03502efdb03ebe Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Wed, 7 Aug 2024 17:02:55 +0300 Subject: [PATCH 02/28] Update workflow, add issue template --- .github/issue_template.md | 4 ++ .github/workflows/issue_creation.yml | 58 +++++++--------------------- 2 files changed, 17 insertions(+), 45 deletions(-) create mode 100644 .github/issue_template.md diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 0000000000..cdf7ce101e --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,4 @@ +--- +title: Someone just pushed +labels: bug +--- diff --git a/.github/workflows/issue_creation.yml b/.github/workflows/issue_creation.yml index 3f893a3d95..fb22fb23d7 100644 --- a/.github/workflows/issue_creation.yml +++ b/.github/workflows/issue_creation.yml @@ -1,55 +1,23 @@ name: Create Issue if Not Exists -on: +# .github/workflows/issue-on-push.yml +on: push: branches: - development_issue_creation +permissions: + contents: read + issues: write jobs: - create_issue: + stuff: runs-on: ubuntu-latest steps: - - name: Check out the repository - uses: actions/checkout@v3 - - - name: Set issue title and body - id: set_issue - run: | - ISSUE_TITLE="New Issue Title" - ISSUE_BODY="This is the body of the new issue." - echo "::set-output name=issue_title::$ISSUE_TITLE" - echo "::set-output name=issue_body::$ISSUE_BODY" - - - name: Check for existing issues - id: check_issue - uses: actions/github-script@v6 + - uses: actions/checkout@v3 + - uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - script: | - const title = process.env.ISSUE_TITLE; - const { data: issues } = await github.rest.issues.listForRepo({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open' - }); - - const issueExists = issues.some(issue => issue.title === title); - return { issueExists: issueExists }; - - - name: Create a new issue if not exists - if: steps.check_issue.outputs.issueExists == 'false' - uses: actions/github-script@v6 - with: - script: | - const title = process.env.ISSUE_TITLE; - const body = process.env.ISSUE_BODY; - - await github.rest.issues.create({ - owner: context.repo.owner, - repo: context.repo.repo, - title: title, - body: body - }); - - - name: Issue already exists - if: steps.check_issue.outputs.issueExists == 'true' - run: echo "Issue with title '${{ steps.set_issue.outputs.issue_title }}' already exists." + search_existing: all + filename: .github/issue_template.md + \ No newline at end of file From 93f39bede9eb67960dfd6532c96b8c6f10cdf8cd Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Wed, 7 Aug 2024 17:04:58 +0300 Subject: [PATCH 03/28] test workflow --- .github/workflows/issue_creation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/issue_creation.yml b/.github/workflows/issue_creation.yml index fb22fb23d7..46e7a8d3d6 100644 --- a/.github/workflows/issue_creation.yml +++ b/.github/workflows/issue_creation.yml @@ -6,6 +6,7 @@ on: branches: - development_issue_creation + permissions: contents: read issues: write From 21d59a1dc134410ef53ffbd196a1abca1b46c2e2 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Wed, 7 Aug 2024 17:07:01 +0300 Subject: [PATCH 04/28] Update search_existing --- .github/workflows/issue_creation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/issue_creation.yml b/.github/workflows/issue_creation.yml index 46e7a8d3d6..97d10e75c7 100644 --- a/.github/workflows/issue_creation.yml +++ b/.github/workflows/issue_creation.yml @@ -6,7 +6,7 @@ on: branches: - development_issue_creation - + permissions: contents: read issues: write @@ -19,6 +19,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - search_existing: all + search_existing: open filename: .github/issue_template.md \ No newline at end of file From f80467dc8ce60cc2967b5d34735f8716503d31e1 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Wed, 7 Aug 2024 17:09:32 +0300 Subject: [PATCH 05/28] add update_existing --- .github/workflows/issue_creation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/issue_creation.yml b/.github/workflows/issue_creation.yml index 97d10e75c7..89b8c6c092 100644 --- a/.github/workflows/issue_creation.yml +++ b/.github/workflows/issue_creation.yml @@ -19,6 +19,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + update_existing: false search_existing: open filename: .github/issue_template.md \ No newline at end of file From 0ec163c3715dae2dc2f7f77c3cb7b815c970eef9 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Wed, 7 Aug 2024 17:22:46 +0300 Subject: [PATCH 06/28] Edit workflow --- .github/workflows/issue_creation.yml | 58 ++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/.github/workflows/issue_creation.yml b/.github/workflows/issue_creation.yml index 89b8c6c092..e81ebb39f7 100644 --- a/.github/workflows/issue_creation.yml +++ b/.github/workflows/issue_creation.yml @@ -1,25 +1,59 @@ name: Create Issue if Not Exists -# .github/workflows/issue-on-push.yml on: push: branches: - development_issue_creation - permissions: contents: read - issues: write + issues: write + jobs: - stuff: + create_issue: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: JasonEtco/create-an-issue@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Check out the repository + uses: actions/checkout@v3 + + - name: Generate Dynamic Issue Title and Content + id: generate_issue + run: | + ISSUE_TITLE="Issue from push: $(date +'%Y-%m-%d %H:%M:%S')" + ISSUE_BODY="This issue was automatically created based on a push to the development_issue_creation branch.\n\nTimestamp: $(date +'%Y-%m-%d %H:%M:%S')" + echo "::set-output name=title::$ISSUE_TITLE" + echo "::set-output name=body::$ISSUE_BODY" + + - name: Check for existing issues + id: check_issue + uses: actions/github-script@v6 with: - update_existing: false - search_existing: open - filename: .github/issue_template.md - \ No newline at end of file + script: | + const title = "${{ steps.generate_issue.outputs.title }}"; + const { data: issues } = await github.rest.issues.listForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + }); + + const issueExists = issues.some(issue => issue.title === title); + return { issueExists: issueExists }; + + - name: Create a new issue if not exists + if: steps.check_issue.outputs.issueExists == 'false' + uses: actions/github-script@v6 + with: + script: | + const title = "${{ steps.generate_issue.outputs.title }}"; + const body = "${{ steps.generate_issue.outputs.body }}"; + + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: title, + body: body + }); + + - name: Issue already exists + if: steps.check_issue.outputs.issueExists == 'true' + run: echo "Issue with title '${{ steps.generate_issue.outputs.title }}' already exists." From 37fb66da75dcefdd0ba74ace188b819e7a8dce50 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Wed, 7 Aug 2024 17:45:24 +0300 Subject: [PATCH 07/28] Edit workflow to get title from env file --- .github/issue_template.md | 2 +- .github/workflows/issue_creation.yml | 57 +++++++--------------------- 2 files changed, 15 insertions(+), 44 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index cdf7ce101e..1994ecab28 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,4 +1,4 @@ --- -title: Someone just pushed +title: Someone just pushed {{ env.ISSUE_TITLE }} labels: bug --- diff --git a/.github/workflows/issue_creation.yml b/.github/workflows/issue_creation.yml index e81ebb39f7..362ed79702 100644 --- a/.github/workflows/issue_creation.yml +++ b/.github/workflows/issue_creation.yml @@ -1,5 +1,6 @@ name: Create Issue if Not Exists +# .github/workflows/issue-on-push.yml on: push: branches: @@ -10,50 +11,20 @@ permissions: issues: write jobs: - create_issue: + stuff: runs-on: ubuntu-latest steps: - - name: Check out the repository - uses: actions/checkout@v3 - - - name: Generate Dynamic Issue Title and Content - id: generate_issue + - name: 'Create env file' run: | - ISSUE_TITLE="Issue from push: $(date +'%Y-%m-%d %H:%M:%S')" - ISSUE_BODY="This issue was automatically created based on a push to the development_issue_creation branch.\n\nTimestamp: $(date +'%Y-%m-%d %H:%M:%S')" - echo "::set-output name=title::$ISSUE_TITLE" - echo "::set-output name=body::$ISSUE_BODY" - - - name: Check for existing issues - id: check_issue - uses: actions/github-script@v6 + touch .env + echo ISSUE_TITLE="Title from Github workflow" >> .env + cat .env + + - uses: actions/checkout@v3 + - uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - script: | - const title = "${{ steps.generate_issue.outputs.title }}"; - const { data: issues } = await github.rest.issues.listForRepo({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open' - }); - - const issueExists = issues.some(issue => issue.title === title); - return { issueExists: issueExists }; - - - name: Create a new issue if not exists - if: steps.check_issue.outputs.issueExists == 'false' - uses: actions/github-script@v6 - with: - script: | - const title = "${{ steps.generate_issue.outputs.title }}"; - const body = "${{ steps.generate_issue.outputs.body }}"; - - await github.rest.issues.create({ - owner: context.repo.owner, - repo: context.repo.repo, - title: title, - body: body - }); - - - name: Issue already exists - if: steps.check_issue.outputs.issueExists == 'true' - run: echo "Issue with title '${{ steps.generate_issue.outputs.title }}' already exists." + update_existing: false + search_existing: open + filename: .github/issue_template.md From c8252da4ce61f1d859e80dd1e2da15d16b302385 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Wed, 7 Aug 2024 17:56:12 +0300 Subject: [PATCH 08/28] Add issue title env --- .github/workflows/issue_creation.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/issue_creation.yml b/.github/workflows/issue_creation.yml index 362ed79702..bb8eeca339 100644 --- a/.github/workflows/issue_creation.yml +++ b/.github/workflows/issue_creation.yml @@ -24,7 +24,8 @@ jobs: - uses: JasonEtco/create-an-issue@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE_TITLE: nenene with: update_existing: false search_existing: open - filename: .github/issue_template.md + filename: .github/issue_template.md \ No newline at end of file From 5877eed1a9f70db54d73490e4aab75391120ef14 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Wed, 7 Aug 2024 17:57:29 +0300 Subject: [PATCH 09/28] test duplication --- .github/workflows/issue_creation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/issue_creation.yml b/.github/workflows/issue_creation.yml index bb8eeca339..ac56c746b5 100644 --- a/.github/workflows/issue_creation.yml +++ b/.github/workflows/issue_creation.yml @@ -1,5 +1,6 @@ name: Create Issue if Not Exists + # .github/workflows/issue-on-push.yml on: push: From 1e0e1fa3fd43412b0b833fc519f17d9879cec8d0 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Wed, 7 Aug 2024 23:16:50 +0300 Subject: [PATCH 10/28] Edit nightly, comment issue creation, edit issue template --- .github/issue_template.md | 18 +++- .github/workflows/grid_client_nightly.yml | 116 ++++++++++------------ .github/workflows/issue_creation.yml | 51 ++++------ 3 files changed, 91 insertions(+), 94 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index 1994ecab28..42f8aa2b81 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,4 +1,18 @@ --- -title: Someone just pushed {{ env.ISSUE_TITLE }} -labels: bug +title: Grid Nightly failed during schedule on ${{ env.NETWORK }} +body: | + ## Failure Report: + + > [!IMPORTANT] + > Details on failed run: https://github.com/tfgrid-sdk-ts/actions/runs/${{ env.RUN_ID }} + + Dynamic Single Vm: ${{ env.SINGLE_VM }} + Multiple Vm: ${{ env.MULTIPLE_VM }} + Kubernetes: ${{ env.K8S }} + Vmq QSFS: ${{ env.VM_QSFS }} + Kubernetes QSFS: ${{ env.K8S_QSFS }} + Kvstore: ${{ env.KV_STORE }} + Zdb: ${{ env.ZDB }} + Delete all contracts: ${{ env.DELETE_ALL }} +labels: type_bug, grid_client --- diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index ce018c2741..c20bebe749 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -2,10 +2,20 @@ name: Grid Client Nightly -on: - schedule: - - cron: "0 4 * * *" - workflow_dispatch: +# on: +# schedule: +# - cron: "0 4 * * *" +# workflow_dispatch: +on: + push: + branches: + - development_issue_creation + +permissions: + contents: read + issues: write + + jobs: deployment-scripts: runs-on: ubuntu-latest @@ -22,17 +32,7 @@ jobs: steps: - uses: actions/checkout@v4 - if: ${{ env.NETWORK == 'dev' }} - - uses: actions/checkout@v4 - if: ${{ env.NETWORK == 'qa' }} - with: - ref: refs/tags/v2.5.2 - - uses: actions/checkout@v4 - if: ${{ env.NETWORK == 'test' }} - with: - ref: refs/tags/v2.5.2 - - uses: actions/checkout@v4 - if: ${{ env.NETWORK == 'main' }} + if: ${{ env.NETWORK == 'dev' }} || ${{ env.NETWORK == 'qa' }} || ${{ env.NETWORK == 'test' }} || ${{ env.NETWORK == 'main' }} with: ref: refs/tags/v2.5.2 @@ -50,46 +50,46 @@ jobs: - name: Install run: | yarn - lerna run build --no-private + make build - name: Run test dynamic single vm - id: dynamicsinglevm - continue-on-error: true + id: single_vm + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/dynamic_single_vm.ts - name: Run test multiple vms - id: multiplevm - continue-on-error: true + id: multiple_vm + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/multiple_vms.ts - name: Run test kubernetes - id: kubernetes - continue-on-error: true + id: k8s + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/orchestrators/kubernetes_leader.ts - name: Run test vm with qsfs id: vmqsfs - continue-on-error: true + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/vm_with_qsfs.ts - name: Run test kubernetes with qsfs - id: kubernetesqsfs - continue-on-error: true + id: k8sqsfs + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/orchestrators/kubernetes_with_qsfs.ts - name: Run test kvstore id: kvstore - continue-on-error: true + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/kvstore_example.ts - name: Run test zdb id: zdb - continue-on-error: true + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/zdb.ts - name: Cleanup - Delete all contracts - id: deleteall + id: delete_all run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/delete_all_contracts.ts @@ -113,51 +113,41 @@ jobs: - name: Test Results run: | - echo Dynamic Single Vm: ${{ steps.dynamicsinglevm.outcome }} - echo Multiple Vm: ${{ steps.multiplevm.outcome }} - echo Kubernetes: ${{ steps.kubernetes.outcome }} + echo Dynamic Single Vm: ${{ steps.single_vm.outcome }} + echo Multiple Vm: ${{ steps.multiple_vm.outcome }} + echo Kubernetes: ${{ steps.k8s.outcome }} echo Vmq Qsfs: ${{ steps.vmqsfs.outcome }} - echo Kubernetes Qsfs: ${{ steps.kubernetesqsfs.outcome }} + echo Kubernetes Qsfs: ${{ steps.k8sqsfs.outcome }} echo Kvstore: ${{ steps.kvstore.outcome }} echo Zdb: ${{ steps.zdb.outcome }} - echo Delete all contracts: ${{ steps.deleteall.outcome }} + echo Delete all contracts: ${{ steps.delete_all.outcome }} - name: Check test script status if: | - steps.dynamicsinglevm.outcome != 'success' || - steps.multiplevm.outcome != 'success' || - steps.kubernetes.outcome != 'success' || + steps.single_vm.outcome != 'success' || + steps.multiple_vm.outcome != 'success' || + steps.k8s.outcome != 'success' || steps.vmqsfs.outcome != 'success' || - steps.kubernetesqsfs.outcome != 'success' || + steps.k8sqsfs.outcome != 'success' || steps.kvstore.outcome != 'success' || steps.zdb.outcome != 'success' || - steps.deleteall.outcome != 'success' + steps.delete_all.outcome != 'success' run: exit 1 - name: Create GitHub Issue on Failure - if: failure() && '$(date +%u)' != '5' && '$(date +%u)' != '6' - uses: dacbd/create-issue-action@main + uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RUN_ID: ${{ github.run_id }} + SINGLE_VM: ${{ steps.single_vm.outcome }} + MULTIPLE_VM: ${{ steps.multiple_vm.outcome }} + K8S: ${{ steps.k8s.outcome }} + VM_QSFS: ${{ steps.vmqsfs.outcome }} + K8S_QSFS: ${{ steps.k8sqsfs.outcome }} + KV_STORE: ${{ steps.kvstore.outcome }} + ZDB: ${{ steps.zdb.outcome }} + DELETE_ALL: ${{ steps.delete_all.outcome }} with: - token: ${{ github.token }} - title: | - ${{ github.workflow }} failed during ${{ github.event_name }} on network ${{ env.NETWORK }} - body: | - ## Failure Report: - - > [!IMPORTANT] - > Details on failed run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - - - Author: @${{ github.triggering_actor }} - - Branch: `${{ github.ref }}` - - Commit: ${{ github.sha }} - - Network: `${{ env.NETWORK }}` - - Dynamic Single Vm: ${{ steps.dynamicsinglevm.outcome }} - Multiple Vm: ${{ steps.multiplevm.outcome }} - Kubernetes: ${{ steps.kubernetes.outcome }} - Vmq Qsfs: ${{ steps.vmqsfs.outcome }} - Kubernetes Qsfs: ${{ steps.kubernetesqsfs.outcome }} - Kvstore: ${{ steps.kvstore.outcome }} - Zdb: ${{ steps.zdb.outcome }} - Delete all contracts: ${{ steps.deleteall.outcome }} - labels: type_bug, grid_client + update_existing: false + search_existing: open + filename: .github/issue_template.md diff --git a/.github/workflows/issue_creation.yml b/.github/workflows/issue_creation.yml index ac56c746b5..b3a8bfb275 100644 --- a/.github/workflows/issue_creation.yml +++ b/.github/workflows/issue_creation.yml @@ -1,32 +1,25 @@ -name: Create Issue if Not Exists +# name: Create Issue if Not Exists +# # .github/workflows/issue-on-push.yml +# on: +# push: +# branches: +# - development_issue_creation -# .github/workflows/issue-on-push.yml -on: - push: - branches: - - development_issue_creation +# permissions: +# contents: read +# issues: write -permissions: - contents: read - issues: write - -jobs: - stuff: - runs-on: ubuntu-latest - steps: - - name: 'Create env file' - run: | - touch .env - echo ISSUE_TITLE="Title from Github workflow" >> .env - cat .env - - - uses: actions/checkout@v3 - - uses: JasonEtco/create-an-issue@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ISSUE_TITLE: nenene - with: - update_existing: false - search_existing: open - filename: .github/issue_template.md \ No newline at end of file +# jobs: +# stuff: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: JasonEtco/create-an-issue@v2 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# ISSUE_TITLE: nenene +# with: +# update_existing: false +# search_existing: open +# filename: .github/issue_template.md \ No newline at end of file From f249ea343803632f86cd78259a27d6c434d83e46 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Wed, 7 Aug 2024 23:36:51 +0300 Subject: [PATCH 11/28] Edit checkout version --- .github/workflows/grid_client_nightly.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index c20bebe749..92eef904fd 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -31,7 +31,7 @@ jobs: SSH_KEY: ${{ secrets.SSH_KEY }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 if: ${{ env.NETWORK == 'dev' }} || ${{ env.NETWORK == 'qa' }} || ${{ env.NETWORK == 'test' }} || ${{ env.NETWORK == 'main' }} with: ref: refs/tags/v2.5.2 @@ -94,7 +94,6 @@ jobs: yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/delete_all_contracts.ts - name: Run check up - List all contracts - id: command_step run: | sleep 15 yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/list_all_contracts.ts > output.txt From 087e2687f23bd5821365110d55b5f5b3e6a1b37f Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Wed, 7 Aug 2024 23:52:01 +0300 Subject: [PATCH 12/28] Checkout repo b4 creating an issue --- .github/workflows/grid_client_nightly.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 92eef904fd..4e960d6717 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -31,7 +31,7 @@ jobs: SSH_KEY: ${{ secrets.SSH_KEY }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 if: ${{ env.NETWORK == 'dev' }} || ${{ env.NETWORK == 'qa' }} || ${{ env.NETWORK == 'test' }} || ${{ env.NETWORK == 'main' }} with: ref: refs/tags/v2.5.2 @@ -133,6 +133,9 @@ jobs: steps.delete_all.outcome != 'success' run: exit 1 + - name: Checkout repository again + uses: actions/checkout@v3 + - name: Create GitHub Issue on Failure uses: JasonEtco/create-an-issue@v2 env: From 1a62f0e867ae305447fa1c8840e6029071587ef7 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 8 Aug 2024 00:52:26 +0300 Subject: [PATCH 13/28] Edit body --- .github/issue_template.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index 42f8aa2b81..edf4d52b88 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,18 +1,17 @@ --- title: Grid Nightly failed during schedule on ${{ env.NETWORK }} body: | - ## Failure Report: + ## Failure Report - > [!IMPORTANT] - > Details on failed run: https://github.com/tfgrid-sdk-ts/actions/runs/${{ env.RUN_ID }} + **Details on failed run**: [View Run Details](https://github.com/tfgrid-sdk-ts/actions/runs/{{ env.RUN_ID }}) - Dynamic Single Vm: ${{ env.SINGLE_VM }} - Multiple Vm: ${{ env.MULTIPLE_VM }} - Kubernetes: ${{ env.K8S }} - Vmq QSFS: ${{ env.VM_QSFS }} - Kubernetes QSFS: ${{ env.K8S_QSFS }} - Kvstore: ${{ env.KV_STORE }} - Zdb: ${{ env.ZDB }} - Delete all contracts: ${{ env.DELETE_ALL }} + - **Dynamic Single Vm**: ({{ env.SINGLE_VM }}) + - **Multiple Vm**: ({{ env.MULTIPLE_VM }}) + - **Kubernetes**: ({{ env.K8S }}) + - **Vmq QSFS**: ({{ env.VM_QSFS }}) + - **Kubernetes QSFS**: ({{ env.K8S_QSFS }}) + - **Kvstore**: ({{ env.KV_STORE }}) + - **Zdb**: ({{ env.ZDB }}) + - **Delete all contracts**: ({{ env.DELETE_ALL }}) labels: type_bug, grid_client --- From b3e72f7b96c36b24b00d54ccad28e6077747d02a Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 8 Aug 2024 01:20:51 +0300 Subject: [PATCH 14/28] Edit nightly --- .github/workflows/grid_client_nightly.yml | 48 +++++++++++++++-------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 4e960d6717..530ffc5f01 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -15,7 +15,6 @@ permissions: contents: read issues: write - jobs: deployment-scripts: runs-on: ubuntu-latest @@ -45,7 +44,7 @@ jobs: - name: Install deps run: | sudo apt-get update - sudo apt-get install -y git libtool tmux redis net-tools + sudo apt-get install -y git libtool tmux redis net-tools jq gh - name: Install run: | @@ -136,20 +135,37 @@ jobs: - name: Checkout repository again uses: actions/checkout@v3 - - name: Create GitHub Issue on Failure - uses: JasonEtco/create-an-issue@v2 + - name: Search for Existing Issues + id: search_issues + run: | + ISSUE_TITLE="Grid Nightly failed during schedule on ${{ env.NETWORK }}" + REPO="${{ github.repository }}" + SEARCH_RESULT=$(gh issue list --repo "$REPO" --search "$ISSUE_TITLE" --json title --jq '.[] | select(.title == "'$ISSUE_TITLE'") | .title') + if [ -n "$SEARCH_RESULT" ]; then + echo "issue_exists=true" >> $GITHUB_ENV + else + echo "issue_exists=false" >> $GITHUB_ENV + fi env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RUN_ID: ${{ github.run_id }} - SINGLE_VM: ${{ steps.single_vm.outcome }} - MULTIPLE_VM: ${{ steps.multiple_vm.outcome }} - K8S: ${{ steps.k8s.outcome }} - VM_QSFS: ${{ steps.vmqsfs.outcome }} - K8S_QSFS: ${{ steps.k8sqsfs.outcome }} - KV_STORE: ${{ steps.kvstore.outcome }} - ZDB: ${{ steps.zdb.outcome }} - DELETE_ALL: ${{ steps.delete_all.outcome }} + + - name: Create GitHub Issue on Failure + if: failure() && ${{ env.issue_exists == 'false' }} + uses: dacbd/create-issue-action@main with: - update_existing: false - search_existing: open - filename: .github/issue_template.md + token: ${{ secrets.GITHUB_TOKEN }} + title: Grid Nightly failed during schedule on ${{ env.NETWORK }} + body: | + ## Failure Report + + **Details on failed run**: [View Run Details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) + + - **Dynamic Single Vm**: ${{ steps.single_vm.outcome }} + - **Multiple Vm**: ${{ steps.multiple_vm.outcome }} + - **Kubernetes**: ${{ steps.k8s.outcome }} + - **Vmq QSFS**: ${{ steps.vmqsfs.outcome }} + - **Kubernetes QSFS**: ${{ steps.k8sqsfs.outcome }} + - **Kvstore**: ${{ steps.kvstore.outcome }} + - **Zdb**: ${{ steps.zdb.outcome }} + - **Delete all contracts**: ${{ steps.delete_all.outcome }} + labels: type_bug, grid_client From 7e32c3949b4f78ec0fedd7a4ddcfb2d689ed3117 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 8 Aug 2024 02:06:36 +0300 Subject: [PATCH 15/28] test envs in issue template --- .github/issue_template.md | 12 ++----- .github/workflows/grid_client_nightly.yml | 40 +++++------------------ 2 files changed, 11 insertions(+), 41 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index edf4d52b88..a9f799dd3f 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -3,15 +3,9 @@ title: Grid Nightly failed during schedule on ${{ env.NETWORK }} body: | ## Failure Report - **Details on failed run**: [View Run Details](https://github.com/tfgrid-sdk-ts/actions/runs/{{ env.RUN_ID }}) + **Test run details** + + - **Run ID**: ${{ env.RUN_ID }} - - **Dynamic Single Vm**: ({{ env.SINGLE_VM }}) - - **Multiple Vm**: ({{ env.MULTIPLE_VM }}) - - **Kubernetes**: ({{ env.K8S }}) - - **Vmq QSFS**: ({{ env.VM_QSFS }}) - - **Kubernetes QSFS**: ({{ env.K8S_QSFS }}) - - **Kvstore**: ({{ env.KV_STORE }}) - - **Zdb**: ({{ env.ZDB }}) - - **Delete all contracts**: ({{ env.DELETE_ALL }}) labels: type_bug, grid_client --- diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 530ffc5f01..935ec40152 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - network: ["dev", "qa", "test", "main"] + network: ["dev"] env: NETWORK: ${{ matrix.network }} RMB_PROXY: true @@ -44,7 +44,7 @@ jobs: - name: Install deps run: | sudo apt-get update - sudo apt-get install -y git libtool tmux redis net-tools jq gh + sudo apt-get install -y git libtool tmux redis net-tools - name: Install run: | @@ -135,37 +135,13 @@ jobs: - name: Checkout repository again uses: actions/checkout@v3 - - name: Search for Existing Issues - id: search_issues - run: | - ISSUE_TITLE="Grid Nightly failed during schedule on ${{ env.NETWORK }}" - REPO="${{ github.repository }}" - SEARCH_RESULT=$(gh issue list --repo "$REPO" --search "$ISSUE_TITLE" --json title --jq '.[] | select(.title == "'$ISSUE_TITLE'") | .title') - if [ -n "$SEARCH_RESULT" ]; then - echo "issue_exists=true" >> $GITHUB_ENV - else - echo "issue_exists=false" >> $GITHUB_ENV - fi + - name: Create GitHub Issue on Failure + uses: JasonEtco/create-an-issue@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RUN_ID: ${{ github.run_id }} - - name: Create GitHub Issue on Failure - if: failure() && ${{ env.issue_exists == 'false' }} - uses: dacbd/create-issue-action@main with: - token: ${{ secrets.GITHUB_TOKEN }} - title: Grid Nightly failed during schedule on ${{ env.NETWORK }} - body: | - ## Failure Report - - **Details on failed run**: [View Run Details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - - - **Dynamic Single Vm**: ${{ steps.single_vm.outcome }} - - **Multiple Vm**: ${{ steps.multiple_vm.outcome }} - - **Kubernetes**: ${{ steps.k8s.outcome }} - - **Vmq QSFS**: ${{ steps.vmqsfs.outcome }} - - **Kubernetes QSFS**: ${{ steps.k8sqsfs.outcome }} - - **Kvstore**: ${{ steps.kvstore.outcome }} - - **Zdb**: ${{ steps.zdb.outcome }} - - **Delete all contracts**: ${{ steps.delete_all.outcome }} - labels: type_bug, grid_client + update_existing: false + search_existing: open + filename: .github/issue_template.md From dfdeeb7bfc28f5fe19e6b014ef682178d5352cd8 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 8 Aug 2024 11:42:51 +0300 Subject: [PATCH 16/28] Search issues before create new one --- .github/workflows/grid_client_nightly.yml | 37 +++++++++++++++++------ 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 935ec40152..3328fee40d 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -44,7 +44,7 @@ jobs: - name: Install deps run: | sudo apt-get update - sudo apt-get install -y git libtool tmux redis net-tools + sudo apt-get install -y git libtool tmux redis net-tools gh jq - name: Install run: | @@ -132,16 +132,33 @@ jobs: steps.delete_all.outcome != 'success' run: exit 1 + - name: Find issues + id: find-issues + run: | + ISSUE_COUNT=$(gh issue list --search "${{github.workflow}} failed during schedule on ${{ env.NETWORK }}" --json title --jq '. | length') + echo "issue_count=$ISSUE_COUNT" >> $GITHUB_ENV + - name: Checkout repository again - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create GitHub Issue on Failure - uses: JasonEtco/create-an-issue@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RUN_ID: ${{ github.run_id }} - + if: failure() && env.issue_count == '0' + uses: dacbd/create-issue-action@main with: - update_existing: false - search_existing: open - filename: .github/issue_template.md + token: ${{ github.token }} + title: ${{github.workflow}} failed during schedule on ${{ env.NETWORK }} + body: | + ## Failure Report + + > [!IMPORTANT] + > **Details on failed run**: [View Run Details](https://github.com/tfgrid-sdk-ts/actions/runs/${{ github.run_id }}) + + - **Dynamic Single Vm**: ${{ steps.single_vm.outcome }} + - **Multiple Vm**: ${{ steps.multiple_vm.outcome }} + - **Kubernetes**: ${{ steps.k8s.outcome }} + - **Vmq QSFS**: ${{ steps.vmqsfs.outcome }} + - **Kubernetes QSFS**: ${{ steps.k8sqsfs.outcome }} + - **Kvstore**: ${{ steps.kvstore.outcome }} + - **Zdb**: ${{ steps.zdb.outcome }} + - **Delete all contracts**: ${{ steps.delete_all.outcome }} + labels: type_bug, grid_client From a67ea139b2dafd7ef1ace9c594fe5837984e2b6a Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 8 Aug 2024 11:57:48 +0300 Subject: [PATCH 17/28] add token to find issues --- .github/workflows/grid_client_nightly.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 3328fee40d..1260d92057 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - network: ["dev"] + network: ["dev", "qa", "test"] env: NETWORK: ${{ matrix.network }} RMB_PROXY: true @@ -134,6 +134,8 @@ jobs: - name: Find issues id: find-issues + env: + GH_TOKEN: ${{ github.token }} run: | ISSUE_COUNT=$(gh issue list --search "${{github.workflow}} failed during schedule on ${{ env.NETWORK }}" --json title --jq '. | length') echo "issue_count=$ISSUE_COUNT" >> $GITHUB_ENV From c4ed7f1fb5b6524f1328d69d087b90f81b42680a Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 8 Aug 2024 12:18:34 +0300 Subject: [PATCH 18/28] Edit workflow url, remove unused files --- .github/issue_template.md | 11 ---------- .github/workflows/grid_client_nightly.yml | 2 +- .github/workflows/issue_creation.yml | 25 ----------------------- 3 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 .github/issue_template.md delete mode 100644 .github/workflows/issue_creation.yml diff --git a/.github/issue_template.md b/.github/issue_template.md deleted file mode 100644 index a9f799dd3f..0000000000 --- a/.github/issue_template.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Grid Nightly failed during schedule on ${{ env.NETWORK }} -body: | - ## Failure Report - - **Test run details** - - - **Run ID**: ${{ env.RUN_ID }} - -labels: type_bug, grid_client ---- diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 1260d92057..2f8549b1c3 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -153,7 +153,7 @@ jobs: ## Failure Report > [!IMPORTANT] - > **Details on failed run**: [View Run Details](https://github.com/tfgrid-sdk-ts/actions/runs/${{ github.run_id }}) + > **Details on failed run**: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{github.job}} - **Dynamic Single Vm**: ${{ steps.single_vm.outcome }} - **Multiple Vm**: ${{ steps.multiple_vm.outcome }} diff --git a/.github/workflows/issue_creation.yml b/.github/workflows/issue_creation.yml deleted file mode 100644 index b3a8bfb275..0000000000 --- a/.github/workflows/issue_creation.yml +++ /dev/null @@ -1,25 +0,0 @@ -# name: Create Issue if Not Exists - -# # .github/workflows/issue-on-push.yml -# on: -# push: -# branches: -# - development_issue_creation - -# permissions: -# contents: read -# issues: write - -# jobs: -# stuff: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: JasonEtco/create-an-issue@v2 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# ISSUE_TITLE: nenene -# with: -# update_existing: false -# search_existing: open -# filename: .github/issue_template.md \ No newline at end of file From aa606440091a2dfa14807c404bd403c0741214b8 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 8 Aug 2024 12:34:09 +0300 Subject: [PATCH 19/28] Enforce running all jobs, fix run url --- .github/workflows/grid_client_nightly.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 2f8549b1c3..808459714d 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -88,16 +88,19 @@ jobs: yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/zdb.ts - name: Cleanup - Delete all contracts + if: always() id: delete_all run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/delete_all_contracts.ts - name: Run check up - List all contracts + if: always() run: | sleep 15 yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/list_all_contracts.ts > output.txt - name: Check if contracts are Empty + if: always() run: | # print the file content cat output.txt @@ -110,6 +113,7 @@ jobs: fi - name: Test Results + if: always() run: | echo Dynamic Single Vm: ${{ steps.single_vm.outcome }} echo Multiple Vm: ${{ steps.multiple_vm.outcome }} @@ -133,6 +137,7 @@ jobs: run: exit 1 - name: Find issues + if: always() id: find-issues env: GH_TOKEN: ${{ github.token }} @@ -153,7 +158,7 @@ jobs: ## Failure Report > [!IMPORTANT] - > **Details on failed run**: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{github.job}} + > **Details on failed run**: https://github.com/threefoldtech/${{ github.repository }}/actions/runs/${{ github.run_id }} - **Dynamic Single Vm**: ${{ steps.single_vm.outcome }} - **Multiple Vm**: ${{ steps.multiple_vm.outcome }} From f15f8f4e11d52229418d9fbfeaeb1cf269973068 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 8 Aug 2024 13:38:51 +0300 Subject: [PATCH 20/28] Edit nightly --- .github/workflows/grid_client_nightly.yml | 49 +++++------------------ 1 file changed, 10 insertions(+), 39 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 808459714d..f496197ea6 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - network: ["dev", "qa", "test"] + network: ["dev", "qa"] env: NETWORK: ${{ matrix.network }} RMB_PROXY: true @@ -31,7 +31,6 @@ jobs: steps: - uses: actions/checkout@v4 - if: ${{ env.NETWORK == 'dev' }} || ${{ env.NETWORK == 'qa' }} || ${{ env.NETWORK == 'test' }} || ${{ env.NETWORK == 'main' }} with: ref: refs/tags/v2.5.2 @@ -53,54 +52,53 @@ jobs: - name: Run test dynamic single vm id: single_vm - if: always() + continue-on-error: true run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/dynamic_single_vm.ts - name: Run test multiple vms id: multiple_vm - if: always() + continue-on-error: true run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/multiple_vms.ts - name: Run test kubernetes id: k8s - if: always() + continue-on-error: true run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/orchestrators/kubernetes_leader.ts - name: Run test vm with qsfs id: vmqsfs - if: always() + continue-on-error: true run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/vm_with_qsfs.ts - name: Run test kubernetes with qsfs id: k8sqsfs - if: always() + continue-on-error: true run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/orchestrators/kubernetes_with_qsfs.ts - name: Run test kvstore id: kvstore - if: always() + continue-on-error: true run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/kvstore_example.ts - name: Run test zdb id: zdb - if: always() + continue-on-error: true run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/zdb.ts - name: Cleanup - Delete all contracts if: always() + continue-on-error: true id: delete_all run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/delete_all_contracts.ts - name: Run check up - List all contracts - if: always() run: | sleep 15 yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/list_all_contracts.ts > output.txt - name: Check if contracts are Empty - if: always() run: | # print the file content cat output.txt @@ -112,32 +110,8 @@ jobs: exit 1 fi - - name: Test Results - if: always() - run: | - echo Dynamic Single Vm: ${{ steps.single_vm.outcome }} - echo Multiple Vm: ${{ steps.multiple_vm.outcome }} - echo Kubernetes: ${{ steps.k8s.outcome }} - echo Vmq Qsfs: ${{ steps.vmqsfs.outcome }} - echo Kubernetes Qsfs: ${{ steps.k8sqsfs.outcome }} - echo Kvstore: ${{ steps.kvstore.outcome }} - echo Zdb: ${{ steps.zdb.outcome }} - echo Delete all contracts: ${{ steps.delete_all.outcome }} - - - name: Check test script status - if: | - steps.single_vm.outcome != 'success' || - steps.multiple_vm.outcome != 'success' || - steps.k8s.outcome != 'success' || - steps.vmqsfs.outcome != 'success' || - steps.k8sqsfs.outcome != 'success' || - steps.kvstore.outcome != 'success' || - steps.zdb.outcome != 'success' || - steps.delete_all.outcome != 'success' - run: exit 1 - - name: Find issues - if: always() + if: failure() id: find-issues env: GH_TOKEN: ${{ github.token }} @@ -145,9 +119,6 @@ jobs: ISSUE_COUNT=$(gh issue list --search "${{github.workflow}} failed during schedule on ${{ env.NETWORK }}" --json title --jq '. | length') echo "issue_count=$ISSUE_COUNT" >> $GITHUB_ENV - - name: Checkout repository again - uses: actions/checkout@v4 - - name: Create GitHub Issue on Failure if: failure() && env.issue_count == '0' uses: dacbd/create-issue-action@main From 9dd03c4d7957a94f9ea75a3e30d88c2553bed273 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 8 Aug 2024 13:53:58 +0300 Subject: [PATCH 21/28] add all networks --- .github/workflows/grid_client_nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index f496197ea6..860b4f51f4 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - network: ["dev", "qa"] + network: ["dev", "qa", "test", "main"] env: NETWORK: ${{ matrix.network }} RMB_PROXY: true From c150268ba3f1d282a0926d3ecc70f4d752d8e6b9 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 8 Aug 2024 14:13:19 +0300 Subject: [PATCH 22/28] Test failed test --- .github/workflows/grid_client_nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 860b4f51f4..ef1af17251 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -55,6 +55,7 @@ jobs: continue-on-error: true run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/dynamic_single_vm.ts + exit 1 - name: Run test multiple vms id: multiple_vm continue-on-error: true From e9c4fe643caa7a18a0f44edca47b94f81973c14f Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 8 Aug 2024 14:39:56 +0300 Subject: [PATCH 23/28] Replace continue-on-err w if:always() --- .github/workflows/grid_client_nightly.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index ef1af17251..e814cd8ac6 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -52,44 +52,43 @@ jobs: - name: Run test dynamic single vm id: single_vm - continue-on-error: true + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/dynamic_single_vm.ts exit 1 - name: Run test multiple vms id: multiple_vm - continue-on-error: true + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/multiple_vms.ts - name: Run test kubernetes id: k8s - continue-on-error: true + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/orchestrators/kubernetes_leader.ts - name: Run test vm with qsfs id: vmqsfs - continue-on-error: true + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/vm_with_qsfs.ts - name: Run test kubernetes with qsfs id: k8sqsfs - continue-on-error: true + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/orchestrators/kubernetes_with_qsfs.ts - name: Run test kvstore id: kvstore - continue-on-error: true + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/kvstore_example.ts - name: Run test zdb id: zdb - continue-on-error: true + if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/zdb.ts - name: Cleanup - Delete all contracts if: always() - continue-on-error: true id: delete_all run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/delete_all_contracts.ts From 32f0c573da656bbe64c135d13887ff78ae19e2bd Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 8 Aug 2024 14:58:17 +0300 Subject: [PATCH 24/28] Final test --- .github/workflows/grid_client_nightly.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index e814cd8ac6..147a6cef5b 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -55,32 +55,37 @@ jobs: if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/dynamic_single_vm.ts - exit 1 + - name: Run test multiple vms id: multiple_vm if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/multiple_vms.ts + - name: Run test kubernetes id: k8s if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/orchestrators/kubernetes_leader.ts + - name: Run test vm with qsfs id: vmqsfs if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/vm_with_qsfs.ts + - name: Run test kubernetes with qsfs id: k8sqsfs if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/orchestrators/kubernetes_with_qsfs.ts + - name: Run test kvstore id: kvstore if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/kvstore_example.ts + - name: Run test zdb id: zdb if: always() @@ -129,7 +134,7 @@ jobs: ## Failure Report > [!IMPORTANT] - > **Details on failed run**: https://github.com/threefoldtech/${{ github.repository }}/actions/runs/${{ github.run_id }} + > **Details on failed run**: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - **Dynamic Single Vm**: ${{ steps.single_vm.outcome }} - **Multiple Vm**: ${{ steps.multiple_vm.outcome }} From 251c59b83a90ff39c92021f7cb7a47c5dec87d40 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Thu, 8 Aug 2024 15:13:40 +0300 Subject: [PATCH 25/28] Run a cron job instead on push --- .github/workflows/grid_client_nightly.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 147a6cef5b..33fe9335e8 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -2,14 +2,10 @@ name: Grid Client Nightly -# on: -# schedule: -# - cron: "0 4 * * *" -# workflow_dispatch: -on: - push: - branches: - - development_issue_creation +on: + schedule: + - cron: "0 4 * * *" + workflow_dispatch: permissions: contents: read From 352b9a98f436d2628e8e12b63464dd3b90e3dfdf Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Mon, 12 Aug 2024 15:54:48 +0300 Subject: [PATCH 26/28] Edit branches in all actions, remove jq installation --- .github/workflows/build.yml | 6 ++++-- .github/workflows/grid_client_nightly.yml | 8 ++++---- .github/workflows/lint.yml | 6 ++++-- .github/workflows/playground_build.yml | 2 -- .github/workflows/yarn_audit.yml | 6 ++++-- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a81393441..28d9bd8285 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,9 +5,11 @@ name: Full Clients Build on: push: - branches: [development, development_2.6] + branches: + - development pull_request: - branches: [development, development_2.6] + branches: + - development jobs: build: diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 33fe9335e8..9e7928d29d 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -3,9 +3,9 @@ name: Grid Client Nightly on: - schedule: - - cron: "0 4 * * *" - workflow_dispatch: + push: + branches: + - development_issue_creation permissions: contents: read @@ -39,7 +39,7 @@ jobs: - name: Install deps run: | sudo apt-get update - sudo apt-get install -y git libtool tmux redis net-tools gh jq + sudo apt-get install -y git libtool tmux redis net-tools gh - name: Install run: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ba40884c5a..780025f397 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,9 +5,11 @@ name: Full Clients Lint on: push: - branches: [development, development_2.6] + branches: + - development pull_request: - branches: [development, development_2.6] + branches: + - development jobs: lint: diff --git a/.github/workflows/playground_build.yml b/.github/workflows/playground_build.yml index 6301773009..d83fc75fc9 100644 --- a/.github/workflows/playground_build.yml +++ b/.github/workflows/playground_build.yml @@ -6,13 +6,11 @@ on: push: branches: - development - - development_2.6 paths: - "packages/playground/**" pull_request: branches: - development - - development_2.6 paths: - "packages/playground/**" diff --git a/.github/workflows/yarn_audit.yml b/.github/workflows/yarn_audit.yml index 4996ba7bae..a0354ee3e2 100644 --- a/.github/workflows/yarn_audit.yml +++ b/.github/workflows/yarn_audit.yml @@ -4,9 +4,11 @@ name: Full Clients Audit on: push: - branches: [development, development_2.6] + branches: + - development pull_request: - branches: [development, development_2.6] + branches: + - development jobs: audit-and-open-issue: From 992fee95adf8968cc046c4cdfa9adc537a1aeade Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Mon, 12 Aug 2024 16:06:32 +0300 Subject: [PATCH 27/28] Fail on purpuse --- .github/workflows/grid_client_nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 9e7928d29d..3d98405794 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -51,6 +51,7 @@ jobs: if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/dynamic_single_vm.ts + exit 1 - name: Run test multiple vms id: multiple_vm From f609f247724ee41362f68e72d6eed873c951c698 Mon Sep 17 00:00:00 2001 From: zaelgohary Date: Mon, 12 Aug 2024 16:41:51 +0300 Subject: [PATCH 28/28] Revert cron job --- .github/workflows/grid_client_nightly.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 3d98405794..c158c5eef9 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -3,10 +3,9 @@ name: Grid Client Nightly on: - push: - branches: - - development_issue_creation - + schedule: + - cron: "0 4 * * *" + workflow_dispatch: permissions: contents: read issues: write @@ -51,7 +50,6 @@ jobs: if: always() run: | yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/dynamic_single_vm.ts - exit 1 - name: Run test multiple vms id: multiple_vm