Bug 1860163

Summary: Prunning of images doesn't appaer to be working
Product: OpenShift Container Platform Reporter: aaleman
Component: Image RegistryAssignee: Oleg Bulatov <obulatov>
Status: CLOSED ERRATA QA Contact: Wenjing Zheng <wzheng>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 3.11.0CC: aos-bugs, cshea, fshaikh, obulatov, openshift-bugs-escalate, pasik, rcarrier, rupatel, sburke, skuznets
Target Milestone: ---   
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: the method for tracking dependencies between objects is slow Consequence: sometimes it was working more than 5 days without any visible progress Fix: change the underlying mechanism Result: the pruner has better parallelism and works faster
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 16:16:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
image_count_graph none

Description aaleman 2020-07-23 19:53:24 UTC
Created attachment 1702270 [details]
image_count_graph

Description of problem:

On our 3.11 cluster used for CI we periodically prune images via a pod that looks like this:
```
    containers:
    - args:
      - adm
      - prune
      - images
      - --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt
      - --keep-tag-revisions=3
      - --keep-younger-than=96h
      - --confirm=true
      command:
      - oc
      image: quay.io/openshift/origin-cli:4.5
      imagePullPolicy: Always
      name: ""
      resources:
        limits:
          cpu: "2"
          memory: 8Gi
        requests:
          cpu: "1"
          memory: 4Gi
    serviceAccountName: image-pruner
```

The job always times out after four hours: https://prow.ci.openshift.org/job-history/gs/origin-ci-test/pr-logs/directory/rehearse-10177-periodic-ci-image-pruner

Impact:
This caused an outage of about 40 minutes today because the etcd went out of storage space. We worked around it by increasing the storage of etcd to 6gib from the default 4gib. This will only temporarily solve the problem as the number of images increases and once we are at 8gig we can not increase etcd storage further. This needs a fix until we hit that 8 gig limit or Openshift will not have CI anymore.


Attached a graph of the rising image count.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Steve Kuznetsov 2020-07-23 21:14:43 UTC
The job successfully ran for five days, but made no progress, either.

We MUST make changes to `oc adm prune` to make it run in parallel as needed or debugging this will be impossible.

Comment 6 Wenjing Zheng 2020-09-30 06:34:41 UTC
No bug found during regression test on image pruner, so verify this bug now on 
$ oc version
Client Version: 4.6.0-0.nightly-2020-09-29-170625
Server Version: 4.6.0-0.nightly-2020-09-29-170625
Kubernetes Version: v1.19.0+6ef2098

Comment 7 Oleg Bulatov 2020-10-06 11:16:18 UTC
*** Bug 1885545 has been marked as a duplicate of this bug. ***

Comment 8 Fatima 2020-10-06 11:24:12 UTC
*** Bug 1885545 has been marked as a duplicate of this bug. ***

Comment 14 errata-xmlrpc 2020-10-27 16:16:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4196