Bug 1533318 - [APB] Failed when running the `apb run` command outside of the cluster
Summary: [APB] Failed when running the `apb run` command outside of the cluster
Keywords:
Status: CLOSED DUPLICATE of bug 1541903
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Broker
Version: 3.9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.9.0
Assignee: David Zager
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On: 1526147 1541903
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-11 04:06 UTC by Jian Zhang
Modified: 2018-04-25 17:24 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2018-02-15 13:52:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0489 0 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.9 RPM Release Advisory 2018-03-28 18:06:38 UTC

Description Jian Zhang 2018-01-11 04:06:11 UTC
Description of problem:
The `apb run` command runs fail when the user running it outside of the cluster.

Version-Release number of selected component (if applicable):
apb version: apb-1.1.2-1.20171221180811.fc25.noarch

How reproducible:
Always

Steps to Reproduce:

1, Install the apb tool in my local, not in the cluster.
su -c 'wget https://copr.fedorainfracloud.org/coprs/g/ansible-service-broker/ansible-service-broker-latest/repo/epel-7/group_ansible-service-broker-ansible-service-broker-latest-epel-7.repo -O /etc/yum.repos.d/ansible-service-broker.repo'

sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum -y install apb


2, Switch to su user and enable docker daemon

3, Init an APB project.

4, Login a cluster.

5, Running the `apb run` command.

[root@localhost hello-world-apb]# apb run --project jian4 --tag docker.io/zjianbjz/hello-world-apb
Finished writing dockerfile.
Building APB using tag: [docker.io/zjianbjz/hello-world-apb]
Successfully built APB image: docker.io/zjianbjz/hello-world-apb
Creating project jian4
Created project
Creating service account in jian4
Created service account
Creating role binding for apb-run-hello-world-apb7qqws in jian4
Created Role Binding
Creating pod with image docker.io/zjianbjz/hello-world-apb in jian4
Created Pod
APB run started


Actual results:
Access into the cluster, and check the pod.
[root@host-172-16-120-108 ~]# oc get pods -n jian4
NAME                           READY     STATUS         RESTARTS   AGE
apb-run-hello-world-apbpqtz6   0/1       ErrImagePull   0          36s


Expected results:
Provision the APB successfully. 

Additional info:

Comment 3 Jian Zhang 2018-01-25 07:00:17 UTC
I find the above PR(#210) haven't merged yet. Changed status to MODIFIED and waiting for this PR merged.

Comment 6 Jian Zhang 2018-01-29 08:36:22 UTC
The above PR(#210) have merged, but have not released yet. The current apb tool release is 1.1.6.
[root@localhost jzhang]# rpm -qa| grep apb
apb-1.1.6-1.20180123164703.el7.centos.noarch

I will verify this bug once it's released.

Comment 7 Jian Zhang 2018-02-02 06:03:02 UTC
Change status to MODIFIED since the release not ready.

Comment 8 Zhang Cheng 2018-02-07 08:40:09 UTC
Changing status to "ON_QA" since apb-tools image ready for test in downstream registry.

Comment 10 David Zager 2018-02-07 13:45:09 UTC
This was an intentional change, to move to build and push the image to the internal registry before running, to make 'apb run' work on external clusters. Please, re-run without the tag argument.

Comment 11 Jian Zhang 2018-02-08 03:58:52 UTC
David,

Based on your comments, I did the below test:

[root@localhost hello-world-db-apb]# apb version
Version: apb-1.1.7

1, Push the image to the internal registry before running.
Here, we can see the "dh-hello-world-db-apb".

[root@localhost hello-world-db-apb]# apb list
Didn't find OpenShift Ansible Broker route in namespace: ansible-service-broker.                    Trying openshift-ansible-service-broker
Contacting the ansible-service-broker at: https://asb-1338-openshift-ansible-service-broker.apps.0208-x5n.qe.rhcloud.com/ansible-service-broker/v2/catalog
ID                                NAME                   DESCRIPTION                                               
3b18d5937f0cbb99ee6693993a525be7  dh-fail-apb            This is an APB built to fail on provision or deprovision  
0a8f417c71d090c39dc2ba73f538c148  dh-hello-test-apb      deploys hello-test web application                        
b43a4272a6efcaaa3e0b9616324f1099  dh-hello-world-db-apb  A sample APB which deploys Hello World Database           
f6c4486b7fb0cdac4b58e193607f7011  dh-mediawiki-apb       Mediawiki apb implementation 

2, Execute the `apb run` command. 
[root@localhost hello-world-db-apb]# apb run --project jian
Found registry IP at: 172.30.113.235:5000
Finished writing dockerfile.
Building APB using tag: [172.30.113.235:5000/openshift/hello-world-db-apb]
Successfully built APB image: 172.30.113.235:5000/openshift/hello-world-db-apb
Exception occurred! UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

Here, I think should replace the "172.30.113.235:5000" with its route.
And, we also opened a new bug about the `--registry-route` argument, there: https://bugzilla.redhat.com/show_bug.cgi?id=1541903

And, more, I have some concrens about your commnets:
> to move to build and push the image to the internal registry before running,

Since the building image step in the `app run` process, why we need to push it in advance? If we must do it in advance, I think we should remove the building image step.

Comment 12 David Zager 2018-02-08 05:16:43 UTC
I believe we misunderstood each other. What I was trying to say was that the APB run command will build and push the image to the internal registry, you do not need to push in advance.

If you use apb run --help you can see the flags available for pushing to the internal registry are also available on apb run.

I recommend you specify the registry on apb run in the same way you did to push in step 1 in the previous comment.

Comment 13 Jian Zhang 2018-02-08 10:23:36 UTC
David,

Oh, yeah, I think we misunderstood each other. Sorry for that. Please see the step 2 of the comment 11, ignore my concerns and the step 1, thanks!

Comment 14 David Zager 2018-02-15 13:52:31 UTC
The new bug 1541903 is being actively worked on and makes this one a duplicate.

*** This bug has been marked as a duplicate of bug 1541903 ***

Comment 15 Jian Zhang 2018-02-17 01:48:00 UTC
David,

Thanks, I separated them originally because I think the new bug 1541903 was failed with the `--registry-route` argument, but this one didn't use this argument. Hmm, so I think I need to verify both of them in the new bug 1541903, right?

Comment 16 David Zager 2018-02-20 13:43:18 UTC
Do I understand you correctly, the registry is not actually available to you at 172.30.113.235:5000 and you want to replace that IP with the route to the internal registry?

Comment 17 Jian Zhang 2018-02-21 02:01:46 UTC
David,

Yes, you're right.

Comment 18 David Zager 2018-02-21 21:26:42 UTC
With the type of cluster setup you are describing, you will only be able to use the apb run command specifying the `--registry-route` argument. You will not need to verify both as using apb run from outside the cluster (at least based on your setup) will require the registry-route argument.


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