Skip to content

Commit

Permalink
Fix: snapshot branch retrieval for KMS components (#365)
Browse files Browse the repository at this point in the history
* fix: fixed snapshot branch retrieval for kms components

* fix: fixed bugs

* fix: debug

* fix: fixed bugs

* fix: debug

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: fixed bugs

* fix: removed debug code

* fix: renamed zauth server input

* fix: fixed bugs

---------

Co-authored-by: shahnawaz-creator <[email protected]>
  • Loading branch information
YarikRevich and shahnawaz-creator authored Aug 23, 2024
1 parent 0750fb2 commit 7ffa274
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 33 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/manual_system_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ on:
default: ''
required: false
type: string
zauth_branch:
zauth_server_branch:
description: 'zauth-server branch to deploy'
default: ''
required: false
Expand Down Expand Up @@ -240,6 +240,8 @@ jobs:
authorizer_branch: ${{ inputs.authorizer_branch }}
zbox_branch: ${{ inputs.zbox_branch }}
zdns_branch: ${{ inputs.zdns_branch }}
zvault_branch: ${{ inputs.zvault_branch }}
zauth_server_branch: ${{ inputs.zauth_server_branch }}
zs3server_branch: ${{ inputs.zs3server_branch }}
svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }}

Expand All @@ -258,7 +260,7 @@ jobs:
gosdk_branch: ${{ inputs.gosdk_branch }}
zbox_branch: ${{ inputs.zbox_branch }}
zvault_branch: ${{ inputs.zvault_branch }}
zauth_branch: ${{ inputs.zauth_branch }}
zauth_server_branch: ${{ inputs.zauth_server_branch }}
zdns_branch: ${{ inputs.zdns_branch }}
authorizer_branch: ${{ inputs.authorizer_branch }}
skip_tests: ${{ env.SKIP_TESTS }}
Expand All @@ -278,7 +280,7 @@ jobs:
authorizer_image: ${{ steps.get-images.outputs.authorizer-tag }}
zbox_image: ${{ steps.get-images.outputs.zbox-tag }}
zvault_image: ${{ steps.get-images.outputs.zvault-tag }}
zauth_image: ${{ steps.get-images.outputs.zauth-tag }}
zauth_server_image: ${{ steps.get-images.outputs.zauth-server-tag }}
zdns_image: ${{ steps.get-images.outputs.zdns-tag }}
zbox_cli_branch: ${{ inputs.zbox_cli_branch }}
zwallet_cli_branch: ${{ inputs.zwallet_cli_branch }}
Expand Down Expand Up @@ -348,6 +350,8 @@ jobs:
blobber_branch: ${{ inputs.blobber_branch }}
gosdk_branch: ${{ inputs.gosdk_branch }}
zbox_branch: ${{ inputs.zbox_branch }}
zvault_branch: ${{ inputs.zvault_branch }}
zauth_server_branch: ${{ inputs.zauth_server_branch }}
zdns_branch: ${{ inputs.zdns_branch }}
authorizer_branch: ${{ inputs.authorizer_branch }}
skip_tests: ${{ env.SKIP_TESTS }}
Expand Down
16 changes: 8 additions & 8 deletions deploy-0chain/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ inputs:
description: 'zvault DOCKER IMAGE to deploy'
default: ''
required: false
zauth_image:
description: 'zauth DOCKER IMAGE to deploy'
zauth_server_image:
description: 'zauth-server DOCKER IMAGE to deploy'
default: ''
required: false
zdns_image:
Expand Down Expand Up @@ -164,7 +164,7 @@ runs:
./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"
./check-params.sh "${{inputs.zauth_image}}" "${{ env.SNAPSHOT_BRANCH_AUTH_TAG }}" "ZAUTH_TAG"
./check-params.sh "${{inputs.zauth_server_image}}" "${{ env.SNAPSHOT_BRANCH_ZAUTH-SERVER }}" "ZAUTH_SERVER_TAG"
./check-params.sh "${{inputs.zdns_image}}" "${{ env.SNAPSHOT_BRANCH_ZDNS_TAG }}" "ZDNS_TAG"
./check-params.sh "${{inputs.zbox_cli_branch}}" "${{ env.SNAPSHOT_BRANCH_ZBOXCLI }}" "ZBOX_BRANCH"
./check-params.sh "${{inputs.zwallet_cli_branch}}" "${{ env.SNAPSHOT_BRANCH_ZWALLETCLI }}" "ZWALLET_BRANCH"
Expand Down Expand Up @@ -217,7 +217,7 @@ runs:
echo "Authorizer docker image: [${{ env.AUTHORIZER_TAG }}]"
echo "0box docker image: [${{ env.ZBOX_TAG }}]"
echo "zvault docker image: [${{ env.ZVAULT_TAG }}]"
echo "zauth docker image: [${{ env.ZAUTH_TAG }}]"
echo "zauth-server docker image: [${{ env.ZAUTH_SERVER_TAG }}]"
echo "0dns docker image: [${{ env.ZDNS_TAG }}]"
echo "S3 server client docker image: [${{ env.ZS3_CLIENT }}]"
echo "S3 server logsearchapi docker image: [${{ env.ZS3_LOGSEARCHAPI }}]"
Expand Down Expand Up @@ -464,12 +464,12 @@ runs:
##############----------------- Installing zauth-server helm-chart --------------------###################
COUNT=3 #COUNT will be giving 3 try to install the helmchart.
RET=1 #You can set RET=0 to skip the zauth helm-chart deployment
RET=1 #You can set RET=0 to skip the zauth-server helm-chart deployment
while [[ $RET -ne 0 && $COUNT -gt 0 ]]; do
helm upgrade --install zauth \
helm upgrade --install zauth-server \
--set zauthServer.hostName=${{ env.NAMESPACE }} \
--set zauthServer.host=devnet-0chain.net \
--set zauthServer.image.tag=${{ env.AUTHORIZER_TAG }} \
--set zauthServer.image.tag=${{ env.ZAUTH_SERVER_TAG }} \
-n ${{ env.NAMESPACE }} 0chain-helm/zauth --kubeconfig ./kube/${{ env.NAMESPACE }}-config
RET=$?
((COUNT--))
Expand All @@ -484,7 +484,7 @@ runs:
helm upgrade --install zvault \
--set zvault.hostName=${{ env.NAMESPACE }} \
--set zvault.host=devnet-0chain.net \
--set zvault.image.tag=${{ env.AUTHORIZER_TAG }} \
--set zvault.image.tag=${{ env.ZVAULT_TAG }} \
-n ${{ env.NAMESPACE }} 0chain-helm/zvault --kubeconfig ./kube/${{ env.NAMESPACE }}-config
RET=$?
((COUNT--))
Expand Down
18 changes: 10 additions & 8 deletions get-latest-image-for-branch/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ inputs:
description: 'zvault branch to deploy'
default: ''
required: false
zauth_branch:
description: 'zauth branch to deploy'
zauth_server_branch:
description: 'zauth-server branch to deploy'
default: ''
required: false
zdns_branch:
Expand Down Expand Up @@ -68,9 +68,9 @@ outputs:
zvault-tag:
description: "zvault docker image"
value: ${{ steps.get-images.outputs.ZVAULT_TAG }}
zauth-tag:
description: "zauth docker image"
value: ${{ steps.get-images.outputs.ZAUTH_TAG }}
zauth-server-tag:
description: "zauth-server docker image"
value: ${{ steps.get-images.outputs.ZAUTH_SERVER_TAG }}
zdns-tag:
description: "0dns docker image"
value: ${{ steps.get-images.outputs.ZDNS_TAG }}
Expand Down Expand Up @@ -136,6 +136,8 @@ runs:
for (( retry_n=1 ; retry_n<=10 ; retry_n++ ));
do
echo "curl --silent -u ${{ inputs.svc_account_secret }}:x-oauth-basic https://api.github.com/search/issues?q=is:pr+org:0chain+sha:${SHORT_SHA}+head:$2 | jq --raw-output .items[0].number"
PR_ID=$(curl --silent -u ${{ inputs.svc_account_secret }}:x-oauth-basic https://api.github.com/search/issues?q=is:pr+org:0chain+sha:${SHORT_SHA}+head:$2 | jq --raw-output .items[0].number)
if [[ "$PR_ID" != "null" ]]; then
echo "Latest PR commit id $PR_ID found for $1 repository and $2 branch"
Expand Down Expand Up @@ -237,11 +239,11 @@ runs:
echo "zvault_branch NOT specified, will skip deriving zvault image tag"
fi
if [[ -n "${{ inputs.zauth_branch }}" ]];
if [[ -n "${{ inputs.zauth_server_branch }}" ]];
then
./get_tag.sh zauth-server ${{ inputs.zauth_branch }} zauth-server
./get_tag.sh zauth-server ${{ inputs.zauth_server_branch }} zauth-server
else
echo "zauth_branch NOT specified, will skip deriving zauth image tag"
echo "zauth_server_branch NOT specified, will skip deriving zauth-server image tag"
fi
if [[ -n "${{ inputs.zdns_branch }}" ]];
Expand Down
28 changes: 14 additions & 14 deletions notify-pull-request/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ inputs:
description: 'zvault branch to notify'
default: 'staging'
required: true
zauth_branch:
description: 'zauth branch to notify'
zauth_server_branch:
description: 'zauth-server branch to notify'
default: 'staging'
required: true
zdns_branch:
Expand Down Expand Up @@ -84,7 +84,7 @@ runs:
echo BLOBBER_SHA=$(./get_sha.sh blobber ${{ inputs.blobber_branch }}) >> $GITHUB_ENV
echo ZBOX_SHA=$(./get_sha.sh 0box ${{ inputs.zbox_branch }}) >> $GITHUB_ENV
echo ZVAULT_SHA=$(./get_sha.sh zvault ${{ inputs.zvault_branch }}) >> $GITHUB_ENV
echo ZAUTH_SHA=$(./get_sha.sh zauth-server ${{ inputs.zauth_branch }}) >> $GITHUB_ENV
echo ZAUTH_SHA=$(./get_sha.sh zauth-server ${{ inputs.zauth_server_branch }}) >> $GITHUB_ENV
echo AUTHORIZER_SHA=$(./get_sha.sh token_bridge_authserver ${{ inputs.authorizer_branch }}) >> $GITHUB_ENV
- name: "Get system tests branch PR"
Expand Down Expand Up @@ -125,7 +125,7 @@ runs:
| authorizer | ${{ inputs.authorizer_branch }} |
| 0box | ${{ inputs.zbox_branch }} |
| zvault | ${{ inputs.zvault_branch }} |
| zauth | ${{ inputs.zauth_branch }} |
| zauth-server | ${{ inputs.zauth_server_branch }} |
| 0dns | ${{ inputs.zdns_branch }} |
repo-token: ${{ inputs.github_token }}

Expand Down Expand Up @@ -167,7 +167,7 @@ runs:
| authorizer | ${{ inputs.authorizer_branch }} |
| 0box | ${{ inputs.zbox_branch }} |
| zvault | ${{ inputs.zvault_branch }} |
| zauth | ${{ inputs.zauth_branch }} |
| zauth-server | ${{ inputs.zauth_server_branch }} |
| 0dns | ${{ inputs.zdns_branch }} |
repo-token: ${{ inputs.github_token }}

Expand Down Expand Up @@ -209,7 +209,7 @@ runs:
| authorizer | ${{ inputs.authorizer_branch }} |
| 0box | ${{ inputs.zbox_branch }} |
| zvault | ${{ inputs.zvault_branch }} |
| zauth | ${{ inputs.zauth_branch }} |
| zauth-server | ${{ inputs.zauth_server_branch }} |
| 0dns | ${{ inputs.zdns_branch }} |
repo-token: ${{ inputs.github_token }}

Expand Down Expand Up @@ -251,7 +251,7 @@ runs:
| authorizer | ${{ inputs.authorizer_branch }} |
| 0box | ${{ inputs.zbox_branch }} |
| zvault | ${{ inputs.zvault_branch }} |
| zauth | ${{ inputs.zauth_branch }} |
| zauth-server | ${{ inputs.zauth_server_branch }} |
| 0dns | ${{ inputs.zdns_branch }} |
repo-token: ${{ inputs.github_token }}

Expand Down Expand Up @@ -293,7 +293,7 @@ runs:
| authorizer | ${{ inputs.authorizer_branch }} |
| 0box | ${{ inputs.zbox_branch }} |
| zvault | ${{ inputs.zvault_branch }} |
| zauth | ${{ inputs.zauth_branch }} |
| zauth-server | ${{ inputs.zauth_server_branch }} |
| 0dns | ${{ inputs.zdns_branch }} |
repo-token: ${{ inputs.github_token }}

Expand Down Expand Up @@ -335,7 +335,7 @@ runs:
| authorizer | ${{ inputs.authorizer_branch }} |
| 0box | ${{ inputs.zbox_branch }} |
| zvault | ${{ inputs.zvault_branch }} |
| zauth | ${{ inputs.zauth_branch }} |
| zauth-server | ${{ inputs.zauth_server_branch }} |
| 0dns | ${{ inputs.zdns_branch }} |
repo-token: ${{ inputs.github_token }}

Expand Down Expand Up @@ -377,7 +377,7 @@ runs:
| authorizer | ${{ inputs.authorizer_branch }} |
| 0box | ${{ inputs.zbox_branch }} |
| zvault | ${{ inputs.zvault_branch }} |
| zauth | ${{ inputs.zauth_branch }} |
| zauth-server | ${{ inputs.zauth_server_branch }} |
| 0dns | ${{ inputs.zdns_branch }} |
repo-token: ${{ inputs.github_token }}

Expand Down Expand Up @@ -419,7 +419,7 @@ runs:
| authorizer | ${{ inputs.authorizer_branch }} |
| 0box | ${{ inputs.zbox_branch }} |
| zvault | ${{ inputs.zvault_branch }} |
| zauth | ${{ inputs.zauth_branch }} |
| zauth-server | ${{ inputs.zauth_server_branch }} |
| 0dns | ${{ inputs.zdns_branch }} |
repo-token: ${{ inputs.github_token }}

Expand Down Expand Up @@ -461,7 +461,7 @@ runs:
| authorizer | ${{ inputs.authorizer_branch }} |
| 0box | ${{ inputs.zbox_branch }} |
| zvault | ${{ inputs.zvault_branch }} |
| zauth | ${{ inputs.zauth_branch }} |
| zauth-server | ${{ inputs.zauth_server_branch }} |
| 0dns | ${{ inputs.zdns_branch }} |
repo-token: ${{ inputs.github_token }}

Expand All @@ -472,7 +472,7 @@ runs:
owner: "0chain"
repo: "zauth-server"
id: zauth
- name: "Set zauth branch PR status"
- name: "Set zauth-server branch PR status"
uses: 0chain/actions/set-pr-status@master
if: steps.zauth.outputs.number
with:
Expand Down Expand Up @@ -503,6 +503,6 @@ runs:
| authorizer | ${{ inputs.authorizer_branch }} |
| 0box | ${{ inputs.zbox_branch }} |
| zvault | ${{ inputs.zvault_branch }} |
| zauth | ${{ inputs.zauth_branch }} |
| zauth-server | ${{ inputs.zauth_server_branch }} |
| 0dns | ${{ inputs.zdns_branch }} |
repo-token: ${{ inputs.github_token }}
10 changes: 10 additions & 0 deletions resolve-repo-snapshot/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ runs:
blobber_validator_branch: ${{ env.SNAPSHOT_BRANCH_BLOBBER }}
authorizer_branch: ${{ env.SNAPSHOT_BRANCH_TOKEN_BRIDGE_AUTHSERVER }}
zbox_branch: ${{ env.SNAPSHOT_BRANCH_0BOX }}
zvault_branch: ${{ env.SNAPSHOT_BRANCH_ZVAULT }}
zauth_server_branch: ${{ env.SNAPSHOT_BRANCH_ZAUTH-SERVER }}
zdns_branch: ${{ env.SNAPSHOT_BRANCH_0DNS }}
zs3server_branch: ${{ env.SNAPSHOT_BRANCH_ZS3SERVER }}
svc_account_secret: ${{ inputs.svc_account_secret }}
Expand Down Expand Up @@ -119,6 +121,14 @@ runs:
if [[ -n "${{ steps.get-images.outputs.zbox-tag }}" ]];then
echo "SNAPSHOT_BRANCH_ZBOX_TAG=$(echo '${{ steps.get-images.outputs.zbox-tag }}')" >> $GITHUB_ENV
fi
if [[ -n "${{ steps.get-images.outputs.zvault-tag }}" ]];then
echo "SNAPSHOT_BRANCH_ZVAULT_TAG=$(echo '${{ steps.get-images.outputs.zvault-tag }}')" >> $GITHUB_ENV
fi
if [[ -n "${{ steps.get-images.outputs.zauth-server-tag }}" ]];then
echo "SNAPSHOT_BRANCH_ZAUTH-SERVER=$(echo '${{ steps.get-images.outputs.zauth-server-tag }}')" >> $GITHUB_ENV
fi
if [[ -n "${{ steps.get-images.outputs.zdns-tag }}" ]];then
echo "SNAPSHOT_BRANCH_ZDNS_TAG=$(echo '${{ steps.get-images.outputs.zdns-tag }}')" >> $GITHUB_ENV
Expand Down

0 comments on commit 7ffa274

Please sign in to comment.