CentOS / container-pipeline-service

Code, infrastructure and deployment backend for the CentOS Container Pipeline backing up build system for registry.centos.org
https://registry.centos.org
GNU General Public License v3.0
49 stars 27 forks source link

Remove image stage fails as base image removal is refused given base image is being used #627

Open navidshaikh opened 6 years ago

navidshaikh commented 6 years ago

This has to be taken care in our workflow side.

Logs :

OpenShift Build pipeline/openshift-origin-source-latest-1 from git://github.com/mohammedzee1000/origin
[Pipeline] properties
[Pipeline] podTemplate
[Pipeline] {
[Pipeline] node
Still waiting to schedule task
Waiting for next available executor on ccp-pipeline-master
Running on ccp-pipeline-master-d3fnw-vhv0s in /tmp/workspace/pipeline/pipeline-openshift-origin-source-latest
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout Source)
[Pipeline] checkout
Cloning the remote Git repository
Using shallow clone
Cloning repository git://github.com/mohammedzee1000/origin
 > git init /tmp/workspace/pipeline/pipeline-openshift-origin-source-latest/openshift-origin-source-latest # timeout=10
Fetching upstream changes from git://github.com/mohammedzee1000/origin
 > git --version # timeout=10
 > git fetch --tags --progress git://github.com/mohammedzee1000/origin +refs/heads/*:refs/remotes/origin/* --depth=1 # timeout=10
 > git config remote.origin.url git://github.com/mohammedzee1000/origin # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url git://github.com/mohammedzee1000/origin # timeout=10
Fetching upstream changes from git://github.com/mohammedzee1000/origin
 > git fetch --tags --progress git://github.com/mohammedzee1000/origin +refs/heads/*:refs/remotes/origin/* --depth=1 # timeout=10
 > git rev-parse origin/3.9_origin-source_cccp_yaml^{commit} # timeout=10
Checking out Revision faf70acab9436507cdeb00eef5fb2d8d3f163150 (origin/3.9_origin-source_cccp_yaml)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f faf70acab9436507cdeb00eef5fb2d8d3f163150
Commit message: "Temporarily adding Dockerfile.pipeline."
First time build. Skipping changelog.
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Prebuild source repo)
[Pipeline] echo
Prebuild is not requested
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Lint the Dockerfile)
[Pipeline] dir
Running in /tmp/workspace/pipeline/pipeline-openshift-origin-source-latest/openshift-origin-source-latest/images/source
[Pipeline] {
[Pipeline] sh
[source] Running shell script
+ dockerfile_lint Dockerfile.pipeline
[source] Running shell script
+ cat result

# Analyzing Dockerfile

--------ERRORS---------

ERROR: Required LABEL name/key 'Name' is not defined. 
Reference -> http://docs.projectatomic.io/container-best-practices/#_recommended_labels_for_your_project

ERROR: Required LABEL name/key 'Version' is not defined. 
Reference -> http://docs.projectatomic.io/container-best-practices/#_recommended_labels_for_your_project

--------INFO---------

INFO: There is no 'EXPOSE' instruction. Without exposed ports how will the service of the container be accessed?. 
Reference -> https://docs.docker.com/engine/reference/builder/#expose

INFO: There is no 'CMD' instruction. None. 
Reference -> https://docs.docker.com/engine/reference/builder/#cmd

[Pipeline] sh
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build Docker image)
Running in /tmp/workspace/pipeline/pipeline-openshift-origin-source-latest/openshift-origin-source-latest/images/source
[Pipeline] dir
[Pipeline] {
[Pipeline] sh
[source] Running shell script
+ docker build --no-cache -t openshift/origin-source:latest -f Dockerfile.pipeline ./
Sending build context to Docker daemon 8.704 kB

Step 1/2 : FROM centos:7
 ---> 5182e96772bf
Step 2/2 : RUN yum -y install centos-release-openshift-origin39 && yum clean all
 ---> Running in 82fc768e0688

Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
 * base: ftp.osuosl.org
 * extras: reflector.westga.edu
 * updates: mirror.cogentco.com
Resolving Dependencies
--> Running transaction check
---> Package centos-release-openshift-origin39.noarch 0:1-1.el7.centos will be installed
--> Processing Dependency: centos-release-paas-common for package: centos-release-openshift-origin39-1-1.el7.centos.noarch
--> Running transaction check
---> Package centos-release-paas-common.noarch 0:1-1.el7.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                             Arch     Version            Repository
                                                                           Size
================================================================================
Installing:
 centos-release-openshift-origin39   noarch   1-1.el7.centos     extras    11 k
Installing for dependencies:
 centos-release-paas-common          noarch   1-1.el7.centos     extras    11 k

Transaction Summary
================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 22 k
Installed size: 37 k
Downloading packages:
Public key for centos-release-paas-common-1-1.el7.centos.noarch.rpm is not installed
warning: /var/cache/yum/x86_64/7/extras/packages/centos-release-paas-common-1-1.el7.centos.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-5.1804.1.el7.centos.x86_64 (@Updates)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
--------------------------------------------------------------------------------
Total                                               89 kB/s |  22 kB  00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : centos-release-paas-common-1-1.el7.centos.noarch             1/2 
  Installing : centos-release-openshift-origin39-1-1.el7.centos.noarch      2/2 
  Verifying  : centos-release-openshift-origin39-1-1.el7.centos.noarch      1/2 
  Verifying  : centos-release-paas-common-1-1.el7.centos.noarch             2/2 

Installed:
  centos-release-openshift-origin39.noarch 0:1-1.el7.centos                     

Dependency Installed:
  centos-release-paas-common.noarch 0:1-1.el7.centos                            

Complete!
Loaded plugins: fastestmirror, ovl
Cleaning repos: base centos-openshift-origin39 extras updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
 ---> 1e506d11ecc6
Removing intermediate container 82fc768e0688
Successfully built 1e506d11ecc6
[source] Running shell script
+ docker images
REPOSITORY                                                 TAG                 IMAGE ID            CREATED             SIZE
<none>                                                     <none>              5469791f13ec        2 seconds ago       221 MB
openshift/origin-source                                    latest              1e506d11ecc6        11 seconds ago      221 MB
<none>                                                     <none>              60c2be53c205        About an hour ago   200 MB
192.168.122.182:5000/jboss/base-jdk                        8                   d0f484688522        About an hour ago   471 MB
192.168.122.182:5000/dotnet/dotnet-21-runtime-centos7      latest              4ffc90a2fa6e        About an hour ago   376 MB
192.168.122.182:5000/centos/kubernetes-sig-node            latest              8ffbf287ee29        5 hours ago         806 MB
192.168.122.182:5000/centos/kubernetes-node                latest              17535bca60d7        6 hours ago         561 MB
192.168.122.182:5000/centos/kubernetes-master              latest              7b38aef69727        6 hours ago         515 MB
<none>                                                     <none>              e83b3f6f0015        6 hours ago         710 MB
<none>                                                     <none>              5960eef0bbe4        6 hours ago         710 MB
192.168.122.182:5000/pipeline-images/ccp-openshift-scan    latest              5968fd7ed681        8 hours ago         200 MB
registry.centos.org/pipeline-images/ccp-openshift-slave    latest              6d09db536187        14 hours ago        1.23 GB
registry.centos.org/pipeline-images/ccp-openshift-slave    <none>              fb4aa577dc78        18 hours ago        1.23 GB
<none>                                                     <none>              bdf2af5f7d67        30 hours ago        674 MB
<none>                                                     <none>              f04ebe939c31        31 hours ago        233 MB
<none>                                                     <none>              829064d8ae3c        32 hours ago        233 MB
<none>                                                     <none>              ffb4aff626f8        38 hours ago        674 MB
<none>                                                     <none>              4eb535853d2d        39 hours ago        194 MB
<none>                                                     <none>              ab06941248a8        39 hours ago        200 MB
192.168.122.182:5000/jboss/base-jdk                        <none>              b3c8ff66beda        39 hours ago        471 MB
192.168.122.182:5000/jboss/base                            latest              f3c1ec6fa239        40 hours ago        266 MB
docker.io/openshift/origin-base                            latest              b82d84dd4dad        40 hours ago        233 MB
<none>                                                     <none>              6130727b702d        41 hours ago        276 MB
<none>                                                     <none>              d4ae64614458        42 hours ago        470 MB
192.168.122.182:5000/centos/kubernetes-sig-node            <none>              7c098034ca1e        44 hours ago        806 MB
192.168.122.182:5000/centos/kubernetes-sig-master          latest              df91b9516bff        44 hours ago        862 MB
centos/centos                                              centos6             c355b381c899        44 hours ago        194 MB
registry.centos.org/pipeline-images/ccp-openshift-scan     latest              85c1b47440df        2 days ago          200 MB
registry.centos.org/pipeline-images/ccp-openshift-slave    <none>              cec956d18d6e        2 days ago          1.23 GB
registry.centos.org/openshift/jenkins-2-centos7            latest              e2d4a27867a9        2 days ago          1.6 GB
registry.centos.org/centos/python                          latest              8d1050849e97        2 days ago          353 MB
registry.centos.org/kbsingh/openshift-nginx                1.10.2              e40d2cd2eab0        2 days ago          272 MB
registry.centos.org/kbsingh/openshift-nginx                latest              5a3361bd57bf        2 days ago          272 MB
registry.centos.org/dharmit/golang                         1.8                 9172de49ed50        2 days ago          682 MB
centos/passenger-40-centos7                                latest              0efbffbcadb2        2 days ago          582 MB
centos/python-34-centos7                                   latest              5128bf5e7026        2 days ago          637 MB
centos/python-35-centos7                                   latest              9a6e3b902b3a        2 days ago          626 MB
<none>                                                     <none>              003be13ec7ed        2 days ago          640 MB
centos/php-71-centos7                                      latest              7dcc6397bf1b        2 days ago          587 MB
192.168.122.182:5000/dotnet/dotnet-20-runtime-centos7      latest              2ce02ecfdeff        3 days ago          371 MB
centos/httpd-24-centos7                                    latest              052ac7efb380        3 days ago          353 MB
che-stacks/centos-ceylon-nodejs-dart                       latest              b4c39e35baa5        3 days ago          1.34 GB
cockpit/kubernetes                                         testing             5cbad6f7dabb        3 days ago          410 MB
192.168.122.182:5000/centos/kubernetes-master              <none>              d5860ecd47fe        3 days ago          515 MB
192.168.122.182:5000/centos/centos                         latest              155736932efa        3 days ago          200 MB
registry.centos.org/dharmit/ccp-openshift-slave            latest              2a488ceb2ad2        4 days ago          1.27 GB
registry.centos.org/che-stacks/centos-nodejs               latest              a61498450e68        4 days ago          912 MB
registry.centos.org/che-stacks/centos-jdk8                 latest              56afdfdd0e0a        4 days ago          801 MB
registry.centos.org/che-stacks/centos-stack-base           latest              73c529aa2dd5        4 days ago          548 MB
registry.centos.org/openshift/jenkins-slave-base-centos7   latest              ed60086afbc5        6 days ago          1.03 GB
registry.centos.org/dharmit/base                           latest              2fda3abac1df        7 days ago          301 MB
docker.io/openshift/jenkins-slave-base-centos7             latest              27cd7aac2924        13 days ago         1.03 GB
docker.io/centos/s2i-base-centos7                          latest              b7756c8594c9        2 weeks ago         468 MB
docker.io/centos/s2i-core-centos7                          1                   cde31315878a        2 weeks ago         232 MB
docker.io/centos/s2i-core-centos7                          latest              cde31315878a        2 weeks ago         232 MB
docker.io/jboss/wildfly                                    10.1.0.Final        262c5a99e246        3 weeks ago         635 MB
docker.io/centos                                           7                   5182e96772bf        5 weeks ago         200 MB
docker.io/centos                                           centos7             5182e96772bf        5 weeks ago         200 MB
docker.io/centos                                           latest              5182e96772bf        5 weeks ago         200 MB
docker.io/fabric8/java-centos-openjdk8-jdk                 latest              de74f8152f3b        6 weeks ago         474 MB
registry.centos.org/centos                                 centos7             e0a70df815d9        8 weeks ago         200 MB
registry.centos.org/centos                                 latest              e0a70df815d9        8 weeks ago         200 MB
docker.io/openshift/origin-deployer                        v3.9.0              39ee47797d2e        2 months ago        1.26 GB
docker.io/openshift/origin-pod                             v3.9.0              6e08365fbba9        2 months ago        223 MB
docker.io/openshift/origin                                 latest              c45099c2bcfa        2 months ago        674 MB
registry.centos.org/centos/centos                          7                   746950e3a984        3 months ago        200 MB
registry.centos.org/centos/centos                          latest              355ad2ea5e32        3 months ago        200 MB
registry.centos.org/centos/postgresql-95-centos7           latest              075b40bb28f9        6 months ago        327 MB
docker.io/openshift/jenkins-2-centos7                      <none>              3b14a74e9f0b        6 months ago        2.22 GB
docker.io/openshift/base-centos7                           latest              4842f0bd3d61        19 months ago       383 MB
[Pipeline] sh
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Scan the image)
[Pipeline] parallel
[Pipeline] [RPM updates] { (Branch: RPM updates)
[Pipeline] [Verify RPMs] { (Branch: Verify RPMs)
[Pipeline] [Miscellaneous updates] { (Branch: Miscellaneous updates)
[Pipeline] [Container capabilities] { (Branch: Container capabilities)
[RPM updates] [pipeline-openshift-origin-source-latest] Running shell script
[RPM updates] ++ docker ps -qf name=scan-data_scan-data
[RPM updates] + docker run --user root --rm --volumes-from 7e74048e3504 --entrypoint /usr/bin/python openshift/origin-source:latest /opt/scanning/yumupdates.py
[Pipeline] [RPM updates] sh
[Verify RPMs] [pipeline-openshift-origin-source-latest] Running shell script
[Verify RPMs] ++ docker ps -qf name=scan-data_scan-data
[Verify RPMs] + docker run --user root --rm --volumes-from 7e74048e3504 --entrypoint /usr/bin/python openshift/origin-source:latest /opt/scanning/rpmverify.py
[Pipeline] [Verify RPMs] sh
[Pipeline] [Miscellaneous updates] sh
[Miscellaneous updates] [pipeline-openshift-origin-source-latest] Running shell script
[Miscellaneous updates] ++ docker ps -qf name=scan-data_scan-data
[Miscellaneous updates] + docker run --user root --rm --volumes-from 7e74048e3504 --entrypoint /usr/bin/python openshift/origin-source:latest /opt/scanning/misc_package_updates.py all
[Container capabilities] [pipeline-openshift-origin-source-latest] Running shell script
[Container capabilities] + docker inspect openshift/origin-source:latest --format '{{ index .Config.Labels "RUN" }}'
[Container capabilities] 
[Pipeline] [Container capabilities] sh
[Pipeline] [Miscellaneous updates] sh
[Miscellaneous updates] [pipeline-openshift-origin-source-latest] Running shell script
[Miscellaneous updates] + cat misc-updates
[Miscellaneous updates] 
[Miscellaneous updates] pip updates scan:
[Miscellaneous updates] /usr/bin/pip is not installed
[Miscellaneous updates] 
[Miscellaneous updates] npm updates scan:
[Miscellaneous updates] /usr/bin/npm is not installed
[Miscellaneous updates] 
[Miscellaneous updates] gem updates scan:
[Miscellaneous updates] /usr/bin/gem is not installed
[Container capabilities] [pipeline-openshift-origin-source-latest] Running shell script
[Container capabilities] ++ docker ps -qf name=scan-data_scan-data
[Container capabilities] + docker run --user root --rm --volumes-from 7e74048e3504 --entrypoint /usr/bin/python openshift/origin-source:latest /opt/scanning/container-capabilities.py ' null '
[Pipeline] [Container capabilities] sh
[Pipeline] [Miscellaneous updates] }
[Verify RPMs] [pipeline-openshift-origin-source-latest] Running shell script
[Pipeline] [Verify RPMs] sh
[Verify RPMs] + cat rpm-verify
[Verify RPMs] Scan for verifying installed RPMs:
[Verify RPMs] All the RPM installed libraries and binaries are intact in image.
[Pipeline] [Verify RPMs] }
[Pipeline] [Container capabilities] sh
[Container capabilities] [pipeline-openshift-origin-source-latest] Running shell script
[Container capabilities] + cat capabilities
[Container capabilities] 
[Container capabilities]  RUN label is not available in image under test.
[Pipeline] [Container capabilities] }
[Pipeline] [RPM updates] sh
[RPM updates] [pipeline-openshift-origin-source-latest] Running shell script
[RPM updates] + cat yum-check-update
[RPM updates] About 11 RPM updates are identified.
[RPM updates] 
[RPM updates] 
[RPM updates] Name:        kpartx
[RPM updates] Installed:   kpartx-0.4.9-119.el7.x86_64
[RPM updates] Update :     kpartx-0.4.9-119.el7_5.1.x86_64
[RPM updates] Yum Repo:    updates
[RPM updates] 
[RPM updates] 
[RPM updates] Name:        libuuid
[RPM updates] Installed:   libuuid-2.23.2-52.el7.x86_64
[RPM updates] Update :     libuuid-2.23.2-52.el7_5.1.x86_64
[RPM updates] Yum Repo:    updates
[RPM updates] 
[RPM updates] 
[RPM updates] Name:        util-linux
[RPM updates] Installed:   util-linux-2.23.2-52.el7.x86_64
[RPM updates] Update :     util-linux-2.23.2-52.el7_5.1.x86_64
[RPM updates] Yum Repo:    updates
[RPM updates] 
[RPM updates] 
[RPM updates] Name:        libmount
[RPM updates] Installed:   libmount-2.23.2-52.el7.x86_64
[RPM updates] Update :     libmount-2.23.2-52.el7_5.1.x86_64
[RPM updates] Yum Repo:    updates
[RPM updates] 
[RPM updates] 
[RPM updates] Name:        audit-libs
[RPM updates] Installed:   audit-libs-2.8.1-3.el7.x86_64
[RPM updates] Update :     audit-libs-2.8.1-3.el7_5.1.x86_64
[RPM updates] Yum Repo:    updates
[RPM updates] 
[RPM updates] 
[RPM updates] Name:        centos-release
[RPM updates] Installed:   centos-release-7-5.1804.1.el7.centos.x86_64
[RPM updates] Update :     centos-release-7-5.1804.4.el7.centos.x86_64
[RPM updates] Yum Repo:    updates
[RPM updates] 
[RPM updates] 
[RPM updates] Name:        systemd
[RPM updates] Installed:   systemd-219-57.el7.x86_64
[RPM updates] Update :     systemd-219-57.el7_5.1.x86_64
[RPM updates] Yum Repo:    updates
[RPM updates] 
[RPM updates] 
[RPM updates] Name:        libblkid
[RPM updates] Installed:   libblkid-2.23.2-52.el7.x86_64
[RPM updates] Update :     libblkid-2.23.2-52.el7_5.1.x86_64
[RPM updates] Yum Repo:    updates
[RPM updates] 
[RPM updates] 
[RPM updates] Name:        bind-license
[RPM updates] Installed:   32:bind-license-9.9.4-61.el7.noarch
[RPM updates] Update :     bind-license-32:9.9.4-61.el7_5.1.noarch
[RPM updates] Yum Repo:    updates
[RPM updates] 
[RPM updates] 
[RPM updates] Name:        dracut
[RPM updates] Installed:   dracut-033-535.el7.x86_64
[RPM updates] Update :     dracut-033-535.el7_5.1.x86_64
[RPM updates] Yum Repo:    updates
[RPM updates] 
[RPM updates] 
[RPM updates] Name:        systemd-libs
[RPM updates] Installed:   systemd-libs-219-57.el7.x86_64
[RPM updates] Update :     systemd-libs-219-57.el7_5.1.x86_64
[RPM updates] Yum Repo:    updates
[Pipeline] [RPM updates] }
[Pipeline] // parallel
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Push image to registry)
[Pipeline] sh
[pipeline-openshift-origin-source-latest] Running shell script
+ docker tag openshift/origin-source:latest 192.168.122.182:5000/openshift/origin-source:latest
[Pipeline] sh
[pipeline-openshift-origin-source-latest] Running shell script
+ docker push 192.168.122.182:5000/openshift/origin-source:latest
The push refers to a repository [192.168.122.182:5000/openshift/origin-source]
53952b3a5a9f: Preparing
1d31b5806ba4: Preparing
1d31b5806ba4: Layer already exists
53952b3a5a9f: Pushed
latest: digest: sha256:e4e4884a82c734d3b626df324361bcb491af5c1cc60647f4f05eee83b408e332 size: 740
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Remove the image)
[pipeline-openshift-origin-source-latest] Running shell script
+ docker rmi 192.168.122.182:5000/openshift/origin-source:latest
Untagged: 192.168.122.182:5000/openshift/origin-source:latest
Untagged: 192.168.122.182:5000/openshift/origin-source@sha256:e4e4884a82c734d3b626df324361bcb491af5c1cc60647f4f05eee83b408e332
[Pipeline] sh
[Pipeline] sh
[pipeline-openshift-origin-source-latest] Running shell script
+ docker rmi openshift/origin-source:latest
Error response from daemon: conflict: unable to remove repository reference "openshift/origin-source:latest" (must force) - container b8be70ee5195 is using its referenced image 1e506d11ecc6
[Pipeline] }
[Pipeline] // stage
[Pipeline] sh
[pipeline-openshift-origin-source-latest] Running shell script
+ echo -e 'Build request for 192.168.122.182:5000/openshift/origin-source:latest was unsuccessful'
+ mail -r dharmit@redhat.com -S smtp=smtp://smtp.redhat.com -s 'FAILED: Container build 192.168.122.182:5000/openshift/origin-source:latest has failed' shahdharmit@gmail.com
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE
navidshaikh commented 6 years ago

Remove image stage should have a retry cycle to provide referenced layers to get free from running containers.