Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions charts/block-node-server/scripts/Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
version: '3'

dotenv: ['.env']

tasks:
clear-release:
cmds:
- helm uninstall $RELEASE -n $NAMESPACE
- kubectl delete pvc -n $NAMESPACE live-storage-pvc logging-storage-pvc archive-storage-pvc
- kubectl delete pv -n $NAMESPACE archive-storage-pv live-storage-pv logging-storage-pv
- kubectl delete namespace $NAMESPACE

load-kubectl-helm:
cmds:
- mkdir -p ${HOME}/.kube
- sudo cp /etc/kubernetes/admin.conf ${HOME}/.kube/config
- sudo chown $(id -un):$(id -un) ${HOME}/.kube/config
- export PATH="/opt/solo/provisioner/sandbox/bin:${PATH}"
- command -v helm
- kubectl config get-clusters
- mkdir values-override

helm-release:
cmds:
- kubectl create namespace $NAMESPACE
- kubectl apply -f values-override/host-path.yaml
- helm install $RELEASE oci://ghcr.io/hiero-ledger/hiero-block-node/block-node-server --version $VERSION -n $NAMESPACE --values values-override/bare-metal-values.yaml
- kubectl annotate -n $NAMESPACE service $RELEASE-block-node-server "metallb.io/address-pool=public-address-pool"
- sleep 90
- kubectl get all -n $NAMESPACE

helm-upgrade:
cmds:
- helm upgrade $RELEASE oci://ghcr.io/hiero-ledger/hiero-block-node/block-node-server --version $VERSION -n $NAMESPACE --install --values values-override/bare-metal-values.yaml
- kubectl get all -n $NAMESPACE

reset-file-store:
cmds:
- kubectl -n ${NAMESPACE} exec ${POD} -- sh -c 'rm -rf /opt/hiero/block-node/data/live/* /opt/hiero/block-node/data/historic/*'
- kubectl -n ${NAMESPACE} delete pod $POD

reset-upgrade:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we talk about reset as a storage clean, but for some reset might mean "restart".
should we be more explicit? I believe we can make comments in this task file. maybe a comment is enough.

cmds:
- kubectl -n ${NAMESPACE} exec ${POD} -- sh -c 'rm -rf /opt/hiero/block-node/data/live/* /opt/hiero/block-node/data/historic/*'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we re-use the reset-file-store job here?

- kubectl -n ${NAMESPACE} delete pod $POD
- helm upgrade $RELEASE oci://ghcr.io/hiero-ledger/hiero-block-node/block-node-server --version $VERSION -n $NAMESPACE --install --values values-override/bare-metal-values.yaml
- sleep 90
- kubectl get all -n $NAMESPACE
Comment on lines +46 to +48
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we reuse the helm-upgrade job here instead of re-doing the same cmds.


setup-bn-proto:
cmds:
- curl -L https://github.com/hiero-ledger/hiero-block-node/releases/download/v$VERSION/block-node-protobuf-$VERSION.tgz -o block-node-protobuf-$VERSION.tgz
- tar -xzf block-node-protobuf-$VERSION.tgz -C ~/block-node-protobuf-$VERSION
- rm block-node-protobuf-$VERSION.tgz

setup-grpcurl:
cmds:
- curl -L https://github.com/fullstorydev/grpcurl/releases/download/v1.8.7/grpcurl_1.8.7_linux_x86_64.tar.gz -o grpcurl.tar.gz
- sudo tar -xzf grpcurl.tar.gz -C /usr/local/bin grpcurl
- rm grpcurl.tar.gz

scale-bn:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we call this job scale-bn is more of a restart-bn

cmds:
- kubectl scale deployment $RELEASE-block-node-server -n $NAMESPACE --replicas=0
- sleep 10
- kubectl scale deployment $RELEASE-block-node-server -n $NAMESPACE --replicas=1
- sleep 90
- kubectl get all -n $NAMESPACE
Loading
Loading