difftreelog
ci collator-selection for dockerhub
in: master
5 files changed
.docker/Dockerfile-collatorsdiffbeforeafterbothno changes
.docker/Dockerfile-collators.j2diffbeforeafterbothno changes
.docker/docker-compose.collators.j2diffbeforeafterbothno changes
.docker/docker-compose.tmp-collators.j2diffbeforeafterbothno changes
.github/workflows/collator-selection.ymldiffbeforeafterboth667# A workflow run is made up of one or more jobs that can run sequentially or in parallel7# A workflow run is made up of one or more jobs that can run sequentially or in parallel8jobs:8jobs:9 execution-marix:9 prepare-execution-marix:10 name: Prepare execution matrix10 name: Prepare execution matrix111112 runs-on: self-hosted-ci12 runs-on: self-hosted-ci35 network {quartz}, wasm_name {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}35 network {quartz}, wasm_name {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}36 network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}}36 network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}}3738 collator-selection-build:39 needs: prepare-execution-marix40 # The type of runner that the job will run on41 runs-on: [self-hosted-ci,large]42 timeout-minutes: 13804344 name: ${{ matrix.network }}-build45 strategy:46 matrix:47 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}4849 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.5051 steps:52 - name: Clean Workspace53 uses: AutoModality/action-clean@v1.1.05455 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it56 - uses: actions/checkout@v357 with:58 ref: ${{ github.head_ref }} #Checking out head commit5960 - name: Read .env file61 uses: xom9ikk/dotenv@v26263 # Prepare SHA 64 - name: Prepare SHA65 uses: ./.github/actions/prepare6667 # Build main image for FORKLESS-UPDATE-NODATA68 - name: Generate ENV related extend Dockerfile file69 uses: cuchi/jinja2-action@v1.2.070 with:71 template: .docker/Dockerfile-collators.j272 output_file: .docker/Dockerfile-collators.${{ matrix.network }}.yml73 variables: |74 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}75 NETWORK=${{ matrix.network }}76 POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}77 POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}78 BRANCH=${{ github.head_ref }}7980 - name: Show build configuration81 run: cat .docker/Dockerfile-collators.${{ matrix.network }}.yml8283 - name: Run find-and-replace to remove slashes from branch name84 uses: mad9000/actions-find-and-replace-string@485 id: branchname86 with:87 source: ${{ github.head_ref }}88 find: '/'89 replace: '-'9091 - name: Set build SHA92 shell: bash93 run: |94 echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV9596 - name: Build the stack97 run: cd .docker/ && docker build --no-cache --file ./Dockerfile-collators.${{ matrix.network }}.yml --tag uniquenetwork/ci-collator-selection-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA ../9899 - name: Log in to Docker Hub100 uses: docker/login-action@v2.1.0101 with:102 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}103 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}104105 - name: Push docker image version106 run: docker push uniquenetwork/ci-collator-selection-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-$BUILD_SHA107108 - name: Remove builder cache109 if: always() # run this step always110 run: |111 docker builder prune -f112 docker system prune -f3711338 collator-selection:114 collator-selection-tests:39 needs: execution-marix115 needs: [prepare-execution-marix, collator-selection-build]40 # The type of runner that the job will run on116 # The type of runner that the job will run on41 runs-on: [self-hosted-ci,large]117 runs-on: [self-hosted-ci, large]11842 timeout-minutes: 1380119 timeout-minutes: 6004312044 name: ${{ matrix.network }}121 name: ${{ matrix.network }}-tests122123 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.12445 strategy:125 strategy:46 matrix:126 matrix:47 include: ${{fromJson(needs.execution-marix.outputs.matrix)}}127 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}4849 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.5012851 steps:129 steps:130 - name: Skip if pull request is in Draft131 if: github.event.pull_request.draft == true132 run: exit 113352 - name: Clean Workspace134 - name: Clean Workspace53 uses: AutoModality/action-clean@v1.1.0135 uses: AutoModality/action-clean@v1.1.05413655 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it137 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it56 - uses: actions/checkout@v3138 - uses: actions/checkout@v3.1.057 with:139 with:58 ref: ${{ github.head_ref }} #Checking out head commit140 ref: ${{ github.head_ref }} #Checking out head commit141142 - name: Prepare143 uses: ./.github/actions/prepare144145 - name: Set build SHA146 shell: bash147 run: |148 echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV149150 - name: Run find-and-replace to remove slashes from branch name151 uses: mad9000/actions-find-and-replace-string@4152 id: branchname153 with:154 source: ${{ github.head_ref }}155 find: '/'156 replace: '-'5915760 - name: Read .env file158 - name: Read .env file61 uses: xom9ikk/dotenv@v2159 uses: xom9ikk/dotenv@v26216063 - name: Generate ENV related extend file for docker-compose161 - name: Generate ENV related extend file for docker-compose64 uses: cuchi/jinja2-action@v1.2.0162 uses: cuchi/jinja2-action@v1.2.065 with:163 with:66 template: .docker/docker-compose.tmp-collators.j2164 template: .docker/docker-compose.collators.j267 output_file: .docker/docker-compose.collators.${{ matrix.network }}.yml165 output_file: .docker/docker-compose.collators.${{ matrix.network }}.yml68 variables: |166 variables: |69 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}167 NETWORK=${{ matrix.network }}70 POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}168 BUILD_TAG=${{ steps.branchname.outputs.value }}-$BUILD_SHA71 POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}72 NETWORK=${{ matrix.network }}73 BRANCH=${{ github.head_ref }}7416975 - name: Show build configuration170 - name: Show build configuration76 run: cat .docker/docker-compose.collators.${{ matrix.network }}.yml171 run: cat .docker/docker-compose.collators.${{ matrix.network }}.yml7717278 - name: Show launch-config configuration173 - name: Log in to Docker Hub174 uses: docker/login-action@v2.1.0175 with:79 run: cat launch-config.json176 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}177 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}8017881 - name: Build the stack179 - name: Build the stack82 run: docker-compose -f ".docker/docker-compose.collators.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300180 run: docker-compose -f ".docker/docker-compose.collators.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 3008318184 # 🚀 POLKADOT LAUNCH COMPLETE 🚀182 # 🚀 POLKADOT LAUNCH COMPLETE 🚀85 - name: Check if docker logs consist messages related to testing of collator tests 183 - name: Check if docker logs consist messages related to testing of collator tests 86 if: success()184 if: success()87 run: |185 run: |88 counter=160186 counter=16089 function check_container_status {187 function check_container_status {90 docker inspect -f {{.State.Running}} parachain-collators188 docker inspect -f {{.State.Running}} collator-selection-${{ matrix.network }}91 }189 }92 function do_docker_logs {190 function do_docker_logs {93 docker logs --details parachain-collators 2>&1191 docker logs --details collator-selection-${{ matrix.network }} 2>&194 }192 }95 function is_started {193 function is_started {96 if [ "$(check_container_status)" == "true" ]; then194 if [ "$(check_container_status)" == "true" ]; then97 echo "Container: collator-${{ matrix.network }}-testnet-local RUNNING";195 echo "Container: collator-selection-${{ matrix.network }} RUNNING";98 echo "Check Docker logs"196 echo "Check Docker logs"99 DOCKER_LOGS=$(do_docker_logs)197 DOCKER_LOGS=$(do_docker_logs)100 if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then198 if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then101 echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"199 echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"102 return 0200 return 0103 else201 else104 echo "Message not found in logs output, repeating..."202 echo "Message not found in logs output, repeating..."105 return 1203 return 1106 fi204 fi107 else205 else108 echo "Container collator-${{ matrix.network }}-testnet-local NOT RUNNING"206 echo "Container collator-selection-${{ matrix.network }} NOT RUNNING"109 echo "Halting all future checks"207 echo "Halting all future checks"110 exit 1208 exit 1111 fi209 fi112 echo "something goes wrong"210 echo "something goes wrong"113 exit 1211 exit 1114 }212 }115 while ! is_started; do213 while ! is_started; do116 echo "Waiting for special message in log files "214 echo "Waiting for special message in log files "117 sleep 30s215 sleep 30s118 counter=$(( $counter - 1 ))216 counter=$(( $counter - 1 ))119 echo "Counter: $counter"217 echo "Counter: $counter"120 if [ "$counter" -gt "0" ]; then218 if [ "$counter" -gt "0" ]; then121 continue219 continue122 else220 else123 break221 break124 fi222 fi125 done223 done126 echo "Halting script"224 echo "Halting script"127 exit 0225 exit 0128 shell: bash226 shell: bash129227130 - uses: actions/setup-node@v3228 - uses: actions/setup-node@v3160258161 - name: Remove builder cache259 - name: Remove builder cache162 if: always() # run this step always260 if: always() # run this step always163 run: |261 run: |164 docker builder prune -f -a262 docker builder prune -f -a165 docker system prune -f263 docker system prune -f166264265