-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add New Node Flow fixes #1712
Add New Node Flow fixes #1712
Changes from all commits
29140ba
4720e32
bda3bcf
60a45ee
e79e913
3792c75
7aaafdd
fdb8c05
57dcce5
a58c598
d12a540
30f5fd8
3bde2ac
6f9c00e
5d1fd19
96003ff
b6677bf
cbde85f
db662be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -3,6 +3,21 @@ | |||||||||||||||||||
# This script uses GitHub Environments for variables (vars) and secrets - these are configured on GitHub and | ||||||||||||||||||||
# the environments match the input.testnet_type options | ||||||||||||||||||||
# | ||||||||||||||||||||
# # # # README # # # # | ||||||||||||||||||||
# | ||||||||||||||||||||
# 1 - Fetch the Management, Msg Bus Contract addresses and L1 Start Hash from: | ||||||||||||||||||||
# curl -X POST erpc.dev-testnet.obscu.ro:80 -H 'Content-Type: application/json' \ | ||||||||||||||||||||
# -d '{"jsonrpc":"2.0","method":"obscuro_config","params":[],"id":1}' | ||||||||||||||||||||
# | ||||||||||||||||||||
# 2 - Update the secrets in Github | ||||||||||||||||||||
# ADD_NEW_NODE_L1_WS_URL -> l1 WS url | ||||||||||||||||||||
# ADD_NEW_NODE_PRIVATE_KEY -> L1 and L2 Private Key | ||||||||||||||||||||
# Note: L1 PK Must have funds in it | ||||||||||||||||||||
# | ||||||||||||||||||||
# 3 - Trigger the flow and supply data from Step 1. | ||||||||||||||||||||
# Node Id: is the node number | ||||||||||||||||||||
# Node Account Address: is the Account Address of the ADD_NEW_NODE_PRIVATE_KEY | ||||||||||||||||||||
# | ||||||||||||||||||||
|
||||||||||||||||||||
name: '[M] Deploy Testnet Validator' | ||||||||||||||||||||
run-name: '[M] Deploy Testnet Validator ( ${{ github.event.inputs.testnet_type }} )' | ||||||||||||||||||||
|
@@ -23,18 +38,14 @@ on: | |||||||||||||||||||
required: true | ||||||||||||||||||||
default: 3 | ||||||||||||||||||||
type: number | ||||||||||||||||||||
node_private_key: | ||||||||||||||||||||
description: 'Node Private Key' | ||||||||||||||||||||
node_id: | ||||||||||||||||||||
description: 'Node id' | ||||||||||||||||||||
required: true | ||||||||||||||||||||
type: string | ||||||||||||||||||||
node_account_address: | ||||||||||||||||||||
description: 'Node Account Address' | ||||||||||||||||||||
required: true | ||||||||||||||||||||
type: string | ||||||||||||||||||||
node_l1_ws_url: | ||||||||||||||||||||
description: 'Node L1 Connection String' | ||||||||||||||||||||
required: true | ||||||||||||||||||||
type: string | ||||||||||||||||||||
MGMT_CONTRACT_ADDR: | ||||||||||||||||||||
description: 'Management Contract Addr' | ||||||||||||||||||||
required: true | ||||||||||||||||||||
|
@@ -47,14 +58,7 @@ on: | |||||||||||||||||||
description: 'L1 Starting Hash' | ||||||||||||||||||||
required: true | ||||||||||||||||||||
type: string | ||||||||||||||||||||
HOC_ERC20_ADDR: | ||||||||||||||||||||
description: 'HOC ERC20 Contract Addr' | ||||||||||||||||||||
required: true | ||||||||||||||||||||
type: string | ||||||||||||||||||||
POC_ERC20_ADDR: | ||||||||||||||||||||
description: 'POC ERC20 Contract Addr' | ||||||||||||||||||||
required: true | ||||||||||||||||||||
type: string | ||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
jobs: | ||||||||||||||||||||
build: | ||||||||||||||||||||
|
@@ -115,34 +119,34 @@ jobs: | |||||||||||||||||||
with: | ||||||||||||||||||||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||||||||||||||||||||
|
||||||||||||||||||||
- name: 'Create VM for Obscuro node-${{ matrix.host_id }} on Azure' | ||||||||||||||||||||
- name: 'Create VM for Obscuro node-${{ github.event.inputs.node_id }} on Azure' | ||||||||||||||||||||
uses: azure/CLI@v1 | ||||||||||||||||||||
with: | ||||||||||||||||||||
inlineScript: | | ||||||||||||||||||||
az vm create -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ matrix.host_id }}-${{ GITHUB.RUN_NUMBER }}" \ | ||||||||||||||||||||
az vm create -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ github.event.inputs.node_id }}-${{ GITHUB.RUN_NUMBER }}" \ | ||||||||||||||||||||
--admin-username obscurouser --admin-password "${{ secrets.OBSCURO_NODE_VM_PWD }}" \ | ||||||||||||||||||||
--public-ip-address-dns-name "obscuronode-${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}" \ | ||||||||||||||||||||
--public-ip-address-dns-name "obscuronode-${{ github.event.inputs.node_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}" \ | ||||||||||||||||||||
--tags deploygroup=ObscuroNode-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }} ${{ vars.AZURE_DEPLOY_GROUP_L2 }}=true \ | ||||||||||||||||||||
--vnet-name ${{ github.event.inputs.testnet_type }}-virtual-network --subnet ${{ github.event.inputs.testnet_type }}-sub-network \ | ||||||||||||||||||||
--size Standard_DC8_v2 --storage-sku StandardSSD_LRS --image ObscuroConfUbuntu \ | ||||||||||||||||||||
--public-ip-sku Standard --authentication-type password | ||||||||||||||||||||
|
||||||||||||||||||||
- name: 'Open Obscuro node-${{ matrix.host_id }} ports on Azure' | ||||||||||||||||||||
- name: 'Open Obscuro node-${{ github.event.inputs.host_id }} ports on Azure' | ||||||||||||||||||||
uses: azure/CLI@v1 | ||||||||||||||||||||
with: | ||||||||||||||||||||
inlineScript: | | ||||||||||||||||||||
az vm open-port -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ matrix.host_id }}-${{ GITHUB.RUN_NUMBER }}" --port 80,81,6060,6061,10000 | ||||||||||||||||||||
az vm open-port -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ github.event.inputs.node_id }}-${{ GITHUB.RUN_NUMBER }}" --port 80,81,6060,6061,10000 | ||||||||||||||||||||
|
||||||||||||||||||||
# To overcome issues with critical VM resources being unavailable, we need to wait for the VM to be ready | ||||||||||||||||||||
- name: 'Allow time for VM initialization' | ||||||||||||||||||||
shell: bash | ||||||||||||||||||||
run: sleep 60 | ||||||||||||||||||||
Comment on lines
141
to
143
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using - sleep 60
+ while ! nc -z $VM_IP $VM_PORT; do
+ sleep 1 # wait for 1 second before check again
+ done Committable suggestion
Suggested change
|
||||||||||||||||||||
|
||||||||||||||||||||
- name: 'Start Obscuro node-${{ matrix.host_id }} on Azure' | ||||||||||||||||||||
- name: 'Start Obscuro node-${{ github.event.inputs.node_id }} on Azure' | ||||||||||||||||||||
uses: azure/CLI@v1 | ||||||||||||||||||||
with: | ||||||||||||||||||||
inlineScript: | | ||||||||||||||||||||
az vm run-command invoke -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ matrix.host_id }}-${{ GITHUB.RUN_NUMBER }}" \ | ||||||||||||||||||||
az vm run-command invoke -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ github.event.inputs.node_id }}-${{ GITHUB.RUN_NUMBER }}" \ | ||||||||||||||||||||
--command-id RunShellScript \ | ||||||||||||||||||||
--scripts 'mkdir -p /home/obscuro \ | ||||||||||||||||||||
&& git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/ten-protocol/go-ten.git /home/obscuro/go-obscuro \ | ||||||||||||||||||||
|
@@ -166,13 +170,13 @@ jobs: | |||||||||||||||||||
-node_type=validator \ | ||||||||||||||||||||
-is_sgx_enabled=true \ | ||||||||||||||||||||
-host_id=${{ github.event.inputs.node_account_address }} \ | ||||||||||||||||||||
-l1_ws_url=${{ github.event.inputs.node_l1_ws_url }} \ | ||||||||||||||||||||
-l1_ws_url=${{ secrets.ADD_NEW_NODE_L1_WS_URL }} \ | ||||||||||||||||||||
-management_contract_addr=${{ github.event.inputs.MGMT_CONTRACT_ADDR }} \ | ||||||||||||||||||||
-message_bus_contract_addr=${{ github.event.inputs.MSG_BUS_CONTRACT_ADDR }} \ | ||||||||||||||||||||
-l1_start=${{ github.event.inputs.L1_START_HASH }} \ | ||||||||||||||||||||
-private_key=${{ github.event.inputs.node_private_key }} \ | ||||||||||||||||||||
-private_key=${{ secrets.ADD_NEW_NODE_PRIVATE_KEY }} \ | ||||||||||||||||||||
-sequencer_id=${{ vars.ACCOUNT_ADDR_NODE_0 }} \ | ||||||||||||||||||||
-host_public_p2p_addr=obscuronode-${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ | ||||||||||||||||||||
-host_public_p2p_addr=obscuronode-${{ github.event.inputs.node_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ | ||||||||||||||||||||
-host_p2p_port=10000 \ | ||||||||||||||||||||
-enclave_docker_image=${{ vars.L2_ENCLAVE_DOCKER_BUILD_TAG }} \ | ||||||||||||||||||||
-host_docker_image=${{ vars.L2_HOST_DOCKER_BUILD_TAG }} \ | ||||||||||||||||||||
|
@@ -185,34 +189,37 @@ jobs: | |||||||||||||||||||
start' | ||||||||||||||||||||
|
||||||||||||||||||||
|
||||||||||||||||||||
update-loadbalancer: | ||||||||||||||||||||
needs: | ||||||||||||||||||||
- build | ||||||||||||||||||||
- deploy | ||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||
environment: | ||||||||||||||||||||
name: ${{ github.event.inputs.testnet_type }} | ||||||||||||||||||||
steps: | ||||||||||||||||||||
- uses: actions/checkout@v3 | ||||||||||||||||||||
|
||||||||||||||||||||
- name: 'Login via Azure CLI' | ||||||||||||||||||||
uses: azure/login@v1 | ||||||||||||||||||||
with: | ||||||||||||||||||||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||||||||||||||||||||
|
||||||||||||||||||||
- name: 'Remove existing backend nodes from the load balancer' | ||||||||||||||||||||
run: ./.github/workflows/runner-scripts/testnet-clear-loadbalancer.sh ${{ github.event.inputs.testnet_type }} | ||||||||||||||||||||
|
||||||||||||||||||||
- name: 'Add load balancer address pool to the IP configuration' | ||||||||||||||||||||
uses: azure/CLI@v1 | ||||||||||||||||||||
with: | ||||||||||||||||||||
inlineScript: | | ||||||||||||||||||||
az network nic ip-config address-pool add \ | ||||||||||||||||||||
--address-pool ${{ github.event.inputs.testnet_type }}-backend-pool \ | ||||||||||||||||||||
--ip-config-name ipconfig${{ vars.AZURE_RESOURCE_PREFIX }}-1-${{ GITHUB.RUN_NUMBER }} \ | ||||||||||||||||||||
--nic-name ${{ vars.AZURE_RESOURCE_PREFIX }}-1-${{ GITHUB.RUN_NUMBER }}VMNic \ | ||||||||||||||||||||
--resource-group Testnet \ | ||||||||||||||||||||
--lb-name ${{ github.event.inputs.testnet_type }}-loadbalancer | ||||||||||||||||||||
# | ||||||||||||||||||||
# Load Balancer can't be updated until the L1 and L2 is bootstrapped | ||||||||||||||||||||
# | ||||||||||||||||||||
# update-loadbalancer: | ||||||||||||||||||||
# needs: | ||||||||||||||||||||
# - build | ||||||||||||||||||||
# - deploy | ||||||||||||||||||||
# runs-on: ubuntu-latest | ||||||||||||||||||||
# environment: | ||||||||||||||||||||
# name: ${{ github.event.inputs.testnet_type }} | ||||||||||||||||||||
# steps: | ||||||||||||||||||||
# - uses: actions/checkout@v3 | ||||||||||||||||||||
# | ||||||||||||||||||||
# - name: 'Login via Azure CLI' | ||||||||||||||||||||
# uses: azure/login@v1 | ||||||||||||||||||||
# with: | ||||||||||||||||||||
# creds: ${{ secrets.AZURE_CREDENTIALS }} | ||||||||||||||||||||
# | ||||||||||||||||||||
# - name: 'Remove existing backend nodes from the load balancer' | ||||||||||||||||||||
# run: ./.github/workflows/runner-scripts/testnet-clear-loadbalancer.sh ${{ github.event.inputs.testnet_type }} | ||||||||||||||||||||
# | ||||||||||||||||||||
# - name: 'Add load balancer address pool to the IP configuration' | ||||||||||||||||||||
# uses: azure/CLI@v1 | ||||||||||||||||||||
# with: | ||||||||||||||||||||
# inlineScript: | | ||||||||||||||||||||
# az network nic ip-config address-pool add \ | ||||||||||||||||||||
# --address-pool ${{ github.event.inputs.testnet_type }}-backend-pool \ | ||||||||||||||||||||
# --ip-config-name ipconfig${{ vars.AZURE_RESOURCE_PREFIX }}-${{ github.event.inputs.node_id }}-${{ GITHUB.RUN_NUMBER }} \ | ||||||||||||||||||||
# --nic-name ${{ vars.AZURE_RESOURCE_PREFIX }}-${{ github.event.inputs.node_id }}-${{ GITHUB.RUN_NUMBER }}VMNic \ | ||||||||||||||||||||
# --resource-group Testnet \ | ||||||||||||||||||||
# --lb-name ${{ github.event.inputs.testnet_type }}-loadbalancer | ||||||||||||||||||||
|
||||||||||||||||||||
check-obscuro-is-healthy: | ||||||||||||||||||||
needs: | ||||||||||||||||||||
|
@@ -227,5 +234,4 @@ jobs: | |||||||||||||||||||
- name: "Wait until obscuro node is healthy" | ||||||||||||||||||||
shell: bash | ||||||||||||||||||||
run: | | ||||||||||||||||||||
./.github/workflows/runner-scripts/wait-node-healthy.sh --host=obscuronode-0-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com | ||||||||||||||||||||
./.github/workflows/runner-scripts/wait-node-healthy.sh --host=obscuronode-1-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com | ||||||||||||||||||||
./.github/workflows/runner-scripts/wait-node-healthy.sh --host=obscuronode-${{ github.event.inputs.node_id }}-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,12 +43,12 @@ if [[ -z "${ipconfig_id}" ]]; then | |
exit 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using a non-zero exit status when the script exits due to not finding the |
||
fi | ||
|
||
az network nic ip-config address-pool remove \ | ||
--address-pool ${pool} \ | ||
--ip-config-name "${ipconfig_id}" \ | ||
--nic-name "${nic_id}" \ | ||
--resource-group Testnet \ | ||
--lb-name ${lb} \ | ||
#az network nic ip-config address-pool remove \ | ||
# --address-pool ${pool} \ | ||
# --ip-config-name "${ipconfig_id}" \ | ||
# --nic-name "${nic_id}" \ | ||
# --resource-group Testnet \ | ||
# --lb-name ${lb} \ | ||
Comment on lines
+46
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The block of code that removes an address pool from the network interface configuration has been commented out. If this is intentional to prevent the removal for now, ensure that there is a tracking mechanism (like a TODO or a ticket) to revisit this if the functionality needs to be restored in the future. |
||
|
||
|
||
echo 'Load balancer removed successfully' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The message 'Load balancer removed successfully' is misleading because the code that performs the removal is commented out. This message should be updated to reflect the current behavior of the script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of
HOC_ERC20_ADDR
andPOC_ERC20_ADDR
frommanual-deploy-testnet-validator.yml
is confirmed. However, these variables are still referenced in.github/workflows/manual-deploy-testnet-l2.yml
. This could be an oversight or intentional, depending on whether these workflows are interconnected or independent.HOC_ERC20_ADDR
andPOC_ERC20_ADDR
are still used in.github/workflows/manual-deploy-testnet-l2.yml
.Analysis chain
The declarations for
node_l1_ws_url
,HOC_ERC20_ADDR
, andPOC_ERC20_ADDR
have been removed. Confirm that there are no lingering references to these variables in the workflow.Scripts Executed
The following scripts were executed for the analysis:
Script:
Length of output: 394