Skip to content

Commit 828b223

Browse files
committed
Merge commit '1d9452e2400b8fdbf58bb739391143ad215481e6' into 00815-D-timeout-flag
Signed-off-by: Jeffrey Tang <jeffrey@swirldslabs.com> # Conflicts: # examples/custom-network-config/Taskfile.yml
2 parents f19f5fb + 1d9452e commit 828b223

File tree

17 files changed

+1967
-475
lines changed

17 files changed

+1967
-475
lines changed

.github/workflows/flow-task-test.yaml

+13-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ name: "Test Taskfile Commands"
1818
# The purpose of this reusable workflow is to make sure task files are working as expected.
1919

2020
on:
21+
workflow_dispatch:
2122
workflow_call:
2223
pull_request:
2324
types:
@@ -35,6 +36,7 @@ permissions:
3536

3637
jobs:
3738
example-task-file-test:
39+
timeout-minutes: 20
3840
runs-on: solo-linux-large
3941
steps:
4042
- name: Harden Runner
@@ -51,6 +53,16 @@ jobs:
5153
node-version: 20
5254
cache: npm
5355

56+
- name: Setup Kind
57+
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
58+
with:
59+
install_only: true
60+
node_image: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72
61+
version: v0.21.0
62+
kubectl_version: v1.28.6
63+
verbosity: 3
64+
wait: 120s
65+
5466
- name: Install Dependencies
5567
id: npm-deps
5668
run: npm ci
@@ -60,6 +72,5 @@ jobs:
6072

6173
- name: Run Example Task File Test
6274
run: |
63-
task readme
64-
task default-with-mirror
75+
task default-with-relay
6576
task clean

.github/workflows/script/relay_smoke_test.sh

-82
This file was deleted.

.github/workflows/zxc-e2e-test.yaml

+1-6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ name: "ZXC: E2E Test"
2121
# - .github/workflows/flow-build-application.yaml
2222

2323
on:
24+
workflow_dispatch:
2425
workflow_call:
2526
inputs:
2627
node-version:
@@ -181,12 +182,6 @@ jobs:
181182
run: |
182183
${{ env.CG_EXEC }} npm run ${{ inputs.npm-test-script }}
183184
184-
- name: RPC relay smoke test
185-
if: ${{ runner.os == 'linux' && inputs.npm-test-script == 'test-e2e-relay' && !cancelled() && !failure() }}
186-
run: |
187-
echo "Skipped smoke test for relay"
188-
#.github/workflows/script/relay_smoke_test.sh
189-
190185
- name: Upload E2E Logs to GitHub
191186
if: ${{ !cancelled() }}
192187
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3

HelperTasks.yml

+184
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
version: 3
2+
output: prefixed
3+
silent: false
4+
vars:
5+
nodes:
6+
ref: until (env "SOLO_NETWORK_SIZE" | default .SOLO_NETWORK_SIZE | int)
7+
# node name should be node1, node2, node3, etc.
8+
node_list_internal: "{{range $idx, $n := .nodes }}node{{add $n 1}},{{end}}"
9+
node_identifiers: "{{ .node_list_internal | trimSuffix \",\" }}"
10+
11+
solo_user_dir: "{{ env \"HOME\" }}/.solo"
12+
solo_cache_dir: "{{ .solo_user_dir }}/cache"
13+
solo_logs_dir: "{{ .solo_user_dir }}/logs"
14+
solo_keys_dir: "{{ .solo_cache_dir }}/keys"
15+
solo_bin_dir: "{{ .solo_user_dir }}/bin"
16+
17+
tasks:
18+
readme:
19+
silent: true
20+
cmds:
21+
- echo "This is a custom network configuration for the Hedera Hashgraph Solo network."
22+
- echo "The network is configured to have {{ .SOLO_NETWORK_SIZE }} nodes."
23+
- echo "The network is deployed in the namespace {{ .SOLO_NAMESPACE }}."
24+
- echo "The cluster is deployed in the namespace {{ .SOLO_CLUSTER_SETUP_NAMESPACE }}."
25+
- echo "Use command 'task default' to deploy the network."
26+
- echo "Use command 'task destroy' to destroy the network."
27+
- echo "Use command 'task clean' to destroy and clean up the network."
28+
- echo "Use command 'task show:ips' to show the external IPs of the nodes."
29+
- echo "Use command 'task default-with-mirror' to deploy the network with a mirror node."
30+
- echo "Use command 'task default-with-relay' to deploy the network with a relay node."
31+
32+
install:solo:
33+
internal: true
34+
status:
35+
- command -v solo
36+
cmds:
37+
- npm install -g @hashgraph/solo
38+
- cd ../..
39+
- npm link
40+
41+
install:kubectl:darwin:
42+
internal: true
43+
platforms:
44+
- darwin
45+
status:
46+
- command -v kubectl
47+
cmds:
48+
- brew update
49+
- brew install kubernetes-cli
50+
51+
install:kubectl:linux:
52+
internal: true
53+
platforms:
54+
- linux
55+
status:
56+
- command -v kubectl
57+
cmds:
58+
- curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/{{ ARCH }}/kubectl"
59+
- sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
60+
- rm -rf kubectl
61+
62+
solo:init:
63+
internal: true
64+
status:
65+
- test -f {{ .solo_bin_dir }}/helm
66+
- test -f {{ .solo_cache_dir }}/profiles/custom-spec.yaml
67+
- test -f {{ .solo_cache_dir }}/templates/api-permission.properties
68+
- test -f {{ .solo_cache_dir }}/templates/application.properties
69+
- test -f {{ .solo_cache_dir }}/templates/bootstrap.properties
70+
- test -f {{ .solo_cache_dir }}/templates/settings.txt
71+
- test -f {{ .solo_cache_dir }}/templates/log4j2.xml
72+
#- test "$(yq -r '.flags."node-ids"' < {{ .solo_user_dir }}/solo.yaml)" == "{{ .node_identifiers }}"
73+
- test "$(jq -r '.flags."node-ids"' < {{ .solo_user_dir }}/solo.config)" == "{{ .node_identifiers }}"
74+
cmds:
75+
- npm run build
76+
- solo init
77+
78+
solo:keys:
79+
internal: true
80+
status:
81+
- |
82+
for n in $(seq 0 {{ sub (env "SOLO_NETWORK_SIZE" | default .SOLO_NETWORK_SIZE | int) 1 }}); do
83+
test -f {{ .solo_keys_dir }}/hedera-node${n}.crt
84+
test -f {{ .solo_keys_dir }}/hedera-node${n}.key
85+
test -f {{ .solo_keys_dir }}/s-public-node${n}.pem
86+
test -f {{ .solo_keys_dir }}/s-private-node${n}.pem
87+
done
88+
cmds:
89+
- npm run build
90+
- solo node keys --gossip-keys --tls-keys --node-aliases-unparsed {{.node_identifiers}}
91+
92+
solo:network:deploy:
93+
internal: true
94+
cmds:
95+
- npm run build
96+
- solo network deploy --namespace "${SOLO_NAMESPACE}" --node-aliases-unparsed {{.node_identifiers}} --release-tag "${CONSENSUS_NODE_VERSION}" --solo-chart-version "${SOLO_CHART_VERSION}"
97+
- solo node setup --namespace "${SOLO_NAMESPACE}" --node-aliases-unparsed {{.node_identifiers}} --release-tag "${CONSENSUS_NODE_VERSION}"
98+
99+
solo:network:destroy:
100+
internal: true
101+
cmds:
102+
- npm run build
103+
- solo network destroy --namespace "${SOLO_NAMESPACE}" --delete-pvcs --delete-secrets --force
104+
105+
solo:node:start:
106+
internal: true
107+
cmds:
108+
- npm run build
109+
- solo node start --namespace "${SOLO_NAMESPACE}" --node-aliases-unparsed {{.node_identifiers}} {{ .CLI_ARGS }}
110+
- kubectl port-forward -n "${SOLO_NAMESPACE}" svc/haproxy-node1-svc 50211:50211 &
111+
- task: "sleep_after_port_forward"
112+
113+
solo:node:stop:
114+
internal: true
115+
ignore_error: true
116+
cmds:
117+
- npm run build
118+
- solo node stop --namespace "${SOLO_NAMESPACE}" --node-aliases-unparsed {{.node_identifiers}} {{ .CLI_ARGS }}
119+
120+
solo:node:addresses:
121+
internal: true
122+
cmds:
123+
- kubectl get svc -n "${SOLO_NAMESPACE}" -l "solo.hedera.com/type=network-node-svc"
124+
125+
solo:relay:
126+
cmds:
127+
- npm run build
128+
- solo relay deploy -n "${SOLO_NAMESPACE}" -i node1
129+
- echo "Enable port forwarding for Hedera JSON RPC Relay"
130+
- kubectl port-forward -n "${SOLO_NAMESPACE}" svc/relay-node1-hedera-json-rpc-relay 7546:7546 &
131+
- task: "sleep_after_port_forward"
132+
133+
solo:destroy-relay:
134+
status:
135+
- helm list -n "${SOLO_NAMESPACE}" | grep -vqz relay-node1
136+
cmds:
137+
- npm run build
138+
- solo relay destroy -n "${SOLO_NAMESPACE}" -i node1
139+
140+
solo:cache:remove:
141+
internal: true
142+
status:
143+
- test [[ ! -d {{ .solo_cache_dir }} ]]
144+
cmds:
145+
- rm -rf {{ .solo_cache_dir }}
146+
147+
solo:logs:remove:
148+
internal: true
149+
status:
150+
- test [[ ! -d {{ .solo_logs_dir }} ]]
151+
cmds:
152+
- rm -rf {{ .solo_logs_dir }}
153+
154+
solo:config:remove:
155+
internal: true
156+
status:
157+
- test [[ ! -f {{ .solo_user_dir }}/solo.yaml ]]
158+
cmds:
159+
- rm -rf {{ .solo_user_dir }}/solo.yaml
160+
161+
cluster:create:
162+
status:
163+
- kind get clusters | grep -q "${SOLO_CLUSTER_NAME}"
164+
cmds:
165+
- kind create cluster -n "${SOLO_CLUSTER_NAME}" --image "${KIND_IMAGE}"
166+
167+
cluster:setup:
168+
cmds:
169+
- npm run build
170+
- solo cluster setup --cluster-setup-namespace "${SOLO_CLUSTER_SETUP_NAMESPACE}"
171+
172+
cluster:destroy:
173+
cmds:
174+
- kind delete cluster --name "${SOLO_CLUSTER_NAME}"
175+
176+
clean:port-forward:
177+
cmds:
178+
- pkill -f "kubectl port-forward -n {{ .SOLO_NAMESPACE }}" || true
179+
180+
sleep_after_port_forward:
181+
cmds:
182+
# somehow without the sleep, when port-forward is the last command of a series of tasks, port-forward
183+
# prematurely killed when task is exiting
184+
- sleep 4

0 commit comments

Comments
 (0)