Skip to content

Commit b900051

Browse files
committed
Improve workaround for docker getting stuck
Workaround was incomplete, we are still hitting bug: ``` Removing kernelci-pipeline-timeout ... done Removing kernelci-pipeline-result-summary ... done Removing network kernelci-pipeline_default ERROR: error while removing network: network kernelci-pipeline_default id e9b9771a22819f4b8189745026a08467dab3d008ae5f7a94abc9a464086c201a has active endpoints ``` Signed-off-by: Denys Fedoryshchenko <[email protected]>
1 parent efb45d9 commit b900051

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

staging.kernelci.org

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ cmd_rotate_tree() {
143143
echo $tree
144144
}
145145

146+
docker_workaround() {
147+
echo "Restarting containerd and docker"
148+
sudo systemctl restart containerd docker
149+
echo "Waiting 5 seconds for services to restart"
150+
sleep 5
151+
~/run-dozzle
152+
}
153+
146154
cmd_api_pipeline() {
147155
compose_files="\
148156
-f docker-compose.yaml \
@@ -158,14 +166,11 @@ cmd_api_pipeline() {
158166
git checkout origin/staging.kernelci.org
159167
echo "Pulling pipeline containers"
160168
docker-compose $compose_files pull
161-
docker-compose $compose_files down --remove-orphans
169+
docker-compose $compose_files down --remove-orphans || true
162170
# verify if it failed due orphaned network bug
163171
if [ $? -ne 0 ]; then
164172
echo "Failed to stop pipeline containers, restarting containerd and docker"
165-
sudo systemctl restart containerd docker
166-
echo "Waiting 5 seconds for services to restart"
167-
sleep 5
168-
~/run-dozzle
173+
docker_workaround
169174
echo "Attempting to restart pipeline containers again"
170175
docker-compose $compose_files down --remove-orphans
171176
fi
@@ -179,7 +184,14 @@ cmd_api_pipeline() {
179184
git checkout origin/staging.kernelci.org
180185
docker-compose pull $api_services
181186
echo "Stopping API containers"
182-
docker-compose down
187+
docker-compose down || true
188+
# verify if it failed due orphaned network bug
189+
if [ $? -ne 0 ]; then
190+
echo "Failed to stop API containers, restarting containerd and docker"
191+
docker_workaround
192+
echo "Attempting to restart API containers again"
193+
docker-compose down
194+
fi
183195
echo "Starting API containers"
184196
docker-compose up -d $api_services
185197
cd -

0 commit comments

Comments
 (0)