From f05986bac17a0a79669eddcf521b717d829d697f Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Mon, 3 Jun 2024 09:08:05 +0300 Subject: [PATCH 01/11] automating creating issues --- .github/ISSUE_TEMPLATE/nightly_report.yml | 1 + .github/workflows/grid_client_nightly.yml | 28 ++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/nightly_report.yml diff --git a/.github/ISSUE_TEMPLATE/nightly_report.yml b/.github/ISSUE_TEMPLATE/nightly_report.yml new file mode 100644 index 0000000000..b3ced9d74a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/nightly_report.yml @@ -0,0 +1 @@ +The following test(s) have failed: diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index decd606a95..676bc860d8 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -1,5 +1,3 @@ -# This workflow will install needed dependencies and run main grid tests. - name: Grid Client Nightly on: @@ -42,7 +40,7 @@ jobs: node-version: 18 cache: "yarn" - - name: Install deps + - name: Install dependencies run: | sudo apt-get update sudo apt-get install -y git libtool tmux redis net-tools @@ -123,6 +121,7 @@ jobs: echo Delete all contracts: ${{ steps.deleteall.outcome }} - name: Check test script status + id: check-status if: | steps.dynamicsinglevm.outcome != 'success' || steps.multiplevm.outcome != 'success' || @@ -133,3 +132,26 @@ jobs: steps.zdb.outcome != 'success' || steps.deleteall.outcome != 'success' run: exit 1 + + - name: Set up GitHub CLI + uses: actions/setup-gh@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Check for existing issues + if: failure() + id: check-issues + run: | + existing_issue=$(gh issue list --state open --label bug --json title | jq -r '.[] | select(.title == "Test Failure Detected")') + echo "existing_issue=${existing_issue}" >> $GITHUB_ENV + + - name: Create GitHub Issue on Failure + if: failure() && env.existing_issue == '' + uses: peter-evans/create-issue-from-file@v4 + with: + title: "Test Failure Detected" + content-file: ./.github/ISSUE_TEMPLATE/nightly_report.yml + labels: bug From 3cb80a3b1043328db05a7facaaf1094f6fb95223 Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Mon, 3 Jun 2024 09:21:08 +0300 Subject: [PATCH 02/11] changing path --- .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 676bc860d8..55223af225 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -1,3 +1,5 @@ +# This workflow will install needed dependencies and run main grid tests. + name: Grid Client Nightly on: @@ -40,7 +42,7 @@ jobs: node-version: 18 cache: "yarn" - - name: Install dependencies + - name: Install deps run: | sudo apt-get update sudo apt-get install -y git libtool tmux redis net-tools From 093b7077bb16bb753bb9857844b8bdd8d6d28ca5 Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Tue, 4 Jun 2024 11:41:03 +0300 Subject: [PATCH 03/11] fixing libary --- .github/workflows/grid_client_nightly.yml | 11 ++++-- .../grid_client/docs/api/classes/nodes.html | 38 ++++++++++++++++++- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 55223af225..4a9fe139cf 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -136,9 +136,12 @@ jobs: run: exit 1 - name: Set up GitHub CLI - uses: actions/setup-gh@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} + uses: wusatosi/setup-gh@v1.1 + # with: + # Repository setting for Github CLI + # repository: # optional, default is ${{ github.repository }} + # # Authentication token setting for Github CLI + # token: # optional, default is ${{ github.token }} - name: Install jq run: sudo apt-get install -y jq @@ -152,7 +155,7 @@ jobs: - name: Create GitHub Issue on Failure if: failure() && env.existing_issue == '' - uses: peter-evans/create-issue-from-file@v4 + uses: peter-evans/create-issue-from-file@v5.0.0 with: title: "Test Failure Detected" content-file: ./.github/ISSUE_TEMPLATE/nightly_report.yml diff --git a/packages/grid_client/docs/api/classes/nodes.html b/packages/grid_client/docs/api/classes/nodes.html index 8adcd1c833..227de8edc3 100644 --- a/packages/grid_client/docs/api/classes/nodes.html +++ b/packages/grid_client/docs/api/classes/nodes.html @@ -1 +1,37 @@ -nodes | @threefold/grid_client
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • nodes

Index

Constructors

Properties

client: TFClient

Methods

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Static property
  • Static method
  • Property
  • Private method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +Nodes | @threefold/grid_client
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Nodes

Index

Constructors

  • new Nodes(graphqlURL: string, proxyURL: string, rmbClient: Client): Nodes

Properties

gqlClient: Graphql
graphqlURL: string
proxyURL: string
rmb: RMB

Methods

  • _g2b(GB: number): number
  • allocateDiskToPools(diskPools: number[], disk: number): boolean
  • +

    Allocates a disk of a given size to a list of disk pools.

    +

    Parameters

    • diskPools: number[]
      +

      An array of numbers representing the available disk space in each pool.

      +
    • disk: number
      +

      The size of the disk to be allocated.

      +

    Returns boolean

    A boolean value indicating whether the disk was successfully allocated or not. + Returns true if the disk was allocated to a pool, false otherwise.

    +
  • checkFarmHasFreePublicIps(farmId: number, farms?: FarmInfo[], url?: string): Promise<boolean>
  • fitDisksInDisksPool(disks: number[], pools: number[], type: DiskTypes): void
  • +

    Fits disks into disk pools based on their sizes.

    +
    throws

    {Error} - If the required disk cannot be fitted into the pool.

    +

    Parameters

    • disks: number[]
      +

      An array of disk sizes required to be fitted into the pool.

      +
    • pools: number[]
    • type: DiskTypes
      +

      A DiskTypes enum value representing the type of disk being allocated.

      +

    Returns void

  • getAccessNodes(): Promise<Record<string, unknown>>
  • getAllFarms(url?: string): Promise<FarmInfo[]>
  • getAllNodes(url?: string): Promise<NodeInfo[]>
  • getFarmIdFromFarmName(name: string, farms?: FarmInfo[], url?: string): Promise<number>
  • getFarms(page?: number, pageSize?: number, url?: string): Promise<FarmInfo[]>
  • getNode(nodeId: any, url?: string): Promise<NodeInfo>
  • getNodeFreeResources(nodeId: number, source?: "proxy" | "zos", url?: string): Promise<NodeResources>
  • getNodeIdFromContractId(contractId: number, mnemonic: string): Promise<number>
  • getNodeTwinId(node_id: number): Promise<number>
  • getNodes(page?: number, pageSize?: number, url?: string): Promise<NodeInfo[]>
  • getNodesByFarmId(farmId: number, url?: string): Promise<NodeInfo[]>
  • nodeAvailableForTwinId(nodeId: number, twinId: number): Promise<boolean>
  • nodeHasResources(nodeId: number, options: FilterOptions): Promise<boolean>
  • sortArrayDesc(array: number[]): void
  • verifyNodeStoragePoolCapacity(ssdDisks: number[], hddDisks: number[], rootFileSystemDisks: number[], nodeId: number): Promise<boolean>
  • +

    Verifies the storage pool capacity of a node for different disk types.

    +
    throws

    {Error} - If there is an error in getting the node's information or if the required deployment can't be fitted.

    +

    Parameters

    • ssdDisks: number[]
      +

      An array of SSD disk sizes required for the deployment.

      +
    • hddDisks: number[]
      +

      An array of HDD disk sizes required for the deployment.

      +
    • rootFileSystemDisks: number[]
      +

      An array of disk sizes required for the deployment's root file system.

      +
    • nodeId: number
      +

      The ID of the node to be verified.

      +

    Returns Promise<boolean>

      +
    • True if the node has enough capacity, otherwise false.
    • +
    +

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Static property
  • Static method
  • Property
  • Private method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file From 1d0a13dd97b39cc330476cb9b28b5794536b1b08 Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Tue, 4 Jun 2024 11:57:34 +0300 Subject: [PATCH 04/11] fixing libary --- .github/workflows/grid_client_nightly.yml | 25 ++--------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 4a9fe139cf..4156639000 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -51,22 +51,6 @@ jobs: run: | yarn lerna run build --no-private - - - name: Run test dynamic single vm - id: dynamicsinglevm - 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: multiplevm - 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: kubernetes - continue-on-error: true - run: | - yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/kubernetes.ts - name: Run test vm with qsfs id: vmqsfs continue-on-error: true @@ -113,9 +97,6 @@ jobs: - name: Test Results run: | - echo Dynamic Single Vm: ${{ steps.dynamicsinglevm.outcome }} - echo Multiple Vm: ${{ steps.multiplevm.outcome }} - echo Kubernetes: ${{ steps.kubernetes.outcome }} echo Vmq Qsfs: ${{ steps.vmqsfs.outcome }} echo Kubernetes Qsfs: ${{ steps.kubernetesqsfs.outcome }} echo Kvstore: ${{ steps.kvstore.outcome }} @@ -125,9 +106,6 @@ jobs: - name: Check test script status id: check-status if: | - steps.dynamicsinglevm.outcome != 'success' || - steps.multiplevm.outcome != 'success' || - steps.kubernetes.outcome != 'success' || steps.vmqsfs.outcome != 'success' || steps.kubernetesqsfs.outcome != 'success' || steps.kvstore.outcome != 'success' || @@ -158,5 +136,6 @@ jobs: uses: peter-evans/create-issue-from-file@v5.0.0 with: title: "Test Failure Detected" - content-file: ./.github/ISSUE_TEMPLATE/nightly_report.yml + content-filepath: ./.github/ISSUE_TEMPLATE/nightly_report.yml labels: bug + From aedace68e93cdf72e2719f53444261f3f8a3a992 Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Tue, 4 Jun 2024 12:55:27 +0300 Subject: [PATCH 05/11] test --- .github/workflows/grid_client_nightly.yml | 38 +++++++++++++++++------ 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 4156639000..7ee323a742 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -112,14 +112,9 @@ jobs: steps.zdb.outcome != 'success' || steps.deleteall.outcome != 'success' run: exit 1 - + - name: Set up GitHub CLI uses: wusatosi/setup-gh@v1.1 - # with: - # Repository setting for Github CLI - # repository: # optional, default is ${{ github.repository }} - # # Authentication token setting for Github CLI - # token: # optional, default is ${{ github.token }} - name: Install jq run: sudo apt-get install -y jq @@ -133,9 +128,32 @@ jobs: - name: Create GitHub Issue on Failure if: failure() && env.existing_issue == '' - uses: peter-evans/create-issue-from-file@v5.0.0 + uses: dacbd/create-issue-action@main with: - title: "Test Failure Detected" - content-filepath: ./.github/ISSUE_TEMPLATE/nightly_report.yml - labels: bug + title: | + [${{ github.workflow }}] failed during [${{ github.event_name }} at ${{ github.event.date }}] + 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 }} + - Workflow Path: `${{ github.workflow_ref }}` + + - [ ] **Task**: Review failed run, fix the issue(s), and re-run until successful. + + Vmq Qsfs: ${{ steps.vmqsfs.outcome }} + echo Kubernetes Qsfs: ${{ steps.kubernetesqsfs.outcome }} + echo Kvstore: ${{ steps.kvstore.outcome }} + echo Zdb: ${{ steps.zdb.outcome }} + echo Delete all contracts: ${{ steps.deleteall.outcome }} + > This issue was created automatically by GitHub, + > through `dacbd/create-issue-action@main` action + > **DO NOT** close this issue until resolved. + labels: type_bug , grid_client + content-filepath: ./.github/ISSUE_TEMPLATE/nightly_report.yml + From 0f24e16780fa29fc6fd307dcea3094ead4dd308d Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Tue, 4 Jun 2024 13:02:32 +0300 Subject: [PATCH 06/11] test --- .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 7ee323a742..3b1e9d7412 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -154,6 +154,6 @@ jobs: > through `dacbd/create-issue-action@main` action > **DO NOT** close this issue until resolved. labels: type_bug , grid_client - content-filepath: ./.github/ISSUE_TEMPLATE/nightly_report.yml + # content-filepath: ./.github/ISSUE_TEMPLATE/nightly_report.yml From a6bcbbca4b52ffaa6204fe77ca69ef8f1dbb40b2 Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Tue, 4 Jun 2024 13:10:14 +0300 Subject: [PATCH 07/11] test --- .github/workflows/grid_client_nightly.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 3b1e9d7412..d41cb3810f 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -130,6 +130,7 @@ jobs: if: failure() && env.existing_issue == '' uses: dacbd/create-issue-action@main with: + token: ${{ github.token }} title: | [${{ github.workflow }}] failed during [${{ github.event_name }} at ${{ github.event.date }}] body: | @@ -153,7 +154,5 @@ jobs: > This issue was created automatically by GitHub, > through `dacbd/create-issue-action@main` action > **DO NOT** close this issue until resolved. - labels: type_bug , grid_client - # content-filepath: ./.github/ISSUE_TEMPLATE/nightly_report.yml - + labels: type_bug , grid_client From d6fa0946aa2b2ae3261f430d6407b418db179435 Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Tue, 4 Jun 2024 13:35:57 +0300 Subject: [PATCH 08/11] test --- .github/workflows/grid_client_nightly.yml | 47 ++++++++++++++++------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index d41cb3810f..7248697558 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -51,6 +51,22 @@ jobs: run: | yarn lerna run build --no-private + + - name: Run test dynamic single vm + id: dynamicsinglevm + 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: multiplevm + 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: kubernetes + 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 continue-on-error: true @@ -60,7 +76,7 @@ jobs: id: kubernetesqsfs continue-on-error: true run: | - yarn run ts-node --project packages/grid_client/tsconfig-node.json packages/grid_client/scripts/kubernetes_with_qsfs.ts + 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 @@ -97,6 +113,9 @@ jobs: - name: Test Results run: | + echo Dynamic Single Vm: ${{ steps.dynamicsinglevm.outcome }} + echo Multiple Vm: ${{ steps.multiplevm.outcome }} + echo Kubernetes: ${{ steps.kubernetes.outcome }} echo Vmq Qsfs: ${{ steps.vmqsfs.outcome }} echo Kubernetes Qsfs: ${{ steps.kubernetesqsfs.outcome }} echo Kvstore: ${{ steps.kvstore.outcome }} @@ -104,8 +123,10 @@ jobs: echo Delete all contracts: ${{ steps.deleteall.outcome }} - name: Check test script status - id: check-status if: | + steps.dynamicsinglevm.outcome != 'success' || + steps.multiplevm.outcome != 'success' || + steps.kubernetes.outcome != 'success' || steps.vmqsfs.outcome != 'success' || steps.kubernetesqsfs.outcome != 'success' || steps.kvstore.outcome != 'success' || @@ -123,7 +144,7 @@ jobs: if: failure() id: check-issues run: | - existing_issue=$(gh issue list --state open --label bug --json title | jq -r '.[] | select(.title == "Test Failure Detected")') + existing_issue=$(gh issue list --state open --label bug --json title | jq -r '.[] | select(.title == "${{ github.workflow }} failed during ${{ github.event_name }}")') echo "existing_issue=${existing_issue}" >> $GITHUB_ENV - name: Create GitHub Issue on Failure @@ -132,7 +153,7 @@ jobs: with: token: ${{ github.token }} title: | - [${{ github.workflow }}] failed during [${{ github.event_name }} at ${{ github.event.date }}] + ${{ github.workflow }} failed during ${{ github.event_name }} body: | ## Failure Report: @@ -143,16 +164,16 @@ jobs: - Branch: `${{ github.ref }}` - Commit: ${{ github.sha }} - Workflow Path: `${{ github.workflow_ref }}` - - - [ ] **Task**: Review failed run, fix the issue(s), and re-run until successful. + - Network: `${{ env.NETWORK }}` + + Dynamic Single Vm: ${{ steps.dynamicsinglevm.outcome }} + Multiple Vm: ${{ steps.multiplevm.outcome }} + Kubernetes: ${{ steps.kubernetes.outcome }} Vmq Qsfs: ${{ steps.vmqsfs.outcome }} - echo Kubernetes Qsfs: ${{ steps.kubernetesqsfs.outcome }} - echo Kvstore: ${{ steps.kvstore.outcome }} - echo Zdb: ${{ steps.zdb.outcome }} - echo Delete all contracts: ${{ steps.deleteall.outcome }} - > This issue was created automatically by GitHub, - > through `dacbd/create-issue-action@main` action - > **DO NOT** close this issue until resolved. + Kubernetes Qsfs: ${{ steps.kubernetesqsfs.outcome }} + Kvstore: ${{ steps.kvstore.outcome }} + Zdb: ${{ steps.zdb.outcome }} + Delete all contracts: ${{ steps.deleteall.outcome }} labels: type_bug , grid_client From 7f0948df0306a2686ebfc67c5ef8f20817363138 Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Tue, 4 Jun 2024 14:02:07 +0300 Subject: [PATCH 09/11] test --- .github/ISSUE_TEMPLATE/nightly_report.yml | 1 - .github/workflows/grid_client_nightly.yml | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/nightly_report.yml diff --git a/.github/ISSUE_TEMPLATE/nightly_report.yml b/.github/ISSUE_TEMPLATE/nightly_report.yml deleted file mode 100644 index b3ced9d74a..0000000000 --- a/.github/ISSUE_TEMPLATE/nightly_report.yml +++ /dev/null @@ -1 +0,0 @@ -The following test(s) have failed: diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 7248697558..75b08cc34b 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -144,7 +144,7 @@ jobs: if: failure() id: check-issues run: | - existing_issue=$(gh issue list --state open --label bug --json title | jq -r '.[] | select(.title == "${{ github.workflow }} failed during ${{ github.event_name }}")') + existing_issue=$(gh issue list --state open --json title | jq -r '.[] | select(.title == "${{ github.workflow }} failed during ${{ github.event_name }}")') echo "existing_issue=${existing_issue}" >> $GITHUB_ENV - name: Create GitHub Issue on Failure @@ -153,7 +153,7 @@ jobs: with: token: ${{ github.token }} title: | - ${{ github.workflow }} failed during ${{ github.event_name }} + ${{ github.workflow }} failed during ${{ github.event_name }} on network ${{ env.NETWORK }} body: | ## Failure Report: @@ -163,7 +163,6 @@ jobs: - Author: @${{ github.triggering_actor }} - Branch: `${{ github.ref }}` - Commit: ${{ github.sha }} - - Workflow Path: `${{ github.workflow_ref }}` - Network: `${{ env.NETWORK }}` From d4f18626835ef9600838933894353fadd2d2c292 Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Tue, 4 Jun 2024 14:32:53 +0300 Subject: [PATCH 10/11] adding issue body adding issue creation for all networks --- .github/workflows/grid_client_nightly.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 75b08cc34b..910fa4ca30 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -140,15 +140,7 @@ jobs: - name: Install jq run: sudo apt-get install -y jq - - name: Check for existing issues - if: failure() - id: check-issues - run: | - existing_issue=$(gh issue list --state open --json title | jq -r '.[] | select(.title == "${{ github.workflow }} failed during ${{ github.event_name }}")') - echo "existing_issue=${existing_issue}" >> $GITHUB_ENV - - name: Create GitHub Issue on Failure - if: failure() && env.existing_issue == '' uses: dacbd/create-issue-action@main with: token: ${{ github.token }} From bc3a45844c8cb08845af980a0db7068f8904624c Mon Sep 17 00:00:00 2001 From: khaledyoussef24 Date: Thu, 6 Jun 2024 13:21:47 +0300 Subject: [PATCH 11/11] remove un neccesary lines --- .github/workflows/grid_client_nightly.yml | 6 --- .../grid_client/docs/api/classes/nodes.html | 38 +------------------ 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/.github/workflows/grid_client_nightly.yml b/.github/workflows/grid_client_nightly.yml index 910fa4ca30..07623b11be 100644 --- a/.github/workflows/grid_client_nightly.yml +++ b/.github/workflows/grid_client_nightly.yml @@ -133,12 +133,6 @@ jobs: steps.zdb.outcome != 'success' || steps.deleteall.outcome != 'success' run: exit 1 - - - name: Set up GitHub CLI - uses: wusatosi/setup-gh@v1.1 - - - name: Install jq - run: sudo apt-get install -y jq - name: Create GitHub Issue on Failure uses: dacbd/create-issue-action@main diff --git a/packages/grid_client/docs/api/classes/nodes.html b/packages/grid_client/docs/api/classes/nodes.html index 227de8edc3..8adcd1c833 100644 --- a/packages/grid_client/docs/api/classes/nodes.html +++ b/packages/grid_client/docs/api/classes/nodes.html @@ -1,37 +1 @@ -Nodes | @threefold/grid_client
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Nodes

Index

Constructors

  • new Nodes(graphqlURL: string, proxyURL: string, rmbClient: Client): Nodes

Properties

gqlClient: Graphql
graphqlURL: string
proxyURL: string
rmb: RMB

Methods

  • _g2b(GB: number): number
  • allocateDiskToPools(diskPools: number[], disk: number): boolean
  • -

    Allocates a disk of a given size to a list of disk pools.

    -

    Parameters

    • diskPools: number[]
      -

      An array of numbers representing the available disk space in each pool.

      -
    • disk: number
      -

      The size of the disk to be allocated.

      -

    Returns boolean

    A boolean value indicating whether the disk was successfully allocated or not. - Returns true if the disk was allocated to a pool, false otherwise.

    -
  • checkFarmHasFreePublicIps(farmId: number, farms?: FarmInfo[], url?: string): Promise<boolean>
  • fitDisksInDisksPool(disks: number[], pools: number[], type: DiskTypes): void
  • -

    Fits disks into disk pools based on their sizes.

    -
    throws

    {Error} - If the required disk cannot be fitted into the pool.

    -

    Parameters

    • disks: number[]
      -

      An array of disk sizes required to be fitted into the pool.

      -
    • pools: number[]
    • type: DiskTypes
      -

      A DiskTypes enum value representing the type of disk being allocated.

      -

    Returns void

  • getAccessNodes(): Promise<Record<string, unknown>>
  • getAllFarms(url?: string): Promise<FarmInfo[]>
  • getAllNodes(url?: string): Promise<NodeInfo[]>
  • getFarmIdFromFarmName(name: string, farms?: FarmInfo[], url?: string): Promise<number>
  • getFarms(page?: number, pageSize?: number, url?: string): Promise<FarmInfo[]>
  • getNode(nodeId: any, url?: string): Promise<NodeInfo>
  • getNodeFreeResources(nodeId: number, source?: "proxy" | "zos", url?: string): Promise<NodeResources>
  • getNodeIdFromContractId(contractId: number, mnemonic: string): Promise<number>
  • getNodeTwinId(node_id: number): Promise<number>
  • getNodes(page?: number, pageSize?: number, url?: string): Promise<NodeInfo[]>
  • getNodesByFarmId(farmId: number, url?: string): Promise<NodeInfo[]>
  • nodeAvailableForTwinId(nodeId: number, twinId: number): Promise<boolean>
  • nodeHasResources(nodeId: number, options: FilterOptions): Promise<boolean>
  • sortArrayDesc(array: number[]): void
  • verifyNodeStoragePoolCapacity(ssdDisks: number[], hddDisks: number[], rootFileSystemDisks: number[], nodeId: number): Promise<boolean>
  • -

    Verifies the storage pool capacity of a node for different disk types.

    -
    throws

    {Error} - If there is an error in getting the node's information or if the required deployment can't be fitted.

    -

    Parameters

    • ssdDisks: number[]
      -

      An array of SSD disk sizes required for the deployment.

      -
    • hddDisks: number[]
      -

      An array of HDD disk sizes required for the deployment.

      -
    • rootFileSystemDisks: number[]
      -

      An array of disk sizes required for the deployment's root file system.

      -
    • nodeId: number
      -

      The ID of the node to be verified.

      -

    Returns Promise<boolean>

      -
    • True if the node has enough capacity, otherwise false.
    • -
    -

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Static property
  • Static method
  • Property
  • Private method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +nodes | @threefold/grid_client
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • nodes

Index

Constructors

Properties

client: TFClient

Methods

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Static property
  • Static method
  • Property
  • Private method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file