git.delta.rocks / unique-network / refs/commits / 6fd78602200e

difftreelog

tests: change docker-compose file and workflow for forkless upgrade

Alexander Aksenov2022-08-18parent: #032326e.patch.diff
in: master

20 files changed

modified.docker/Dockerfile-parachain-upgradediffbeforeafterboth
25RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN25RUN rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN
2626
2727
28#RUN mkdir /unique_parachain28RUN mkdir /unique_parachain
29#WORKDIR /unique_parachain29WORKDIR /unique_parachain
3030
3131
32# ===== BUILD current version ======32# ===== BUILD current version ======
37ARG MAINNET_BRANCH=37ARG MAINNET_BRANCH=
38ARG REPO_URL=38ARG REPO_URL=
3939
40RUN mkdir /unique_parachain
41WORKDIR /unique_parachain40WORKDIR /unique_parachain
4241
43RUN git clone $REPO_URL -b $MAINNET_BRANCH . && \42RUN git clone $REPO_URL -b $MAINNET_BRANCH . && \
52ARG BRANCH=51ARG BRANCH=
53ARG REPO_URL=52ARG REPO_URL=
5453
55RUN mkdir /unique_parachain54COPY . /unique_parachain
56WORKDIR /unique_parachain55WORKDIR /unique_parachain
5756
58RUN git clone $REPO_URL -b $BRANCH . && \57RUN cargo build --features=$FEATURE --$PROFILE
59 cargo build --features=$FEATURE --$PROFILE
6058
61# ===== BUILD POLKADOT =====59# ===== BUILD POLKADOT =====
62FROM rust-builder as builder-polkadot60FROM rust-builder as builder-polkadot
6361
64ARG POLKADOT_BUILD_BRANCH=62ARG POLKADOT_BUILD_BRANCH=
65ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH63ENV POLKADOT_BUILD_BRANCH $POLKADOT_BUILD_BRANCH
6664
67RUN mkdir /unique_parachain65
68WORKDIR /unique_parachain66WORKDIR /unique_parachain
6967
70RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \68RUN git clone -b $POLKADOT_BUILD_BRANCH --depth 1 https://github.com/paritytech/polkadot.git && \
added.docker/Dockerfile-parachain-upgrade-datadiffbeforeafterboth

no changes

deleted.docker/docker-compose-forkless.yamldiffbeforeafterboth

no changes

added.docker/docker-compose-forkless.ymldiffbeforeafterboth

no changes

added.docker/docker-compose.opal.ymldiffbeforeafterboth

no changes

added.docker/docker-compose.tmp-forkless-data.j2diffbeforeafterboth

no changes

added.docker/docker-compose.tmp-forkless-nodata.j2diffbeforeafterboth

no changes

deleted.docker/docker-compose.tmp-forkless.j2diffbeforeafterboth

no changes

deleted.docker/forking/Dockerfile-parachain-live-forkdiffbeforeafterboth

no changes

deleted.docker/forking/docker-compose-fork.yamldiffbeforeafterboth

no changes

deleted.docker/forking/docker-compose.tmp-fork.j2diffbeforeafterboth

no changes

deleted.docker/forking/fork.jsonnetdiffbeforeafterboth

no changes

deleted.docker/forking/launch-config-fork.j2diffbeforeafterboth

no changes

added.docker/forkless-config/fork.jsonnetdiffbeforeafterboth

no changes

added.docker/forkless-config/launch-config-forkless-data.j2diffbeforeafterboth

no changes

added.docker/forkless-config/launch-config-forkless-nodata.j2diffbeforeafterboth

no changes

deleted.docker/launch-config.j2diffbeforeafterboth

no changes

deleted.github/workflows/fork-update-withdata.ymldiffbeforeafterboth

no changes

added.github/workflows/forkless-update-data.ymldiffbeforeafterboth

no changes

modified.github/workflows/forkless-update-nodata.ymldiffbeforeafterboth
1name: Upgrade nodata1name: upgrade nodata
22
3# Controls when the action will run.3# Controls when the action will run.
4on:4on:
61 forkless-update-nodata:61 forkless-update-nodata:
62 needs: prepare-execution-marix62 needs: prepare-execution-marix
63 # The type of runner that the job will run on63 # The type of runner that the job will run on
64 runs-on: [self-hosted-ci,medium]64 runs-on: [self-hosted-ci,large]
65 65
66 66
6767
109 - name: Generate ENV related extend file for docker-compose109 - name: Generate ENV related extend file for docker-compose
110 uses: cuchi/jinja2-action@v1.2.0110 uses: cuchi/jinja2-action@v1.2.0
111 with:111 with:
112 template: .docker/docker-compose.tmp-forkless.j2112 template: .docker/docker-compose.tmp-forkless-nodata.j2
113 output_file: .docker/docker-compose.${{ matrix.network }}.yml113 output_file: .docker/docker-compose.${{ matrix.network }}.yml
114 variables: |114 variables: |
115 REPO_URL=${{ github.server_url }}/${{ github.repository }}.git115 REPO_URL=${{ github.server_url }}/${{ github.repository }}.git
125 - name: Show build configuration125 - name: Show build configuration
126 run: cat .docker/docker-compose.${{ matrix.network }}.yml126 run: cat .docker/docker-compose.${{ matrix.network }}.yml
127127
128 - name: Generate launch-config.json128 - name: Generate launch-config-forkless-nodata.json
129 uses: cuchi/jinja2-action@v1.2.0129 uses: cuchi/jinja2-action@v1.2.0
130 with:130 with:
131 template: .docker/launch-config.j2131 template: .docker/forkless-config/launch-config-forkless-nodata.j2
132 output_file: .docker/launch-config-forkless.json132 output_file: .docker/launch-config-forkless-nodata.json
133 variables: |133 variables: |
134 FEATURE=${{ matrix.features }}134 FEATURE=${{ matrix.features }}
135 RUNTIME=${{ matrix.runtime }}135 RUNTIME=${{ matrix.runtime }}
136136
137 - name: Show launch-config-forkless configuration137 - name: Show launch-config-forkless configuration
138 run: cat .docker/launch-config-forkless.json138 run: cat .docker/launch-config-forkless-nodata.json
139139
140140
141 - name: Build the stack141 - name: Build the stack
142 run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300142 run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --force-recreate --timeout 300
143143
144 - name: Check if docker logs consist logs related to Runtime Upgrade testing.144 - name: Check if docker logs consist logs related to Runtime Upgrade testing.
145 if: success()145 if: success()
146 run: |146 run: |
147 counter=160147 counter=160
148 function check_container_status {148 function check_container_status {
149 docker inspect -f {{.State.Running}} node-parachain149 docker inspect -f {{.State.Running}} node-parachain
150 }150 }
151 function do_docker_logs {151 function do_docker_logs {
152 docker logs --details node-parachain 2>&1152 docker logs --details node-parachain 2>&1
153 }153 }
154 function is_started {154 function is_started {
155 if [ "$(check_container_status)" == "true" ]; then155 if [ "$(check_container_status)" == "true" ]; then
156 echo "Container: node-parachain RUNNING";156 echo "Container: node-parachain RUNNING";
157 echo "Check Docker logs"157 echo "Check Docker logs"
158 DOCKER_LOGS=$(do_docker_logs)158 DOCKER_LOGS=$(do_docker_logs)
159 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then159 if [[ ${DOCKER_LOGS} = *"🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"* ]];then
160 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"160 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸"
161 return 0161 return 0
162 exit 1162 elif [[ ${DOCKER_LOGS} = *"🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"* ]];then
163 else 163 echo "🚧 PARACHAINS' RUNTIME UPGRADE TESTING FAILED 🚧"
164 echo "🛸 PARACHAINS' RUNTIME UPGRADE TESTING COMPLETE 🛸 - Not found in logs output."164 return 1
165 return 1165 else
166 exit 1166 echo "Message not found in logs output, repeating..."
167 return 1
167 fi168 fi
168 else169 else
169 echo "Container node-parachain not RUNNING"170 echo "Container node-parachain not RUNNING"
170 echo "Halting all future checks"171 echo "Halting all future checks"
171 exit 1172 exit 1
172 fi173 fi
173 exit 0174 exit 0
174 }175 }
175 while ! is_started; do176 while ! is_started; do
176 echo "Waiting for special message in log files "177 echo "Waiting for special message in log files "
177 sleep 30s178 sleep 30s
178 counter=$(( $counter - 1 ))179 counter=$(( $counter - 1 ))
179 echo "Counter: $counter"180 echo "Counter: $counter"
180 if [ "$counter" -gt "0" ]; then181 if [ "$counter" -gt "0" ]; then
181 continue182 continue
182 else183 else
183 break184 break
184 fi185 fi
185 done186 done
186 echo "Halting script"187 echo "Halting script"
187 exit 0188 exit 0
188 shell: bash189 shell: bash
189190
190 - name: Collect Docker Logs191 - name: Collect Docker Logs
191 if: success() || failure()192 if: success() || failure()
192 uses: jwalton/gh-docker-logs@v2.2.0193 uses: jwalton/gh-docker-logs@v2.2.0
193 with:194 with:
194 dest: './forkless-parachain-update-nodata-logs.${{ matrix.features }}'195 dest: './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.log'
195 images: 'node-parachain' 196 images: 'node-parachain'
196197
197 - name: Tar logs198 - name: Show docker logs
198 if: success() || failure()
199 run: tar cvzf ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz ./forkless-parachain-update-nodata-logs.${{ matrix.features }}199 run: cat './forkless-parachain-upgrade-nodata-logs.${{ matrix.features }}.log'
200
201 - name: Upload logs to GitHub
202 if: success() || failure()
203 uses: actions/upload-artifact@master
204 with:
205 name: forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz
206 path: ./forkless-parachain-update-nodata-logs.${{ matrix.features }}.tgz
207200
208 - name: Stop running containers201 - name: Stop running containers
209 if: always() # run this step always202 if: always() # run this step always
210 run: docker-compose -f ".docker/docker-compose-forkless.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down203 run: docker-compose -f ".docker/docker-compose-forkless.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down
211204