Bug 1206109 - [origin_devexp_510] Failed to get build dependency trees for all tags in the specified image repository
Summary: [origin_devexp_510] Failed to get build dependency trees for all tags in the ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Michail Kargakis
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-26 10:39 UTC by chunchen
Modified: 2016-09-30 02:16 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-07 23:45:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description chunchen 2015-03-26 10:39:31 UTC
Description of problem:
It's failed to get build dependency trees for all tags in the specified image repository.

Version-Release number of selected component (if applicable):
devenv_fedora_1136
openshift v0.4.1-313-g1f5063f
kubernetes v0.12.0-992-gc5f7351

How reproducible:
always

Steps to Reproduce:
1. Setup the OpenShift V3 environment according to: https://github.com/openshift/origin/tree/master/examples/sample-app

2. Create a namespace named "chun1"
$ openshift ex new-project chun1 --display-name="OpenShift 3 Sample" --description="This is an example project to demonstrate OpenShift v3" --admin=anypassword:test-admin

3. Submit the application template for processing and then request creation of the processed template
$ osc process -n chun1 -f application-template-stibuild.json | osc create -n chun1 -f -

4. Get build dependency trees in the specific namespace from step 2
$ openshift ex build-chain -n chun1

5. Get build dependency tree for all tags of a specific image repository
1) $ openshift ex build-chain ruby-20-centos7 --all-tags
2) $ openshift ex build-chain ruby-20-centos7 -n chun1 --all-tags

Actual results:
at step 4:
{
	"fullname": "chun1/ruby-20-centos7",
	"tags": [
		"latest"
	],
	"edges": [
		{
			"fullname": "chun1/ruby-sample-build",
			"to": "chun1/origin-ruby-sample"
		}
	],
	"children": [
		{
			"fullname": "chun1/origin-ruby-sample",
			"tags": [
				""
			]
		}
	]
}

at step 5.1:
F0326 10:16:27.814706   16427 buildchain.go:140] imageRepository "ruby-20-centos7" not found

at step 5.2:
return nothing

Expected results:
Should get build dependency trees for all tags in the specified image repository.

Additional info:

Comment 1 openshift-github-bot 2015-03-26 11:47:11 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/f4d8bf0237197c1d559b892aa1b7263584607870
Bug 1206109 - Default empty tag slice to 'latest'

Comment 2 chunchen 2015-03-27 03:33:42 UTC
the issue is also reproduced for command "openshift ex build-chain [image-repository] --all-tags", think this command should show the build dependency trees for all tags in the specified image repository in *all* namespaces, not just in *current* namespace, could you please help to confirm if i am right?

Thanks!

Comment 3 Michail Kargakis 2015-03-27 09:22:32 UTC
--all-tags is only for the current namespace.

Comment 4 chunchen 2015-03-30 03:41:40 UTC
Thanks for confirming, but it still does not work well, it only detects the *latest* tag instead of all tags, like below results:

# openshift ex build-chain ruby-20-centos7-2 --all-tags -n test
I0330 03:30:27.239605   16327 buildchain.go:178] test/ruby-20-centos7-2:latest has no dependencies

# openshift ex build-chain ruby-20-centos7-2:stiv1 --all-tags -n test
{
	"fullname": "test/ruby-20-centos7-2",
	"tags": [
		"stiv1"
	],
	"edges": [
		{
			"fullname": "test/ruby-sample-build2",
			"to": "test/origin-ruby-sample2"
		}
	],
	"children": [
		{
			"fullname": "test/origin-ruby-sample2",
			"tags": [
				""
			]
		}
	]
}

Comment 5 openshift-github-bot 2015-03-31 17:07:59 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/df9ffa136f9fdbc88f33684786914c22dfda5946
Bug 1206109 - build-chain: Set tags correctly

Comment 6 chunchen 2015-04-01 05:33:11 UTC
Checked the issue against devenv_fedora_1181, it's still reproduced as the same results as Comment #4.

For testing, I used this application template json file [1], but edit it like below:
<-----------------sinp------------------->
          "imageChange": {
            "from": {
              "name": "ruby-20-centos7"
            },
            "image": "openshift/ruby-20-centos7",
            "tag": "stiv1" ### set it with my defined tag instead of the "latest" tag
          },
<-----------------sinp------------------->  

[1] https://github.com/openshift/origin/blob/master/examples/sample-app/application-template-stibuild.json

Thanks!

Comment 7 chunchen 2015-04-03 02:59:32 UTC
The test results w/o modifying the template are as below:

[root@ip-10-157-110-97 sample-app]# openshift ex build-chain ruby-20-centos7 --all-tags -n test
{
	"fullname": "test/ruby-20-centos7",
	"tags": [
		"latest"
	],
	"edges": [
		{
			"fullname": "test/ruby-sample-build",
			"to": "test/origin-ruby-sample"
		}
	],
	"children": [
		{
			"fullname": "test/origin-ruby-sample",
			"tags": [
				""
			]
		}
	]
}
I0403 02:54:13.801478    3849 buildchain.go:204] test/ruby-20-centos7:v0.4 has no dependencies


[root@ip-10-157-110-97 sample-app]# openshift ex build-chain ruby-20-centos7:latest --all-tags -n test
I0403 02:54:23.574428    3859 buildchain.go:204] test/ruby-20-centos7:v0.4 has no dependencies
{
	"fullname": "test/ruby-20-centos7",
	"tags": [
		"latest"
	],
	"edges": [
		{
			"fullname": "test/ruby-sample-build",
			"to": "test/origin-ruby-sample"
		}
	],
	"children": [
		{
			"fullname": "test/origin-ruby-sample",
			"tags": [
				""
			]
		}
	]
}

Comment 8 Michail Kargakis 2015-04-07 08:55:05 UTC
Great, these results on #7 are ok. Now, regarding your template change, it's invalid because we pull that image from DockerHub and there is no "stiv1" over there: https://registry.hub.docker.com/u/openshift/ruby-20-centos7/tags/manage/
So, when we run openshift ex build-chain ruby-20-centos7:stiv1 we should get nothing back. I will shortly submit a patch for this.

Comment 9 openshift-github-bot 2015-04-07 13:37:58 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/89413d9d0b589954632ed099114596b7726cd95f
Bug 1206109: Handle specified tags that don't exist in the specified image repository

Comment 10 Michail Kargakis 2015-04-07 13:42:44 UTC
Patch is live. Expected behavior with your edited template:

$ openshift ex build-chain ruby-20-centos7:stiv1 --all-tags
I0401 11:06:33.4372543202 buildchain.go:179] chun1/ruby-20-centos7:latest has no dependencies    
    I0401 11:06:33.4372543202 buildchain.go:179] chun1/ruby-20-centos7:v0.4 has no dependencies

since the buildconfig will not be in the chain because it is triggered by the "stiv1" tag which is not present in the imagerepository.

Comment 11 chunchen 2015-04-08 02:55:41 UTC
it's fixed, verified on devenv_fedora_1226, please refer to the below results:

[root@ip-10-169-178-13 chunchen]# osc get imagerepository -n test
NAME                 DOCKER REPO                                  TAGS
origin-ruby-sample   172.30.17.144:5000/test/origin-ruby-sample   
ruby-20-centos7      openshift/ruby-20-centos7                    latest,v0.4

[root@ip-10-169-178-13 chunchen]# openshift ex build-chain ruby-20-centos7:stiv1 --all-tags -n test
I0408 02:50:46.279967   16584 buildchain.go:211] test/ruby-20-centos7:v0.4 has no dependencies
I0408 02:50:46.280034   16584 buildchain.go:211] test/ruby-20-centos7:latest has no dependencies

[root@ip-10-169-178-13 chunchen]# openshift ex build-chain ruby-20-centos7 --all-tags -n test
I0408 02:50:33.340398   16517 buildchain.go:211] test/ruby-20-centos7:latest has no dependencies
I0408 02:50:33.340560   16517 buildchain.go:211] test/ruby-20-centos7:v0.4 has no dependencies


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