Brief Description
-----------------
Within a Debian/Minikube build environment, volumes are sometimes
orphaned, requiring a 'docker volume prune' the clean up.
CENGN uses a minikube based build environment. It was observed that the
docker volume for minikube had grown to over 200 GB.
docker system df -v
...
Local Volumes space usage:
VOLUME NAME
minikube-jenkins-stx-rc-stx-8-0-debian 1 95.9GB
minikube-jenkins-stx-debian-master 1 74.08GB
Entering the minikube container for minikube-jenkins-stx-rc-stx-8-0-debian, I observed this
docker system df -v
...
Local Volumes space usage:
The pipeline runs this code
...
stx control stop || true
# Prune minikube's docker, then stop minikube's top-level container
if [[ "$STX_PLATFORM" == "minikube" ]] ; then
profile_args=()
[[ -z "$MINIKUBENAME" ]] || profile_args+=("-p" "$MINIKUBENAME")
if minikube "${profile_args[@]}" status >/dev/null ; then
minikube "${profile_args[@]}" ssh -- 'docker system prune -f'
minikube "${profile_args[@]}" stop
fi
fi
Could the "CreatedAt" actually be the last modification time?
Could it be that the "stx control stop" have failed in some way?
At minimum, docker 'system prune -f --volumes' might also be needed in the jenkins pipeline, but that just masks the issue, and only benefits jenkins.
Severity
--------
Minor
Steps to Reproduce
------------------
unclear
Expected Behavior
------------------
Volumes are either deleted or reused. Never orphaned
Actual Behavior
----------------
State what is the actual behavior
Reproducibility
---------------
Intermittent. 4 out of 25 builds left orphans
System Configuration
--------------------
N/A
Branch/Pull Time/Commit
-----------------------
May 17, 2023
Last Pass
---------
N/A
Timestamp/Logs
--------------
See above
Test Activity
-------------
Build
Workaround
----------
Describe workaround if available
Brief Description
-----------------
Within a Debian/Minikube build environment, volumes are sometimes
orphaned, requiring a 'docker volume prune' the clean up.
CENGN uses a minikube based build environment. It was observed that the
docker volume for minikube had grown to over 200 GB.
docker system df -v
...
Local Volumes space usage:
VOLUME NAME jenkins- stx-rc- stx-8-0- debian 1 95.9GB jenkins- stx-debian- master 1 74.08GB
minikube-
minikube-
Entering the minikube container for minikube- jenkins- stx-rc- stx-8-0- debian, I observed this
docker system df -v
...
Local Volumes space usage:
VOLUME NAME LINKS SIZE 9f550a23dcba490 51588ee2f2af0c0 ef930c1bfa40db4 e8bb 0 16.48GB 10155a93e867528 b4c706cfda7a672 5802615fd179b6d 9c62 0 22.37GB 57d0c03e94d1bc3 57ad1865179cdbf 5c64eea82d0e40b 1d38 0 22.35GB 3136870db5b64d8 1078963e48bf2e2 6d45cb981d75ac1 46b7 1 213kB 668a29d594ac591 768d3536545593e 468ebd03efd34b8 89c4 0 23.03GB
557f6c9fb45724c
6c71a483b38db67
7dfe577906908f5
653e260e62cc0c5
49ebd2eb6645232
So there are four ~20GB volumes that are not being used, suggesting an intermittent issue that orphans volumes (4 orphans from 25 builds).
Now this minikube instance builds nightly, so whatever is orphaning volumes
must be on a failure path.
docker volume inspect 557f6c9fb45724c 9f550a23dcba490 51588ee2f2af0c0 ef930c1bfa40db4 e8bb
"CreatedAt" : "2023-05- 18T03:48: 05Z",
"Mountpoint" : "/var/lib/ docker/ volumes/ 557f6c9fb45724c 9f550a23dcba490 51588ee2f2af0c0 ef930c1bfa40db4 e8bb/_data" , c9f550a23dcba49 051588ee2f2af0c 0ef930c1bfa40db 4e8bb",
[
{
"Driver": "local",
"Labels": null,
"Name": "557f6c9fb45724
"Options": null,
"Scope": "local"
}
]
The 'CreatedAt' date converts to 2023-05-17T23:48:05 in local time
This maps to the run of 'stop-containers' step of the jenkins pipeline that was a 'green' build, with Jenkins logs ....
23:47:56 cd /home/localdisk /designer/ jenkins/ rc-stx- 8-0-debian/ repo/stx- tools
23:47:56 sourcing ./import-stx
23:47:59 release "rc-stx-8-0-debian" uninstalled
23:48:11 Deleted Containers:
The pipeline runs this code
...
stx control stop || true
# Prune minikube's docker, then stop minikube's top-level container args[@] }" status >/dev/null ; then args[@] }" ssh -- 'docker system prune -f' args[@] }" stop
if [[ "$STX_PLATFORM" == "minikube" ]] ; then
profile_args=()
[[ -z "$MINIKUBENAME" ]] || profile_args+=("-p" "$MINIKUBENAME")
if minikube "${profile_
minikube "${profile_
minikube "${profile_
fi
fi
Could the "CreatedAt" actually be the last modification time?
Could it be that the "stx control stop" have failed in some way?
At minimum, docker 'system prune -f --volumes' might also be needed in the jenkins pipeline, but that just masks the issue, and only benefits jenkins.
Severity
--------
Minor
Steps to Reproduce
------------------
unclear
Expected Behavior
------------------
Volumes are either deleted or reused. Never orphaned
Actual Behavior
----------------
State what is the actual behavior
Reproducibility
---------------
Intermittent. 4 out of 25 builds left orphans
System Configuration ------- ------
-------
N/A
Branch/Pull Time/Commit ------- ------- --
-------
May 17, 2023
Last Pass
---------
N/A
Timestamp/Logs
--------------
See above
Test Activity
-------------
Build
Workaround
----------
Describe workaround if available