-
Notifications
You must be signed in to change notification settings - Fork 153
116 lines (98 loc) · 4.95 KB
/
flow-node-performance-tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# SPDX-License-Identifier: Apache-2.0
name: "Node: Performance Tests"
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
defaults:
run:
shell: bash
env:
TEST_SCRIPT: ".github/workflows/support/scripts/nightly.sh"
CHECK_ACTIVE: ".github/workflows/support/scripts/loki-logs.sh"
VERSION_MIRRORNODE: "custom"
K8S_CLUSTER: "gke_hedera-testing-1_us-south1-c_nightly-perfnet"
USERNAME: ${{ secrets.TESTING_JENKINS_API_USERNAME }}
PASSWORD: ${{ secrets.TESTING_JENKINS_API_PASSWORD }}
SERVER: ${{ secrets.TESTING_JENKINS_API_SERVER }}
LOKI_ADDR: ${{ secrets.LOKI_ADDR }}
LOKI_USERNAME: ${{ secrets.LOKI_USERNAME }}
LOKI_PASSWORD: ${{ secrets.LOKI_PASSWORD }}
permissions:
id-token: write
contents: read
jobs:
canonical-test:
name: Canonical (10 hour)
runs-on: hiero-network-node-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935 # v2.1.8
with:
workload_identity_provider: "projects/235822363393/locations/global/workloadIdentityPools/hedera-builds-pool/providers/hedera-builds-gh-actions"
service_account: "[email protected]"
- name: Setup Google Cloud SDK
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
- name: Verify Workflow Parameters
id: parameters
run: |
BRANCH_NAME="${{ github.head_ref || github.ref_name }}"
BRANCH_NAME="${BRANCH_NAME##origin/}"
BRANCH_NAME_LOWER="$(echo "${BRANCH_NAME}" | tr '[:upper:]' '[:lower:]')"
BRANCH_NAME_SAFE="$(echo "${BRANCH_NAME_LOWER}" | tr '/' '-' | tr '_' '.')"
echo "branch-name-lower=${BRANCH_NAME_LOWER}" >>"${GITHUB_OUTPUT}"
echo "commit-id-short=$(echo "${{ github.sha }}" | cut -c1-8)" >>"${GITHUB_OUTPUT}"
- name: Check If Release Artifact Exist in Bucket
id: check-if-exist
run: |
set +e
ARTIFACT_NAME="build-${{ steps.parameters.outputs.branch-name-lower }}-${{ steps.parameters.outputs.commit-id-short }}"
ARTIFACT_PATH="gs://${{ secrets.RELEASE_ARTIFACT_BUCKET_NAME }}/${ARTIFACT_NAME}.zip"
echo "ARTIFACT_PATH=${ARTIFACT_PATH}"
while true
do
gsutil -q stat "${ARTIFACT_PATH}"
PATH_EXIST=$?
if [ ${PATH_EXIST} -eq 0 ]; then
echo "Artifact Ready"
break
else
echo "Artifact not ready, wait 2 minutes"
sleep 2m
fi
done
echo "build-version=${ARTIFACT_NAME}" >>"${GITHUB_OUTPUT}"
- name: Reset Network
id: reset-network
run: |
curl -X POST 'https://ci.preprod.hedera-devops.com/generic-webhook-trigger/invoke?token=${{ secrets.JENKINS_NETWORK_RESET }}&command=/devops-reset&text=engnet1%20${{ steps.check-if-exist.outputs.build-version }}&user_id=${{ vars.SLACK_ID }}&user_name=${{ vars.SLACK_USER }}&channel_id=${{ vars.DEVOP_CHANNEL_ID }}&channel_name=${{ vars.DEVOP_CHANNEL_NAME }}'
echo "Sleep 6 minutes for network reset"
sleep 6m
- name: Run LogCLI to Wait for Network Active
id: run-logcli-wait-network-active
run: |
curl -O -L "https://github.com/grafana/loki/releases/download/v2.9.2/logcli-linux-amd64.zip"
unzip logcli-linux-amd64.zip
chmod a+x logcli-linux-amd64
bash "${{ github.workspace }}/${{ env.CHECK_ACTIVE }}" engnet1 7 3 600 "${{ github.workspace }}/logcli-linux-amd64" 0
sleep 9m
- name: Restore Old Signed State
id: restore-old-signed-state
run: |
curl -X POST 'https://ci.preprod.hedera-devops.com/generic-webhook-trigger/invoke?token=${{ secrets.JENKINS_RESTORE_BACKUP }}&command=/devops-restore-backup&text=gs%3A%2F%2Fchillybin%2Fengnet1-state%2Fengnet1-node00%2F${{ vars.GS_STATE }}&user_id=${{ vars.SLACK_ID }}&user_name=${{ vars.SLACK_USER }}&channel_id=${{ vars.DEVOP_CHANNEL_ID }}&channel_name=${{ vars.DEVOP_CHANNEL_NAME }}'
echo "Sleep 18 minutes for network to load"
sleep 20m
- name: Run LogCLI to Wait for Network Active Again
id: run-logcli-wait-network-active-again
run: |
bash "${{ github.workspace }}/${{ env.CHECK_ACTIVE }}" engnet1 7 3 3000 "${{ github.workspace }}/logcli-linux-amd64" 0
- name: Call Test Script
id: call-test-script
run: |
bash "${{ github.workspace }}/${{ env.TEST_SCRIPT }}" "${{ env.USERNAME }}" "${{ env.PASSWORD }}" "${{ env.SERVER }}" "${{ env.K8S_CLUSTER }}" "${{ steps.check-if-exist.outputs.build-version }}" "${{ env.VERSION_MIRRORNODE }}"