From 1e8bfc21e58e31a243e59b28680e63de81671e11 Mon Sep 17 00:00:00 2001 From: otherview Date: Tue, 29 Aug 2023 10:59:30 +0100 Subject: [PATCH] Uses a prebuilt obscuro node image --- .../workflows/manual-deploy-testnet-l2.yml | 6 +---- .../workflows/runner-scripts/create-vm.txt | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/runner-scripts/create-vm.txt diff --git a/.github/workflows/manual-deploy-testnet-l2.yml b/.github/workflows/manual-deploy-testnet-l2.yml index 68660687e1..5c8acf92f7 100644 --- a/.github/workflows/manual-deploy-testnet-l2.yml +++ b/.github/workflows/manual-deploy-testnet-l2.yml @@ -205,7 +205,7 @@ jobs: --public-ip-address-dns-name "obscuronode-${{ matrix.host_id }}-${{needs.build.outputs.RESOURCE_TESTNET_NAME}}-${{ GITHUB.RUN_NUMBER }}" \ --tags deploygroup=ObscuroNode-${{needs.build.outputs.RESOURCE_TESTNET_NAME}}-${{ GITHUB.RUN_NUMBER }} ${{needs.build.outputs.RESOURCE_TAG_NAME}}=true \ --vnet-name ObscuroHost-${{needs.build.outputs.RESOURCE_TESTNET_NAME}}-01VNET --subnet ObscuroHost-${{needs.build.outputs.RESOURCE_TESTNET_NAME}}-01Subnet \ - --size Standard_DC4s_v2 --image Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:20.04.202206220 \ + --size Standard_DC4s_v2 --image ObscuroConfUbuntu \ --public-ip-sku Basic --authentication-type password - name: 'Open Obscuro node-${{ matrix.host_id }} ports on Azure' @@ -227,10 +227,6 @@ jobs: --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 \ - && sudo apt-get update \ - && sudo apt-get install -y gcc \ - && sudo snap refresh && sudo snap install --channel=1.18 go --classic \ - && curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh \ && docker network create --driver bridge node_network || true \ && docker run -d --name datadog-agent \ --network node_network \ diff --git a/.github/workflows/runner-scripts/create-vm.txt b/.github/workflows/runner-scripts/create-vm.txt new file mode 100644 index 0000000000..c46f41e69a --- /dev/null +++ b/.github/workflows/runner-scripts/create-vm.txt @@ -0,0 +1,26 @@ + +# Steps to create a new image for obscuro nodes + +az vm create \ + --resource-group Testnet \ + --name MakeImageVM \ + --image Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:20.04.202206220 \ + --admin-username obscurouser --admin-password 'PWD' + +ssh obscurouser@IPADDRESS + +sudo apt-get update \ + && sudo apt-get install -y gcc \ + && sudo snap refresh && sudo snap install --channel=1.20 go --classic \ + && curl -fsSL https://get.docker.com -o get-docker.sh && sh ./get-docker.sh + +exit + +az vm deallocate --resource-group Testnet --name MakeImageVM +az vm generalize --resource-group Testnet --name MakeImageVM +az image create --resource-group Testnet --name ObscuroConfUbuntu --source MakeImageVM --hyper-v-generation V2 + +az vm delete --resource-group Testnet --name MakeImageVM --yes +az disk delete --resource-group Testnet --name MakeImageVM_OSDisk --yes +az network nic delete --resource-group Testnet --name MakeImageVM_NIC +