Bug 1118231 - [geard] gear build generate new image when do incremental build
Summary: [geard] gear build generate new image when do incremental build
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-10 09:05 UTC by chunchen
Modified: 2016-09-30 02:15 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-10 00:45:59 UTC


Attachments (Terms of Use)

Description chunchen 2014-07-10 09:05:32 UTC
Description of problem:
It will generate new image tagged as "<none>" when gear build do incremental build.

Version-Release number of selected component (if applicable):
geard-0-0.13.git6850c8d
fedora20_x86_64

How reproducible:
always

Steps to Reproduce:
1. Do the 'clean' build
gear build git://github.com/chunyunchen/sinatra-app-example openshift/ruby-19-centos testapp1

2. Check the docker installed images
docker images

3. Do a Incremental build(execute the same command line as step 1)
gear build git://github.com/chunyunchen/sinatra-app-example openshift/ruby-19-centos testapp1

4. Check the docker installed images again
docker images

Actual results:
at step 2:
REPOSITORY                TAG     IMAGE ID      CREATED            VIRTUAL SIZE
testapp1                  latest  aceb9914f019  About a minute ago   344.3 MB
openshift/ruby-19-centos  latest  ce40b6454ce6  2 weeks ago          341 MB

at step 3:
Downloading git://github.com/chunyunchen/sinatra-app-example to directory /tmp/sti111410911/src
Cloning into '/tmp/sti111410911/src'...
remote: Counting objects: 65, done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 65 (delta 16), reused 65 (delta 16)
Receiving objects: 100% (65/65), 7.34 KiB | 0 bytes/s, done.
Resolving deltas: 100% (16/16), done.
Checking connectivity... done.
Existing image for tag testapp1 detected for incremental build.
---> Saving build-artifacts
Restoring build artifacts
---> Installing application source
---> Building your Ruby application from source
---> Running 'bundle install --deployment'
Using rack (1.5.2) 
Using puma (2.8.1) 
Using rack-protection (1.5.2) 
Using tilt (1.4.1) 
Using sinatra (1.4.4) 
Using bundler (1.1.4) 
Your bundle is complete! It was installed into /opt/ruby/bundle
---> Cleaning up unused ruby gems

at step 4:
REPOSITORY                 TAG     IMAGE ID      CREATED             VIRTUAL SIZE
testapp1                   latest  aceb9914f019  About a minute ago  344.3 MB
<none>                     <none>  1dcd639f7c30  12 minutes ago      344.3 MB
openshift/ruby-19-centos   latest  ce40b6454ce6  2 weeks ago         341 MB

Expected results:
Should not generate new image when do incremental build

Additional info:

Comment 1 Andy Goldstein 2014-07-10 17:54:25 UTC
FYI, STI supports a RemovePreviousImage flag (sti build --rm) that will remove the previous image when doing an incremental build. I don't believe this has made its way into "gear build" yet, however.

Comment 2 Ben Parees 2014-07-10 17:59:03 UTC
yeah, i'm working on porting it into gear build, but i've also hit an issue where docker refuses to remove images:

Removing previously-tagged image 2ffbff4c4c7beaa761146a8b21d362bf171ceaddf83490968ff45b226bf391eb
Unable to remove previous image: API error (409): Conflict, cannot delete 2ffbff4c4c7b because the container 8365b7109b0d is using it, use -f to force

Removing directory '/tmp/sti434039192'
An error occured: API error (409): Conflict, cannot delete 2ffbff4c4c7b because the container 8365b7109b0d is using it, use -f to force

so i'm also looking into a PR to dockerclient to pass the force flag.

Comment 3 Ben Parees 2014-07-10 18:08:59 UTC
I've ported the --rm flag to gear build, so you can now do:

gear build git://github.com/chunyunchen/sinatra-app-example openshift/ruby-19-centos testapp1 --rm

which will not leave the extra untagged image around.

That said, while testing this, I hit some issues w/ being unable to remove images in certain cases, so as mentioned in comment 2, we may need to add support for "--force" to dockerclient and pass that.

For now i'm marking this fixed and QE can open a new bug if they see the same issue w/ removing that I did.

Comment 4 chunchen 2014-07-11 06:14:36 UTC
1. using the  new bug 1118585 to track issue in comment 2;
2. tested the --rm option against latest gear built(gear version alpha3, build a91156f), it can work well except the issue in comment 2, so mark this bug as VERIFIED.


Note You need to log in before you can comment on or make changes to this bug.