From 715cdb585e5dad57a10e559b0229ed8243085f34 Mon Sep 17 00:00:00 2001 From: Matt Curtis Date: Wed, 18 Oct 2023 16:00:18 +0100 Subject: [PATCH] review comments - renaming vars --- .../workflows/manual-deploy-testnet-l1.yml | 23 +++++++------ .../workflows/manual-deploy-testnet-l2.yml | 34 +++++++++---------- .../workflows/manual-upgrade-testnet-l2.yml | 12 +++---- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/.github/workflows/manual-deploy-testnet-l1.yml b/.github/workflows/manual-deploy-testnet-l1.yml index cc753c9bb0..51b5ce8be1 100644 --- a/.github/workflows/manual-deploy-testnet-l1.yml +++ b/.github/workflows/manual-deploy-testnet-l1.yml @@ -7,7 +7,7 @@ # WebSocket: 9000, 9001 # # Exposes the following addresses: (only accessible internally) -# testnet-eth2network-DEPLOYNUMBER.uksouth.azurecontainer.io +# uat-testnet-eth2network-DEPLOYNUMBER.uksouth.azurecontainer.io # or # dev-testnet-eth2network-DEPLOYNUMBER.uksouth.azurecontainer.io # @@ -68,25 +68,25 @@ jobs: uses: azure/CLI@v1 with: inlineScript: | - $(az resource list --tag ${{ vars.AZURE_RESOURCE_TAG_L1 }}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + $(az resource list --tag ${{ vars.AZURE_DEPLOY_GROUP_L1 }}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true # This will clean up any lingering dependencies - might fail if there are no resources to cleanup - name: 'Delete VMs dependencies' uses: azure/CLI@v1 with: inlineScript: | - $(az resource list --tag ${{ vars.AZURE_RESOURCE_TAG_L1 }}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + $(az resource list --tag ${{ vars.AZURE_DEPLOY_GROUP_L1 }}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true - - name: 'Create VM for "${{ vars.AZURE_RESOURCE_NAME_L1 }}-${{ GITHUB.RUN_NUMBER }}" on Azure' + - name: 'Create VM for "${{ github.event.inputs.testnet_type }}-eth2network-${{ GITHUB.RUN_NUMBER }}" on Azure' uses: azure/CLI@v1 with: inlineScript: | - az vm create -g Testnet -n "${{ vars.AZURE_RESOURCE_NAME_L1 }}-${{ GITHUB.RUN_NUMBER }}" \ + az vm create -g Testnet -n "${{ github.event.inputs.testnet_type }}-eth2network-${{ GITHUB.RUN_NUMBER }}" \ --admin-username obscurouser --admin-password "${{ secrets.OBSCURO_NODE_VM_PWD }}" \ - --public-ip-address-dns-name "${{ vars.AZURE_RESOURCE_NAME_L1 }}" \ - --tags ${{ vars.AZURE_RESOURCE_TAG_L1 }}=true \ - --vnet-name ${{ vars.AZURE_RESOURCE_NAME_L1 }}-01VNET --subnet ${{ vars.AZURE_RESOURCE_NAME_L1 }}-01Subnet \ + --public-ip-address-dns-name "${{ github.event.inputs.testnet_type }}-eth2network" \ + --tags ${{ vars.AZURE_DEPLOY_GROUP_L1 }}=true \ + --vnet-name ${{ github.event.inputs.testnet_type }}-eth2network-01VNET --subnet ${{ github.event.inputs.testnet_type }}-eth2network-01Subnet \ --size Standard_D3_v2 --image Canonical:0001-com-ubuntu-server-jammy:22_04-lts:latest \ --public-ip-sku Basic --authentication-type password @@ -94,18 +94,19 @@ jobs: uses: azure/CLI@v1 with: inlineScript: | - az vm open-port -g Testnet -n "${{ vars.AZURE_RESOURCE_NAME_L1 }}-${{ GITHUB.RUN_NUMBER }}" --port 8025,8026,9000,9001 + az vm open-port -g Testnet -n "${{ github.event.inputs.testnet_type }}-eth2network-${{ GITHUB.RUN_NUMBER }}" --port 8025,8026,9000,9001 # 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 - - name: 'Start l1 ${{ vars.AZURE_RESOURCE_NAME_L1 }}-${{ GITHUB.RUN_NUMBER }} on Azure' + - name: 'Start l1 ${{ github.event.inputs.testnet_type }}-eth2network-${{ GITHUB.RUN_NUMBER }} on Azure' uses: azure/CLI@v1 with: inlineScript: | - az vm run-command invoke -g Testnet -n "${{ vars.AZURE_RESOURCE_NAME_L1 }}-${{ GITHUB.RUN_NUMBER }}" \ + az vm run-command invoke -g Testnet -n "${{ github.event.inputs.testnet_type }}-eth2network-${{ GITHUB.RUN_NUMBER }}" \ + az vm run-command invoke -g Testnet -n "${{ github.event.inputs.testnet_type }}-eth2network-${{ GITHUB.RUN_NUMBER }}" \ --command-id RunShellScript \ --scripts 'mkdir -p /home/obscuro \ && sudo apt-get update \ diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index a533dc8911..d0db3f9ba7 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -103,14 +103,14 @@ jobs: uses: azure/CLI@v1 with: inlineScript: | - $(az resource list --tag ${{ vars.AZURE_RESOURCE_TAG_L2 }}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + $(az resource list --tag ${{ vars.AZURE_DEPLOY_GROUP_L2 }}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true # This will clean up any lingering dependencies - might fail if there are no resources to cleanup - name: 'Delete VMs dependencies' uses: azure/CLI@v1 with: inlineScript: | - $(az resource list --tag ${{ vars.AZURE_RESOURCE_TAG_L2 }}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true + $(az resource list --tag ${{ vars.AZURE_DEPLOY_GROUP_L2 }}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true - name: 'Upload L1 deployer container logs' uses: actions/upload-artifact@v3 @@ -176,11 +176,11 @@ jobs: uses: azure/CLI@v1 with: inlineScript: | - az vm create -g Testnet -n "${{ vars.AZURE_HOSTNAME_PREFIX }}-${{ matrix.host_id }}-${{ GITHUB.RUN_NUMBER }}" \ + az vm create -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ matrix.host_id }}-${{ GITHUB.RUN_NUMBER }}" \ --admin-username obscurouser --admin-password "${{ secrets.OBSCURO_NODE_VM_PWD }}" \ - --public-ip-address-dns-name "obscuronode-${{ matrix.host_id }}-${{ vars.AZURE_RESOURCE_NAME_L2 }}-${{ GITHUB.RUN_NUMBER }}" \ - --tags deploygroup=ObscuroNode-${{ vars.AZURE_RESOURCE_NAME_L2 }}-${{ GITHUB.RUN_NUMBER }} ${{ vars.AZURE_RESOURCE_TAG_L2 }}=true \ - --vnet-name ${{ vars.AZURE_RESOURCE_NAME_L2 }}-virtual-network --subnet ${{ vars.AZURE_RESOURCE_NAME_L2 }}-sub-network \ + --public-ip-address-dns-name "obscuronode-${{ matrix.host_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 @@ -188,7 +188,7 @@ jobs: uses: azure/CLI@v1 with: inlineScript: | - az vm open-port -g Testnet -n "${{ vars.AZURE_HOSTNAME_PREFIX }}-${{ matrix.host_id }}-${{ GITHUB.RUN_NUMBER }}" --port 80,81,6060,6061,10000 + az vm open-port -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ matrix.host_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' @@ -199,7 +199,7 @@ jobs: uses: azure/CLI@v1 with: inlineScript: | - az vm run-command invoke -g Testnet -n "${{ vars.AZURE_HOSTNAME_PREFIX }}-${{ matrix.host_id }}-${{ GITHUB.RUN_NUMBER }}" \ + az vm run-command invoke -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ matrix.host_id }}-${{ GITHUB.RUN_NUMBER }}" \ --command-id RunShellScript \ --scripts 'mkdir -p /home/obscuro \ && git clone --depth 1 -b ${{ env.BRANCH_NAME }} https://github.com/obscuronet/go-obscuro.git /home/obscuro/go-obscuro \ @@ -229,7 +229,7 @@ jobs: -l1_start=${{needs.build.outputs.L1_START_HASH}} \ -private_key=${{ secrets[matrix.node_pk_lookup] }} \ -sequencer_id=${{ vars.ACCOUNT_ADDR_NODE_0 }} \ - -host_public_p2p_addr=obscuronode-${{ matrix.host_id }}-${{ vars.AZURE_RESOURCE_NAME_L2 }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ + -host_public_p2p_addr=obscuronode-${{ matrix.host_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 }} \ @@ -258,18 +258,18 @@ jobs: creds: ${{ secrets.AZURE_CREDENTIALS }} - name: 'Remove existing backend nodes from the load balancer' - run: ./.github/workflows/runner-scripts/testnet-clear-loadbalancer.sh ${{ vars.AZURE_RESOURCE_NAME_L2 }} + 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 ${{ vars.AZURE_RESOURCE_NAME_L2 }}-backend-pool \ - --ip-config-name ipconfig${{ vars.AZURE_HOSTNAME_PREFIX }}-1-${{ GITHUB.RUN_NUMBER }} \ - --nic-name ${{ vars.AZURE_HOSTNAME_PREFIX }}-1-${{ GITHUB.RUN_NUMBER }}VMNic \ + --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 ${{ vars.AZURE_RESOURCE_NAME_L2 }}-loadbalancer + --lb-name ${{ github.event.inputs.testnet_type }}-loadbalancer check-obscuro-is-healthy: needs: @@ -284,8 +284,8 @@ jobs: - name: "Wait until obscuro node is healthy" shell: bash run: | - ./.github/workflows/runner-scripts/wait-node-healthy.sh --host=obscuronode-0-${{ vars.AZURE_RESOURCE_NAME_L2 }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com - ./.github/workflows/runner-scripts/wait-node-healthy.sh --host=obscuronode-1-${{ vars.AZURE_RESOURCE_NAME_L2 }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com + ./.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 deploy-l2-contracts: needs: @@ -302,7 +302,7 @@ jobs: shell: bash run: | go run ./testnet/launcher/l2contractdeployer/cmd \ - -l2_host=obscuronode-0-${{ vars.AZURE_RESOURCE_NAME_L2 }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com \ + -l2_host=obscuronode-0-${{ github.event.inputs.testnet_type }}-${{ GITHUB.RUN_NUMBER }}.uksouth.cloudapp.azure.com \ -l1_http_url=${{ secrets.L1_HTTP_URL }} \ -l2_ws_port=81 \ -private_key=${{ secrets.ACCOUNT_PK_WORKER }} \ diff --git a/.github/workflows/manual-upgrade-testnet-l2.yml b/.github/workflows/manual-upgrade-testnet-l2.yml index ac754d3825..562e386289 100644 --- a/.github/workflows/manual-upgrade-testnet-l2.yml +++ b/.github/workflows/manual-upgrade-testnet-l2.yml @@ -52,7 +52,7 @@ jobs: - name: 'Print GitHub variables' # This is a useful record of what the environment variables were at the time the job ran, for debugging and reference run: | - echo "GitHub Variables = ${{ toJSON(vars) }}"ยก + echo "GitHub Variables = ${{ toJSON(vars) }}" - name: 'Login via Azure CLI' uses: azure/login@v1 @@ -62,7 +62,7 @@ jobs: - name: 'Fetch latest VM hostnames by env tag and extract build number' id: fetch_hostnames run: | - VM_HOSTNAME=$(az vm list --query "[?tags.\"${{ vars.AZURE_RESOURCE_TAG_L2 }}\"=='true'].{Name:name}[0]" -g Testnet -o tsv) + VM_HOSTNAME=$(az vm list --query "[?tags.\"${{ vars.AZURE_DEPLOY_GROUP_L2 }}\"=='true'].{Name:name}[0]" -g Testnet -o tsv) VM_BUILD_NUMBER=$(echo $VM_HOSTNAME | perl -ne 'if (/(-[0-9]{1}-)(\d+)/) { print $2 }') # Extract build number from VM hostname, e.g. D-0-321 -> 321 echo "VM_BUILD_NUMBER=${VM_BUILD_NUMBER}" >> $GITHUB_ENV echo "VM_HOSTNAME: ${VM_HOSTNAME}" @@ -141,7 +141,7 @@ jobs: uses: azure/CLI@v1 with: inlineScript: | - az vm run-command invoke -g Testnet -n "${{ vars.AZURE_HOSTNAME_PREFIX }}-${{ matrix.host_id }}-${{ needs.build.outputs.VM_BUILD_NUMBER }}" \ + az vm run-command invoke -g Testnet -n "${{ vars.AZURE_RESOURCE_PREFIX }}-${{ matrix.host_id }}-${{ needs.build.outputs.VM_BUILD_NUMBER }}" \ --command-id RunShellScript \ --scripts ' docker pull ${{ vars.L2_HOST_DOCKER_BUILD_TAG }} \ @@ -157,7 +157,7 @@ jobs: -l1_ws_url=${{ secrets[matrix.node_l1_ws_lookup] }} \ -private_key=${{ secrets[matrix.node_pk_lookup] }} \ -sequencer_id=${{ vars.ACCOUNT_ADDR_NODE_0 }} \ - -host_public_p2p_addr=obscuronode-${{ matrix.host_id }}-${{ vars.AZURE_RESOURCE_NAME_L2 }}-${{ needs.build.outputs.VM_BUILD_NUMBER }}.uksouth.cloudapp.azure.com:10000 \ + -host_public_p2p_addr=obscuronode-${{ matrix.host_id }}-${{ github.event.inputs.testnet_type }}-${{ needs.build.outputs.VM_BUILD_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 }} \ @@ -181,8 +181,8 @@ jobs: - name: "Wait until obscuro node is healthy" shell: bash run: | - ./.github/workflows/runner-scripts/wait-node-healthy.sh --host=obscuronode-0-${{ vars.AZURE_RESOURCE_NAME_L2 }}-${{ needs.build.outputs.VM_BUILD_NUMBER }}.uksouth.cloudapp.azure.com - ./.github/workflows/runner-scripts/wait-node-healthy.sh --host=obscuronode-1-${{ vars.AZURE_RESOURCE_NAME_L2 }}-${{ needs.build.outputs.VM_BUILD_NUMBER }}.uksouth.cloudapp.azure.com + ./.github/workflows/runner-scripts/wait-node-healthy.sh --host=obscuronode-0-${{ github.event.inputs.testnet_type }}-${{ needs.build.outputs.VM_BUILD_NUMBER }}.uksouth.cloudapp.azure.com + ./.github/workflows/runner-scripts/wait-node-healthy.sh --host=obscuronode-1-${{ github.event.inputs.testnet_type }}-${{ needs.build.outputs.VM_BUILD_NUMBER }}.uksouth.cloudapp.azure.com deploy-faucet-on-dispatch: uses: ./.github/workflows/manual-deploy-testnet-faucet.yml