Re: [openstack-dev] [Magnum][Kuryr] Help with using docker-python client in gate

2015-12-17 Thread Egor Guz
Gal,

I think you need to setup your Docker environment to allow run cli without sudo 
permission (https://docs.docker.com/engine/installation/ubuntulinux/).
Or use tcp socket instead (https://docs.docker.com/v1.8/articles/basics/), 
Magnum/Swarm/docker-machine uses this approach all the time.

—
Egor

On Dec 17, 2015, at 07:53, Gal Sagie 
mailto:gal.sa...@gmail.com>> wrote:

Hello Everyone,

We are trying to add some gate testing for Kuryr and hopefully convert these 
also to Rally
plugins.

What i am facing in the gate right now is this:
I configure the docker client:


self.docker_client = docker.Client(
base_url='unix://var/run/docker.sock')


And call this:
self.docker_client.create_network(name='fakenet', driver='kuryr')


This works locally, and i also tried to run this code with a different user

But on the gate this fails:
http://logs.openstack.org/79/258379/5/check/gate-kuryr-dsvm-fullstack-nv/f46ebdb/

2-17 
05:22:16.900
 | 2015-12-17 05:22:16.851 |
2015-12-17 
05:22:16.902
 | 2015-12-17 05:22:16.852 | {0} 
kuryr.tests.fullstack.test_network.NetworkTest.test_create_delete_network 
[0.093287s] ... FAILED
2015-12-17 
05:22:16.934
 | 2015-12-17 05:22:16.854 |
2015-12-17 
05:22:16.935
 | 2015-12-17 05:22:16.855 | Captured traceback:
2015-12-17 
05:22:16.935
 | 2015-12-17 05:22:16.856 | ~~~
2015-12-17 
05:22:16.935
 | 2015-12-17 05:22:16.857 | Traceback (most recent call last):
2015-12-17 
05:22:16.935
 | 2015-12-17 05:22:16.859 |   File 
"kuryr/tests/fullstack/test_network.py", line 27, in test_create_delete_network
2015-12-17 
05:22:16.936
 | 2015-12-17 05:22:16.860 | 
self.docker_client.create_network(name='fakenet', driver='kuryr')
2015-12-17 
05:22:16.936
 | 2015-12-17 05:22:16.861 |   File 
"/opt/stack/new/kuryr/.tox/fullstack/local/lib/python2.7/site-packages/docker/utils/decorators.py",
 line 35, in wrapper
2015-12-17 
05:22:16.936
 | 2015-12-17 05:22:16.862 | return f(self, *args, **kwargs)
2015-12-17 
05:22:16.936
 | 2015-12-17 05:22:16.864 |   File 
"/opt/stack/new/kuryr/.tox/fullstack/local/lib/python2.7/site-packages/docker/api/network.py",
 line 28, in create_network
2015-12-17 
05:22:16.936
 | 2015-12-17 05:22:16.865 | res = self._post_json(url, data=data)
2015-12-17 
05:22:16.937
 | 2015-12-17 05:22:16.866 |   File 
"/opt/stack/new/kuryr/.tox/fullstack/local/lib/python2.7/site-packages/docker/client.py",
 line 166, in _post_json
2015-12-17 
05:22:16.937
 | 2015-12-17 05:22:16.867 | return self._post(url, 
data=json.dumps(data2), **kwargs)
2015-12-17 
05:22:16.937
 | 2015-12-17 05:22:16.870 |   File 
"/opt/stack/new/kuryr/.tox/fullstack/local/lib/python2.7/site-packages/docker/client.py",
 line 107, in _post
2015-12-17 
05:22:16.937
 | 2015-12-17 05:22:16.871 | return self.post(url, 
**self._set_request_timeout(kwargs))
2015-12-17 
05:22:16.937
 | 2015-12-17 05:22:16.873 |   File 
"/opt/stack/new/ku

[openstack-dev] [Magnum][Kuryr] Help with using docker-python client in gate

2015-12-17 Thread Gal Sagie
Hello Everyone,

We are trying to add some gate testing for Kuryr and hopefully convert
these also to Rally
plugins.

What i am facing in the gate right now is this:
I configure the docker client:

self.docker_client = docker.Client(
base_url='unix://var/run/docker.sock')

And call this:
self.docker_client.create_network(name='fakenet', driver='kuryr')

This works locally, and i also tried to run this code with a different user

But on the gate this fails:
http://logs.openstack.org/79/258379/5/check/gate-kuryr-dsvm-fullstack-nv/f46ebdb/

2-17 05:22:16.900

| 2015-12-17 05:22:16.851 | 2015-12-17 05:22:16.902

| 2015-12-17 05:22:16.852 | {0}
kuryr.tests.fullstack.test_network.NetworkTest.test_create_delete_network
[0.093287s] ... FAILED2015-12-17 05:22:16.934

| 2015-12-17 05:22:16.854 | 2015-12-17 05:22:16.935

| 2015-12-17 05:22:16.855 | Captured traceback:2015-12-17 05:22:16.935

| 2015-12-17 05:22:16.856 | ~~~2015-12-17 05:22:16.935

| 2015-12-17 05:22:16.857 | Traceback (most recent call
last):2015-12-17 05:22:16.935

| 2015-12-17 05:22:16.859 |   File
"kuryr/tests/fullstack/test_network.py", line 27, in
test_create_delete_network2015-12-17 05:22:16.936

| 2015-12-17 05:22:16.860 |
self.docker_client.create_network(name='fakenet',
driver='kuryr')2015-12-17 05:22:16.936

| 2015-12-17 05:22:16.861 |   File
"/opt/stack/new/kuryr/.tox/fullstack/local/lib/python2.7/site-packages/docker/utils/decorators.py",
line 35, in wrapper2015-12-17 05:22:16.936

| 2015-12-17 05:22:16.862 | return f(self, *args,
**kwargs)2015-12-17 05:22:16.936

| 2015-12-17 05:22:16.864 |   File
"/opt/stack/new/kuryr/.tox/fullstack/local/lib/python2.7/site-packages/docker/api/network.py",
line 28, in create_network2015-12-17 05:22:16.936

| 2015-12-17 05:22:16.865 | res = self._post_json(url,
data=data)2015-12-17 05:22:16.937

| 2015-12-17 05:22:16.866 |   File
"/opt/stack/new/kuryr/.tox/fullstack/local/lib/python2.7/site-packages/docker/client.py",
line 166, in _post_json2015-12-17 05:22:16.937

| 2015-12-17 05:22:16.867 | return self._post(url,
data=json.dumps(data2), **kwargs)2015-12-17 05:22:16.937

| 2015-12-17 05:22:16.870 |   File
"/opt/stack/new/kuryr/.tox/fullstack/local/lib/python2.7/site-packages/docker/client.py",
line 107, in _post2015-12-17 05:22:16.937

| 2015-12-17 05:22:16.871 | return self.post(url,
**self._set_request_timeout(kwargs))2015-12-17 05:22:16.937

| 2015-12-17 05:22:16.873 |   File
"/opt/stack/new/kuryr/.tox/fullstack/local/lib/python2.7/site-packages/requests/sessions.py",
line 511, in post2015-12-17 05:22:16.937

| 2015-12-17 05:22:16.874 | return self.request('POST', url,
data=data, json=json, **kwargs)2015-12-17 05:22:16.938