difftreelog
ci node only update changes (#956)
in: master
4 files changed
.docker/Dockerfile-parachain-node-onlydiffbeforeafterbothno changes
.docker/Dockerfile-parachain-node-only.j2diffbeforeafterbothno changes
.docker/docker-compose.node-only.j2diffbeforeafterbothno changes
.github/workflows/node-only-update.ymldiffbeforeafterboth11# A workflow run is made up of one or more jobs that can run sequentially or in parallel11# A workflow run is made up of one or more jobs that can run sequentially or in parallel12jobs:12jobs:131314 nodes-execution-matrix:14 prepare-execution-matrix:151516 name: execution matrix16 name: execution matrix171743 network {unique}, wasm_name {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}43 network {unique}, wasm_name {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}444546 node-only-update-build:4748 needs: prepare-execution-matrix49 # The type of runner that the job will run on50 runs-on: [self-hosted-ci]5152 timeout-minutes: 2880 # 48 hours for execution jobs.5354 name: ${{ matrix.network }}-build5556 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.5758 strategy:59 matrix:60 include: ${{fromJson(needs.prepare-execution-matrix.outputs.matrix)}}6162 steps:6364 - name: Skip if pull request is in Draft65 if: github.event.pull_request.draft == true66 run: exit 16768 - name: Clean Workspace69 uses: AutoModality/action-clean@v1.1.07071 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it72 - uses: actions/checkout@v3.1.073 with:74 ref: ${{ github.head_ref }} #Checking out head commit7576 # Prepare SHA 77 - name: Prepare SHA78 uses: ./.github/actions/prepare7980 - name: Read .env file81 uses: xom9ikk/dotenv@v28283 # Build main image for NODE-ONLY-UPDATE84 - name: Generate ENV related extend Dockerfile file85 uses: cuchi/jinja2-action@v1.2.086 with:87 template: .docker/Dockerfile-parachain-node-only.j288 output_file: .docker/Dockerfile-parachain-node-only.${{ matrix.network }}.yml89 variables: |90 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}91 NETWORK=${{ matrix.network }}92 MAINNET_BRANCH=${{ matrix.mainnet_branch }}93 POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}94 WASM_NAME=${{ matrix.wasm_name }}95 POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}9697 - name: Show build configuration98 run: cat .docker/Dockerfile-parachain-node-only.${{ matrix.network }}.yml99100 - name: Generate launch-config.json101 uses: cuchi/jinja2-action@v1.2.0102 with:103 template: .docker/forkless-config/launch-config-forkless-nodata.j2104 output_file: .docker/forkless-config/launch-config-node-only.json105 variables: |106 WASM_NAME=${{ matrix.wasm_name }}107 RELAY_CHAIN_TYPE=${{ env.RELAY_CHAIN_TYPE }}108109 - name: Show launch-config-forkless configuration110 run: cat .docker/forkless-config/launch-config-node-only.json111112 - name: Run find-and-replace to remove slashes from branch name113 uses: mad9000/actions-find-and-replace-string@4114 id: branchname115 with:116 source: ${{ github.head_ref }}117 find: '/'118 replace: '-'119120 - name: Set build SHA121 shell: bash122 run: |123 echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV124125 - name: Build the stack126 run: cd .docker/ && docker build --no-cache --file ./Dockerfile-parachain-node-only.${{ matrix.network }}.yml --tag uniquenetwork/ci-node-only-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA ../127128 - name: Log in to Docker Hub129 uses: docker/login-action@v2.1.0130 with:131 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}132 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}133134 - name: Push docker image version135 run: docker push uniquenetwork/ci-node-only-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA136137 - name: Remove builder cache138 if: always() # run this step always139 run: |140 docker builder prune -f141 docker system prune -f 441424514346 nodes-only-update:144 node-only-update-tests:47 needs: nodes-execution-matrix145 needs: [prepare-execution-matrix, node-only-update-build]48 # The type of runner that the job will run on146 # The type of runner that the job will run on49 runs-on: [self-hosted-ci]147 runs-on: [self-hosted-ci, large]5014851 timeout-minutes: 2880 # 48 hours for execution jobs.149 timeout-minutes: 28805215053 name: ${{ matrix.network }}151 name: ${{ matrix.network }}-tests5415255 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.153 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.5615457 strategy:155 strategy:58 matrix:156 matrix:59 include: ${{fromJson(needs.nodes-execution-matrix.outputs.matrix)}}157 include: ${{fromJson(needs.prepare-execution-matrix.outputs.matrix)}}6015861 steps:159 steps:160 - name: Skip if pull request is in Draft161 if: github.event.pull_request.draft == true162 run: exit 16216363 - name: Clean Workspace164 - name: Clean Workspace64 uses: AutoModality/action-clean@v1.1.0165 uses: AutoModality/action-clean@v1.1.068 with:169 with:69 ref: ${{ github.head_ref }} #Checking out head commit170 ref: ${{ github.head_ref }} #Checking out head commit7017171 - name: Read .env file172 - name: Prepare72 uses: xom9ikk/dotenv@v2173 uses: ./.github/actions/prepare174175 - name: Set build SHA176 shell: bash177 run: |178 echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV7317974 - name: Generate ENV related extend file for docker-compose180 - name: Run find-and-replace to remove slashes from branch name75 uses: cuchi/jinja2-action@v1.2.0181 uses: mad9000/actions-find-and-replace-string@4182 id: branchname76 with:183 with:77 template: .docker/docker-compose.tmp-node.j2184 source: ${{ github.head_ref }}78 output_file: .docker/docker-compose.node.${{ matrix.network }}.yml185 find: '/'79 variables: |186 replace: '-'80 REPO_URL=${{ github.server_url }}/${{ github.repository }}.git81 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}82 POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}83 POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}84 # POLKADOT_MAINNET_BRANCH=${{ env.POLKADOT_MAINNET_BRANCH }}85 # MAINNET_TAG=${{ matrix.mainnet_tag }}86 MAINNET_BRANCH=${{ matrix.mainnet_branch }}87 NETWORK=${{ matrix.network }}88 WASM_NAME=${{ matrix.wasm_name }}89 # BRANCH=${{ github.head_ref }}9018791 - name: Show build configuration188 - name: Read .env file92 run: cat .docker/docker-compose.node.${{ matrix.network }}.yml189 uses: xom9ikk/dotenv@v29319094 - name: Generate launch-config-forkless-nodata.json191 - name: Generate ENV related extend file for docker-compose95 uses: cuchi/jinja2-action@v1.2.0192 uses: cuchi/jinja2-action@v1.2.096 with:193 with:97 template: .docker/forkless-config/launch-config-forkless-nodata.j2194 template: .docker/docker-compose.node-only.j298 output_file: .docker/launch-config-forkless-nodata.json195 output_file: .docker/docker-compose.node-only.${{ matrix.network }}.yml99 variables: |196 variables: |100 NETWORK=${{ matrix.network }}197 NETWORK=${{ matrix.network }}101 WASM_NAME=${{ matrix.wasm_name }}198 BUILD_TAG=${{ steps.branchname.outputs.value }}-$BUILD_SHA102 RELAY_CHAIN_TYPE=${{ env.RELAY_CHAIN_TYPE }}103199104 - name: Show launch-config-forkless configuration200 - name: Show build configuration105 run: cat .docker/launch-config-forkless-nodata.json201 run: cat .docker/docker-compose.node-only.${{ matrix.network }}.yml106202107 - uses: actions/setup-node@v3.5.1203 - name: Log in to Docker Hub204 uses: docker/login-action@v2.1.0108 with:205 with:109 node-version: 16206 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}207 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}110208111 - name: Build the stack209 - name: Build the stack112 run: docker-compose -f ".docker/docker-compose.node.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate --timeout 300210 run: docker-compose -f ".docker/docker-compose.node-only.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300113211114 # 🚀 POLKADOT LAUNCH COMPLETE 🚀212 # 🚀 POLKADOT LAUNCH COMPLETE 🚀115 - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade.213 - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade.116 if: success()214 if: success()117 run: |215 run: |118 counter=160216 counter=160119 function check_container_status {217 function check_container_status {120 docker inspect -f {{.State.Running}} node-parachain218 docker inspect -f {{.State.Running}} node-only121 }219 }122 function do_docker_logs {220 function do_docker_logs {123 docker logs --details node-parachain 2>&1221 docker logs --details node-only 2>&1124 }222 }125 function is_started {223 function is_started {126 if [ "$(check_container_status)" == "true" ]; then224 if [ "$(check_container_status)" == "true" ]; then127 echo "Container: node-parachain RUNNING";225 echo "Container: node-only RUNNING";128 echo "Check Docker logs"226 echo "Check Docker logs"129 DOCKER_LOGS=$(do_docker_logs)227 DOCKER_LOGS=$(do_docker_logs)130 if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then228 if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then131 echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"229 echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"132 return 0230 return 0133 else231 else134 echo "Message not found in logs output, repeating..."232 echo "Message not found in logs output, repeating..."135 return 1233 return 1136 fi234 fi137 else235 else138 echo "Container node-parachain NOT RUNNING"236 echo "Container node-only NOT RUNNING"139 echo "Halting all future checks"237 echo "Halting all future checks"140 exit 1238 exit 1141 fi239 fi142 echo "something goes wrong"240 echo "something goes wrong"143 exit 1241 exit 1144 }242 }145 while ! is_started; do243 while ! is_started; do146 echo "Waiting for special message in log files "244 echo "Waiting for special message in log files "147 sleep 30s245 sleep 30s148 counter=$(( $counter - 1 ))246 counter=$(( $counter - 1 ))149 echo "Counter: $counter"247 echo "Counter: $counter"150 if [ "$counter" -gt "0" ]; then248 if [ "$counter" -gt "0" ]; then151 continue249 continue152 else250 else153 break251 break154 fi252 fi155 done253 done156 echo "Halting script"254 echo "Halting script"157 exit 0255 exit 0158 shell: bash256 shell: bash159257160 - name: Checkout at '${{ matrix.mainnet_branch }}' branch258 - name: Checkout at '${{ matrix.mainnet_branch }}' branch163 ref: ${{ matrix.mainnet_branch }} #Checking out head commit261 ref: ${{ matrix.mainnet_branch }} #Checking out head commit164 path: ${{ matrix.mainnet_branch }}262 path: ${{ matrix.mainnet_branch }}263264 - uses: actions/setup-node@v3.5.1265 with:266 node-version: 16165267166 - name: Run Parallel tests before Node Parachain upgrade268 - name: Run Parallel tests before Node Parachain upgrade167 working-directory: ${{ matrix.mainnet_branch }}/tests269 working-directory: ${{ matrix.mainnet_branch }}/tests176 env:278 env:177 RPC_URL: http://127.0.0.1:9944/279 RPC_URL: http://127.0.0.1:9944/178179 # - name: Upload Parallel Test Report Before Node upgrade180 # uses: phoenix-actions/test-reporting@v8181 # id: test-parallel-report-before182 # if: success() || failure() # run this step even if previous step failed183 # with:184 # name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created185 # path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-parallel-*.json # Path to test results186 # reporter: mochawesome-json187 # fail-on-error: 'false'188280189 - name: Run Sequential tests before Node Parachain upgrade281 - name: Run Sequential tests before Node Parachain upgrade190 if: success() || failure()282 if: success() || failure()193 env:285 env:194 RPC_URL: http://127.0.0.1:9944/286 RPC_URL: http://127.0.0.1:9944/195196 # - name: Upload Sequential Test Report Before Node upgrade197 # uses: phoenix-actions/test-reporting@v10198 # id: test-sequential-report-before199 # if: success() || failure() # run this step even if previous step failed200 # with:201 # name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created202 # path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-sequential-*.json # Path to test results203 # reporter: mochawesome-json204 # fail-on-error: 'false'205287206 - name: Send SIGUSR1 to polkadot-launch process288 - name: Send SIGUSR1 to polkadot-launch process207 if: success() || failure()289 if: success() || failure()208 run: |290 run: |209 #Get PID of polkadot-launch291 #Get PID of polkadot-launch210 ContainerID=$(docker ps -aqf "name=node-parachain")292 ContainerID=$(docker ps -aqf "name=node-only")211 PID=$(docker exec node-parachain pidof 'polkadot-launch')293 PID=$(docker exec node-only pidof 'polkadot-launch')212 sleep 30s294 sleep 30s213 echo -e "\n"295 echo -e "\n"214 echo -e "Restart polkadot-launch process: $PID\n"296 echo -e "Restart polkadot-launch process: $PID\n"215 docker exec node-parachain kill -SIGUSR1 ${PID}297 docker exec node-only kill -SIGUSR1 ${PID}216 echo "SIGUSR1 sent to Polkadot-launch PID: $PID"298 echo "SIGUSR1 sent to Polkadot-launch PID: $PID"217 sleep 60s299 sleep 60s218 echo -e "Show logs of node-parachain container.\n"300 echo -e "Show logs of node-only container.\n"219 docker logs ${ContainerID}301 docker logs ${ContainerID}220302221 - name: Get chain logs in case of docker image crashed after Polkadot Launch restart303 - name: Get chain logs in case of docker image crashed after Polkadot Launch restart222 if: failure() # run this step only at failure304 if: failure() # run this step only at failure223 run: |305 run: |224 docker exec node-parachain tail -n 1000 /polkadot-launch/9944.log306 docker exec node-only tail -n 1000 /polkadot-launch/9944.log225 docker exec node-parachain tail -n 1000 /polkadot-launch/9945.log307 docker exec node-only tail -n 1000 /polkadot-launch/9945.log226 docker exec node-parachain tail -n 1000 /polkadot-launch/alice.log308 docker exec node-only tail -n 1000 /polkadot-launch/alice.log227309228 - name: copy chain log files from container to the host310 - name: copy chain log files from container to the host229 if: success() || failure() # run this step even if previous step failed311 if: success() || failure() # run this step even if previous step failed230 run: |312 run: |231 mkdir -p /tmp/node-only-update313 mkdir -p /tmp/node-only-update232 docker cp node-parachain:/polkadot-launch/9944.log /tmp/node-only-update/314 docker cp node-only:/polkadot-launch/9944.log /tmp/node-only-update/233 docker cp node-parachain:/polkadot-launch/9945.log /tmp/node-only-update/315 docker cp node-only:/polkadot-launch/9945.log /tmp/node-only-update/234 docker cp node-parachain:/polkadot-launch/alice.log /tmp/node-only-update/316 docker cp node-only:/polkadot-launch/alice.log /tmp/node-only-update/235317236 - name: Upload chain log files318 - name: Upload chain log files237 if: success() || failure()319 if: success() || failure()243325244 - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade.326 - name: Check if docker logs consist messages related to testing of Node Parachain Upgrade.245 if: success()327 if: success()246 run: |328 run: |247 counter=160329 counter=160248 function check_container_status {330 function check_container_status {249 docker inspect -f {{.State.Running}} node-parachain331 docker inspect -f {{.State.Running}} node-only250 }332 }251 function do_docker_logs {333 function do_docker_logs {252 docker logs --details node-parachain 2>&1334 docker logs --details node-only 2>&1253 }335 }254 function is_started {336 function is_started {255 if [ "$(check_container_status)" == "true" ]; then337 if [ "$(check_container_status)" == "true" ]; then256 echo "Container: node-parachain RUNNING";338 echo "Container: node-only RUNNING";257 echo "Check Docker logs"339 echo "Check Docker logs"258 DOCKER_LOGS=$(do_docker_logs)340 DOCKER_LOGS=$(do_docker_logs)259 if [[ ${DOCKER_LOGS} = *"All parachain collators restarted with the new binaries."* ]];then341 if [[ ${DOCKER_LOGS} = *"All parachain collators restarted with the new binaries."* ]];then260 echo "🌗 All parachain collators restarted with the new binaries."342 echo "🌗 All parachain collators restarted with the new binaries."261 return 0343 return 0262 else344 else263 echo "Message not found in logs output, repeating..."345 echo "Message not found in logs output, repeating..."264 return 1346 return 1265 fi347 fi266 else348 else267 echo "Container node-parachain NOT RUNNING"349 echo "Container node-only NOT RUNNING"268 echo "Halting all future checks"350 echo "Halting all future checks"269 exit 1351 exit 1270 fi352 fi271 echo "something goes wrong"353 echo "something goes wrong"272 exit 1354 exit 1273 }355 }274 while ! is_started; do356 while ! is_started; do275 echo "Waiting for special message in log files "357 echo "Waiting for special message in log files "276 sleep 30s358 sleep 30s277 counter=$(( $counter - 1 ))359 counter=$(( $counter - 1 ))278 echo "Counter: $counter"360 echo "Counter: $counter"279 if [ "$counter" -gt "0" ]; then361 if [ "$counter" -gt "0" ]; then280 continue362 continue281 else363 else282 break364 break283 fi365 fi284 done366 done285 echo "Halting script"367 echo "Halting script"286 exit 0368 exit 0287 shell: bash369 shell: bash288370289 - name: Run Parallel tests after Node Parachain upgrade371 - name: Run Parallel tests after Node Parachain upgrade299 env:381 env:300 RPC_URL: http://127.0.0.1:9944/382 RPC_URL: http://127.0.0.1:9944/301302 #- name: Test Report Parallel After Node upgrade303 # uses: phoenix-actions/test-reporting@v10304 # id: test-report-parallel-after305 # if: success() || failure() # run this step even if previous step failed306 # with:307 # name: Tests after node upgrade ${{ matrix.network }} # Name of the check run which will be created308 # path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-parallel-*.json # Path to test results309 # reporter: mochawesome-json310 # fail-on-error: 'false'311383312 - name: Run Sequential tests after Node Parachain upgrade384 - name: Run Sequential tests after Node Parachain upgrade313 if: success() || failure()385 if: success() || failure()316 env:388 env:317 RPC_URL: http://127.0.0.1:9944/389 RPC_URL: http://127.0.0.1:9944/318319 #- name: Upload Sequential Test Report After Node upgrade320 # uses: phoenix-actions/test-reporting@v10321 # id: test-sequential-report-after322 # if: success() || failure() # run this step even if previous step failed323 # with:324 # name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created325 # path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-sequential-*.json # Path to test results326 # reporter: mochawesome-json327 # fail-on-error: 'false'328390329 - name: Stop running containers391 - name: Stop running containers330 if: always() # run this step always392 if: always() # run this step always331 run: docker-compose -f ".docker/docker-compose.node.${{ matrix.network }}.yml" down --volumes393 run: docker-compose -f ".docker/docker-compose.node-only.${{ matrix.network }}.yml" down332394333 - name: Remove builder cache395 - name: Remove builder cache334 if: always() # run this step always396 if: always() # run this step always