Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7d6f09c
add input for passing enterprise blobbers in the action by default th…
yash10019coder Sep 27, 2024
eacab58
Merge branch 'master' into feature/add-enterprise-blobber-input-for-d…
yash10019coder Oct 19, 2024
afa7b7e
add input for using egosdk as a flag in run-system-tests-tokenomics-a…
yash10019coder Oct 20, 2024
e36865d
Merge branch 'feature/add-egosdk-tokenomics-action' into feature/add-…
yash10019coder Oct 20, 2024
5fd9204
Merge pull request #368 from 0chain/feature/add-enterprise-blobber-in…
yash10019coder Oct 20, 2024
07ad38f
nit fixes.
yash10019coder Oct 20, 2024
7fbe4b9
nit fix add input for using egosdk as a flag in run-system-tests-toke…
yash10019coder Oct 21, 2024
0ea7c59
use go version 1.22 instead of 1.21 in deploy chain actions.
yash10019coder Oct 29, 2024
2f2dfaa
added eblobber deploy functionality into actions repo
shahnawaz-creator Nov 12, 2024
4bdb917
refactor: blobber image tag for enterprise
yash10019coder Nov 12, 2024
ea569c8
fix eblobber action.yml
shahnawaz-creator Nov 14, 2024
28b206a
fix eblobber action.yml
shahnawaz-creator Nov 14, 2024
d282ba5
fix eblobber action.yml
shahnawaz-creator Nov 14, 2024
dd80c25
Merge pull request #371 from 0chain/update/eblobber-deploy
yash10019coder Jan 5, 2025
d840a4f
Merge branch 'master' into feature/add-egosdk-tokenomics-action
yash10019coder Jan 5, 2025
6888039
debug.
yash10019coder Jan 5, 2025
a4abdea
debug.
yash10019coder Jan 5, 2025
c7daa1c
debug.
yash10019coder Jan 5, 2025
091b900
debug
yash10019coder Jan 5, 2025
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
31 changes: 25 additions & 6 deletions deploy-0chain/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
description: "blobber DOCKER IMAGE to deploy"
default: ""
required: false
is_enterprise_blobbers:
description: 'flag to enable enterprise blobbers'
default: 'false'
required: false
validator_image:
description: "validator DOCKER IMAGE to deploy"
default: ""
Expand Down Expand Up @@ -105,7 +109,7 @@ runs:
steps:
- name: "Get sprint branch from repo_snapshots_branch"
if: ${{ inputs.repo_snapshots_branch != '' }}
uses: 0chain/actions/resolve-repo-snapshot@master
uses: 0chain/actions/resolve-repo-snapshot@feature/add-egosdk-tokenomics-action
with:
repo_snapshots_branch: ${{ inputs.repo_snapshots_branch }}
svc_account_secret: ${{ inputs.svc_account_secret }}
Expand Down Expand Up @@ -159,8 +163,14 @@ runs:

./check-params.sh "${{inputs.miner_image}}" "${{ env.SNAPSHOT_BRANCH_MINER_TAG }}" "MINER_TAG"
./check-params.sh "${{inputs.sharder_image}}" "${{ env.SNAPSHOT_BRANCH_SHARDER_TAG }}" "SHARDER_TAG"
./check-params.sh "${{inputs.blobber_image}}" "${{ env.SNAPSHOT_BRANCH_BLOBBER_TAG }}" "BLOBBER_TAG"
./check-params.sh "${{inputs.validator_image}}" "${{ env.SNAPSHOT_BRANCH_VALIDATOR_TAG }}" "VALIDATOR_TAG"

if [[ ${{inputs.is_enterprise_blobbers}} == "true" ]]; then
./check-params.sh "${{inputs.blobber_image}}" "${{ env.SNAPSHOT_BRANCH_EBLOBBER_TAG }}" "BLOBBER_TAG"
./check-params.sh "${{inputs.validator_image}}" "${{ env.SNAPSHOT_BRANCH_EVALIDATOR_TAG }}" "VALIDATOR_TAG"
else
./check-params.sh "${{inputs.blobber_image}}" "${{ env.SNAPSHOT_BRANCH_BLOBBER_TAG }}" "BLOBBER_TAG"
./check-params.sh "${{inputs.validator_image}}" "${{ env.SNAPSHOT_BRANCH_VALIDATOR_TAG }}" "VALIDATOR_TAG"
fi
./check-params.sh "${{inputs.authorizer_image}}" "${{ env.SNAPSHOT_BRANCH_AUTHORIZER_TAG }}" "AUTHORIZER_TAG"
./check-params.sh "${{inputs.zbox_image}}" "${{ env.SNAPSHOT_BRANCH_ZBOX_TAG }}" "ZBOX_TAG"
./check-params.sh "${{inputs.zvault_image}}" "${{ env.SNAPSHOT_BRANCH_ZVAULT_TAG }}" "ZVAULT_TAG"
Expand All @@ -181,6 +191,7 @@ runs:
echo "GRAPHNODE_SC=$(echo ${{ inputs.graphnode_sc }})" >> $GITHUB_ENV
echo "GRAPHNODE_NETWORK=$(echo ${{ inputs.graphnode_network }})" >> $GITHUB_ENV
echo "GRAPHNODE_ETHEREUM_NODE_URL=$(echo ${{ inputs.graphnode_ethereum_node_url }})" >> $GITHUB_ENV
echo "IS_EBLOBBER=$(echo ${{ inputs.is_enterprise_blobbers }})" >> $GITHUB_ENV

if [[ "${RUNNER_NAME:(-1)}" == "t" ]];then
echo "RUNNER_NUMBER=st" >> $GITHUB_ENV
Expand Down Expand Up @@ -410,6 +421,14 @@ runs:
./zwallet add-hardfork -n hermes -r 0 --wallet owner_wallet.json --config ./zbox_config.yaml --configDir .

##############----------------- Installing blobber helm-chart --------------------###################
if [[ "${{ env.IS_EBLOBBER }}" == "true" ]]; then
echo "BLOBBER_DOCKER_REPO=0chaindev/eblobber" >> $GITHUB_ENV
echo "VALIDATOR_DOCKER_REPO=0chaindev/evalidator" >> $GITHUB_ENV
else
echo "BLOBBER_DOCKER_REPO=0chaindev/blobber" >> $GITHUB_ENV
echo "VALIDATOR_DOCKER_REPO=0chaindev/validator" >> $GITHUB_ENV
fi

COUNT=3 #COUNT will be giving 3 try to install the helmchart.
RET=1 #You can set RET=0 to skip the blobber helm-chart deployment
while [[ $RET -ne 0 && $COUNT -gt 0 ]]; do
Expand All @@ -425,12 +444,14 @@ runs:
--set blobber.config.block_worker=https://${{ env.NAMESPACE }}.devnet-0chain.net/dns \
--set validator.config.block_worker=https://${{ env.NAMESPACE }}.devnet-0chain.net/dns \
--set blobber.config.delegate_wallet=591d6d0d5642bdbc924756ca2647b4b59adce0acd02a487ecc4d1bd4669293a8 \
--set blobber.config.is_enterprise="false" \
--set blobber.config.is_enterprise=${{ env.IS_EBLOBBER }} \
--set validator.config.delegate_wallet=591d6d0d5642bdbc924756ca2647b4b59adce0acd02a487ecc4d1bd4669293a8 \
--set blobber.hostName=${{ env.NAMESPACE }} \
--set blobber.host=devnet-0chain.net \
--set blobber.image.tag=${{ env.BLOBBER_TAG }} \
--set validator.image.tag=${{ env.VALIDATOR_TAG }} \
--set blobber.image.repository=${{ env.BLOBBER_DOCKER_REPO }} \
--set validator.image.repository=${{ env.VALIDATOR_DOCKER_REPO }} \
--set validator.hostName=${{ env.NAMESPACE }} \
--set validator.host=devnet-0chain.net -n ${{ env.NAMESPACE }} \
0chain-helm/blobber --kubeconfig ./kube/${{ env.NAMESPACE }}-config
Expand Down Expand Up @@ -791,8 +812,6 @@ runs:
# echo "==========================================================="
# echo "ADDING LATEST HARFORK"
# echo "==========================================================="


# echo '{"client_id":"1746b06bb09f55ee01b33b5e2e055d6cc7a900cb57c0a3a5eaabb8a0e7745802","client_key":"7b630ba670dac2f22d43c2399b70eff378689a53ee03ea20957bb7e73df016200fea410ba5102558b0c39617e5afd2c1843b161a1dedec15e1ab40543a78a518","keys":[{"public_key":"7b630ba670dac2f22d43c2399b70eff378689a53ee03ea20957bb7e73df016200fea410ba5102558b0c39617e5afd2c1843b161a1dedec15e1ab40543a78a518","private_key":"c06b6f6945ba02d5a3be86b8779deca63bb636ce7e46804a479c50e53c864915"}],"mnemonics":"cactus panther essence ability copper fox wise actual need cousin boat uncover ride diamond group jacket anchor current float rely tragic omit child payment","version":"1.0","date_created":"2021-08-04 18:53:56.949069945 +0100 BST m=+0.018986002"}' > owner_wallet.json
# ./zwallet mn-update-config --keys cost.add_hardfork --values 100 --wallet owner_wallet.json --config ./zbox_config.yaml --configDir .
# ./zwallet add-hardfork -n apollo -r 0 --wallet owner_wallet.json --config ./zbox_config.yaml --configDir .
Expand Down
18 changes: 18 additions & 0 deletions get-latest-image-for-branch/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ inputs:
description: 'blobber branch to deploy'
default: ''
required: false
eblobber_evalidator_branch:
description: 'eblobber branch to deploy'
default: ''
required: false
authorizer_branch:
description: 'authorizer branch to deploy'
default: ''
Expand Down Expand Up @@ -59,6 +63,12 @@ outputs:
validator-tag:
description: "validator docker image"
value: ${{ steps.get-images.outputs.VALIDATOR_TAG }}
eblobber-tag:
description: "eblobber docker image"
value: ${{ steps.get-images.outputs.EBLOBBER_TAG }}
evalidator-tag:
description: "evalidator docker image"
value: ${{ steps.get-images.outputs.EVALUATOR_TAG }}
authorizer-tag:
description: "authorizer docker image"
value: ${{ steps.get-images.outputs.AUTHORIZER_TAG }}
Expand Down Expand Up @@ -218,6 +228,14 @@ runs:
echo "blobber_validator_branch NOT specified, will skip deriving blobber and validator image tag"
fi

if [[ -n "${{ inputs.eblobber_evalidator_branch }}" ]];
then
./get_tag.sh eblobber ${{ inputs.eblobber_evalidator_branch }} eblobber
./get_tag.sh eblobber ${{ inputs.eblobber_evalidator_branch }} evalidator
else
echo "eblobber_evalidator_branch NOT specified, will skip deriving eblobber and evalidator image tag"
fi

if [[ -n "${{ inputs.authorizer_branch }}" ]];
then
./get_tag.sh token_bridge_authserver ${{ inputs.authorizer_branch }} authorizer
Expand Down
11 changes: 10 additions & 1 deletion resolve-repo-snapshot/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ runs:
- name: "Get docker images for sprint branches"
id: get-images
if: ${{ inputs.resolve_images == 'true' }}
uses: 0chain/actions/get-latest-image-for-branch@master
uses: 0chain/actions/get-latest-image-for-branch@feature/add-egosdk-tokenomics-action
with:
miner_sharder_branch: ${{ env.SNAPSHOT_BRANCH_0CHAIN }}
blobber_validator_branch: ${{ env.SNAPSHOT_BRANCH_BLOBBER }}
eblobber_evalidator_branch: ${{ env.SNAPSHOT_BRANCH_EBLOBBER}}
authorizer_branch: ${{ env.SNAPSHOT_BRANCH_TOKEN_BRIDGE_AUTHSERVER }}
zbox_branch: ${{ env.SNAPSHOT_BRANCH_0BOX }}
zvault_branch: ${{ env.SNAPSHOT_BRANCH_ZVAULT }}
Expand Down Expand Up @@ -114,6 +115,14 @@ runs:
echo "SNAPSHOT_BRANCH_VALIDATOR_TAG=$(echo '${{ steps.get-images.outputs.validator-tag }}')" >> $GITHUB_ENV
fi

if [[ -n "${{ steps.get-images.outputs.eblobber-tag }}" ]];then
echo "SNAPSHOT_BRANCH_BLOBBER_TAG=$(echo '${{ steps.get-images.outputs.eblobber-tag }}')" >> $GITHUB_ENV
fi

if [[ -n "${{ steps.get-images.outputs.evalidator-tag }}" ]];then
echo "SNAPSHOT_BRANCH_VALIDATOR_TAG=$(echo '${{ steps.get-images.outputs.evalidator-tag }}')" >> $GITHUB_ENV
fi

if [[ -n "${{ steps.get-images.outputs.authorizer-tag }}" ]];then
echo "SNAPSHOT_BRANCH_AUTHORIZER_TAG=$(echo '${{ steps.get-images.outputs.authorizer-tag }}')" >> $GITHUB_ENV
fi
Expand Down
61 changes: 52 additions & 9 deletions run-system-tests-tokenomics/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ inputs:
custom_go_sdk_version:
required: true
default: "NONE"
description: 'custom gosdk version. Will upgrade CLI branches with this before running tests'
use_egosdk:
required: false
default: "false"
description: "custom gosdk version. Will upgrade CLI branches with this before running tests"
tokenomics_test_filter:
required: false
Expand Down Expand Up @@ -91,8 +95,14 @@ runs:
./check-params.sh "${{inputs.zwallet_cli_branch}}" "${{ env.SNAPSHOT_BRANCH_ZWALLETCLI }}" "ZWALLET_BRANCH"
./check-params.sh "${{inputs.system_tests_branch}}" "${{ env.SNAPSHOT_BRANCH_SYSTEM_TEST }}" "SYSTEM_TESTS_BRANCH"
./check-params.sh "${{inputs.s3_migration_cli_branch}}" "${{ env.SNAPSHOT_BRANCH_S3-MIGRATION }}" "S3_MIGRATION_BRANCH"
./check-params.sh "${{inputs.custom_go_sdk_version}}" "${{ env.SNAPSHOT_BRANCH_GOSDK }}" "GOSDK_VERSION"


if [[ "${{inputs.use_egosdk}}" == "true" ]]; then
./check-params.sh "${{inputs.custom_go_sdk_version}}" "${{ env.SNAPSHOT_BRANCH_EGOSDK }}" "GOSDK_VERSION"
else
./check-params.sh "${{inputs.custom_go_sdk_version}}" "${{ env.SNAPSHOT_BRANCH_GOSDK }}" "GOSDK_VERSION"
fi

echo "USE_EGOSDK=$(echo ${{inputs.use_egosdk}})" >> $GITHUB_ENV
echo "NETWORK_URL=$(echo ${{ inputs.network }})" >> $GITHUB_ENV
echo "GOMODCACHE=/root/actions-runner${RUNNER_NAME:(-1)}/_work/_tool/go/pkg/mod" >> $GITHUB_ENV
echo "GOCACHE=/root/actions-runner${RUNNER_NAME:(-1)}/_work/_tool/.cache/go-build" >> $GITHUB_ENV
Expand Down Expand Up @@ -127,7 +137,13 @@ runs:
echo "0wallet CLI branch: [${{ env.ZWALLET_BRANCH }}]"
echo "s3 migration CLI branch: [${{ env.S3_MIGRATION_BRANCH }}]"
echo "Ethereum node URL: [https://virtual.mainnet.rpc.tenderly.co/${{ inputs.TENDERLY_VIRTUAL_TESTNET_RPC_ID }}]"
echo "Custom gosdk version: [${{ env.GOSDK_VERSION }}]"

if [[ "${{env.USE_EGOSDK}}" == "false" ]]; then
echo "Custom gosdk version: [${{ env.GOSDK_VERSION }}]"
else
echo "Custom egosdk version: [${{ env.GOSDK_VERSION }}]"
fi

echo "Test file filter: [${{ inputs.test_file_filter }}]"
echo "Running Tokenomics tests: [${{ env.RUN_TOKENOMICS_SYSTEM_TESTS }}]"

Expand Down Expand Up @@ -204,15 +220,27 @@ runs:
echo "=============================================================="
echo

GOSDK_HEAD=$(curl -s -H "Authorization: token ${{ inputs.svc_account_secret }}" https://api.github.com/repos/0chain/gosdk/git/refs/heads/${{ env.GOSDK_VERSION }} | jq -r '.object.sha')
if [[ "${{env.USE_EGOSDK}}" == "false" ]]; then
GOSDK_HEAD=$(curl -s -H "Authorization: token ${{ inputs.svc_account_secret }}" https://api.github.com/repos/0chain/gosdk/git/refs/heads/${{ env.GOSDK_VERSION }} | jq -r '.object.sha')
else
GOSDK_HEAD=$(curl -s -H "Authorization: token ${{ inputs.svc_account_secret }}" https://api.github.com/repos/0chain/egosdk/git/refs/heads/${{ env.GOSDK_VERSION }} | jq -r '.object.sha')
fi

if [[ "$GOSDK_HEAD" == "null" ]]; then
echo "[${{ env.GOSDK_VERSION }}] does not seem to be a valid branch (possibly a commit hash?). Will pass directly to go to resolve"
GOSDK_HEAD="${{ env.GOSDK_VERSION }}"
fi

echo '#!/bin/bash
echo "Upgrading [$2] to GOSDK [${{ env.GOSDK_VERSION }}($1)]"
go get github.com/0chain/gosdk@$1 || { echo "::error title=Failed to retrieve gosdk::failed to retrieve gosdk [${{ env.GOSDK_VERSION }}]" && exit 1; }

if [[ "${{env.USE_EGOSDK}}" == "false" ]];
then
go get github.com/0chain/gosdk@$1 || { echo "::error title=Failed to retrieve gosdk::failed to retrieve gosdk [${{ env.GOSDK_VERSION }}]" && exit 1; }
else
go get github.com/0chain/egosdk@$1 || { echo "::error title=Failed to retrieve egosdk::failed to retrieve egosdk [${{ env.GOSDK_VERSION }}]" && exit 1; }
fi

go mod tidy || { echo "::error title=Failed to upgrade $2 gosdk::failed to upgrade $2 gosdk to [${{ env.GOSDK_VERSION }}]" && exit 1; }
' > ./upgrade-gosdk.sh;
chmod 555 ./upgrade-gosdk.sh
Expand Down Expand Up @@ -285,8 +313,14 @@ runs:
echo "======================================================"
echo "SETTING WASM TESTS:"
echo "======================================================"
git clone -q https://github.com/0chain/gosdk.git
cd gosdk
if [[ "${{env.USE_EGOSDK}}" == "false" ]];
then
git clone -q https://github.com/0chain/gosdk.git
cd gosdk
else
git clone -q https://github.com/0chain/egosdk.git
cd egosdk
fi

if [[ -n "${{ env.GOSDK_VERSION }}" && "${{ env.GOSDK_VERSION }}" != "NONE" ]];
then
Expand All @@ -295,15 +329,24 @@ runs:

cd ..

- name: Run frontend Tests
if: ${{ env.RUN_FRONTEND_TESTS == 'true' && env.RUN_SUBSET_OF_TESTS == 'false' }}
- name: Run frontend Tests with normal gosdk.
if: ${{ env.RUN_FRONTEND_TESTS == 'true' && inputs.use_egosdk == 'false' && env.RUN_SUBSET_OF_TESTS == 'false' }}
uses: cypress-io/github-action@v5
with:
working-directory: ./gosdk/wasmsdk/cypress
record: false
install-command: yarn start:system-tests
start: yarn start

- name: Run frontend Tests with egosdk.
if: ${{ env.RUN_FRONTEND_TESTS == 'true' && inputs.use_egosdk == 'true' && env.RUN_SUBSET_OF_TESTS == 'false' }}
uses: cypress-io/github-action@v5
with:
working-directory: ./egosdk/wasmsdk/cypress
record: false
install-command: yarn start:system-tests
start: yarn start

- name: "Run Tokenomics System Tests"
shell: 'script --return --quiet --command "bash {0}"'
if: ${{ env.RUN_TOKENOMICS_SYSTEM_TESTS == 'true' && env.RUN_TOKENOMICS_SUBSET_OF_TESTS == 'false' && 'true' == 'false' }}
Expand Down