Bug 1260940

Summary: S2I rhel images are missing tar
Product: OpenShift Container Platform Reporter: DeShuai Ma <dma>
Component: BuildAssignee: Scott Dodson <sdodson>
Status: CLOSED CURRENTRELEASE QA Contact: Wenjing Zheng <wzheng>
Severity: high Docs Contact:
Priority: high    
Version: 3.0.0CC: aos-bugs, bparees
Target Milestone: ---Keywords: TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1261117 (view as bug list) Environment:
Last Closed: 2015-09-25 17:12:18 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:
Bug Depends On:    
Bug Blocks: 1261117    

Description DeShuai Ma 2015-09-08 09:29:42 UTC
Description of problem:
When the base image has no tar command, the build should be success, but now, it always failed with error.
Now on ose env, all the base image has no tar command, it block the ose s2i build test.

Version-Release number of selected component (if applicable):
s2i v1.0.1-73-gbf36cf6
rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ruby-20-rhel7: 90a4ce4ecdd0

How reproducible:
Always

Steps to Reproduce:
1.Do s2i build use base image don't have tar command
[root@openshift-135 bin]# ./s2i build https://github.com/openshift/rails-ex.git rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ruby-20-rhel7 rails-test --force-pull=false --loglevel=2
I0908 17:09:39.739232 95934 docker.go:211] Image rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ruby-20-rhel7:latest available locally

Builder Name:		Ruby 2.0
Builder Image:		rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ruby-20-rhel7
Source:			https://github.com/openshift/rails-ex.git
Output Image Tag:	rails-test
Incremental Build:	disabled
Remove Old Build:	disabled
Force Pull:		disabled
Quiet:			disabled
Layered Build:		disabled
Docker Endpoint:	unix:///var/run/docker.sock

I0908 17:09:39.892021 95934 docker.go:211] Image rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ruby-20-rhel7:latest available locally
I0908 17:09:40.044683 95934 sti.go:123] Preparing to build rails-test
I0908 17:09:40.045318 95934 clone.go:28] Cloning into /tmp/sti616354485/upload/src
I0908 17:09:41.507804 95934 docker.go:211] Image rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ruby-20-rhel7:latest available locally
I0908 17:09:41.507845 95934 docker.go:317] Image contains io.openshift.s2i.scripts-url set to 'image:///usr/local/sti'
I0908 17:09:41.507876 95934 download.go:57] Using image internal scripts from: image:///usr/local/sti/assemble
I0908 17:09:41.507891 95934 download.go:57] Using image internal scripts from: image:///usr/local/sti/run
I0908 17:09:41.660476 95934 docker.go:211] Image rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ruby-20-rhel7:latest available locally
I0908 17:09:41.660509 95934 docker.go:317] Image contains io.openshift.s2i.scripts-url set to 'image:///usr/local/sti'
I0908 17:09:41.660532 95934 download.go:57] Using image internal scripts from: image:///usr/local/sti/save-artifacts
I0908 17:09:41.660577 95934 sti.go:198] Using assemble from image:///usr/local/sti
I0908 17:09:41.660593 95934 sti.go:198] Using run from image:///usr/local/sti
I0908 17:09:41.660600 95934 sti.go:198] Using save-artifacts from image:///usr/local/sti
I0908 17:09:41.660636 95934 sti.go:131] Clean build will be performed
I0908 17:09:41.660645 95934 sti.go:134] Performing source build from https://github.com/openshift/rails-ex.git
I0908 17:09:41.660663 95934 sti.go:144] Running S2I script in rails-test
I0908 17:09:41.660671 95934 sti.go:344] Using image name rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ruby-20-rhel7
I0908 17:09:41.660684 95934 sti.go:348] No .sti/environment provided (no environment file found in application sources)
I0908 17:09:41.821942 95934 docker.go:317] Image contains io.openshift.s2i.scripts-url set to 'image:///usr/local/sti'
I0908 17:09:41.821976 95934 docker.go:370] Base directory for STI scripts is '/usr/local/sti'. Untarring destination is '/tmp'.
I0908 17:09:41.821990 95934 docker.go:497] Creating container using config: {Hostname: Domainname: User: Memory:0 MemorySwap:0 CPUShares:0 CPUSet: AttachStdin:false AttachStdout:true AttachStderr:false PortSpecs:[] ExposedPorts:map[] Tty:false OpenStdin:true StdinOnce:true Env:[] Cmd:[/bin/sh -c tar -C /tmp -xf - && /usr/local/sti/assemble] DNS:[] Image:rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ruby-20-rhel7:latest Volumes:map[] VolumesFrom: WorkingDir: MacAddress: Entrypoint:[] NetworkDisabled:false SecurityOpts:[] OnBuild:[] Mounts:[] Labels:map[]}
I0908 17:09:42.211070 95934 docker.go:508] Attaching to container
I0908 17:09:42.212081 95934 docker.go:514] Starting container
I0908 17:09:42.519540 95934 docker.go:448] Waiting for container
E0908 17:09:43.046235 95934 util.go:85] /bin/sh: tar: command not found
I0908 17:09:43.201761 95934 docker.go:450] Container wait returns with 127 and <nil>
I0908 17:09:43.201822 95934 docker.go:457] Container exited
I0908 17:09:44.348858 95934 sti.go:151] Image is missing basic requirements (sh or tar), layered build will be performed
I0908 17:09:44.501732 95934 layered.go:81] Writing custom Dockerfile to /tmp/sti616354485/upload
I0908 17:09:44.501759 95934 layered.go:99] Creating application source code image
I0908 17:09:44.509405 95934 layered.go:133] Building new image rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ruby-20-rhel7-1441703384509396317 with scripts and sources already inside
I0908 17:09:44.586303 95934 layered.go:129] Step 0 : FROM rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ruby-20-rhel7
I0908 17:09:44.737175 95934 layered.go:129]  ---> 90a4ce4ecdd0
I0908 17:09:44.737208 95934 layered.go:129] Step 1 : COPY scripts /tmp/scripts
I0908 17:09:44.742468 95934 cleanup.go:23] Removing temporary directory /tmp/sti616354485
I0908 17:09:44.742489 95934 fs.go:99] Removing directory '/tmp/sti616354485'
I0908 17:09:44.748833 95934 main.go:353] An error occurred: scripts: no such file or directory

Actual results:
1.Fail with error

Expected results:
1.The build should success.

Additional info:

Comment 1 Ben Parees 2015-09-08 14:53:44 UTC
Two issues here.  
1) s2i should work for this.  it looks like it's not properly detecting it as a layered build.

2) tar needs to be in the s2i images.  i will fix that.

Comment 2 Ben Parees 2015-09-08 15:15:59 UTC
the image should have tar in it (we yum install it).  something went wrong and sdodson is looking into it.

but we still have a bug in that s2i should have done a layered build here since there is no tar, and it didn't.

Gabe, assuming the actual images get fixed shortly, you'll need to recreate this by hacking up an image with no tar.

Comment 3 Ben Parees 2015-09-08 15:46:42 UTC
this bug should be used to fix the fact that our s2i rhel images do not have tar installed.

Comment 5 Scott Dodson 2015-09-08 17:33:54 UTC
The rhel-7-server-rpms repo wasn't enabled when the base image was built. I've rebuilt it with that repo enabled and the optional repo as I noticed that bsdtar was omitted from the image.

All S2I images have been rebuilt.

Comment 6 DeShuai Ma 2015-09-09 01:51:54 UTC
1. ruby rhel Image Id: ea16bfe08293, image has tar command, this bug is fixed.
[root@openshift-134 ~]# docker images|grep ruby
registry.access.redhat.com/openshift3/ruby-20-rhel7                                   latest              ea16bfe08293        8 hours ago         478.5 MB
rcm-img-docker01.build.eng.bos.redhat.com:5001/openshift3/ruby-20-rhel7               latest              ea16bfe08293        8 hours ago         478.5 MB
[root@openshift-134 ~]# docker run -it registry.access.redhat.com/openshift3/ruby-20-rhel7 /bin/bash
Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.
bash-4.2$ which tar
/usr/bin/tar
bash-4.2$ exit
exit