[gnocchi] Running Gnocchi API in specific interface

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[gnocchi] Running Gnocchi API in specific interface

aalvarez
Hello folks

The gnocchi-api command allows running the API server usign a spefic port:

usage: gnocchi-api [-h] [--port PORT] -- [passed options]

positional arguments:
  -- [passed options]   '--' is the separator of the arguments used to start
                        the WSGI server and the arguments passed to the WSGI
                        application.

optional arguments:
  -h, --help            show this help message and exit
  --port PORT, -p PORT  TCP port to listen on (default: 8000)

I was wondering if it's possible as well to use a specific interface? (In my case, I am working on a cloud dev environment, so I need 0.0.0.0)?

If not, would this be a welcomed change for a pull request?

Thanks

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Reply | Threaded
Open this post in threaded view
|

Re: [gnocchi] Running Gnocchi API in specific interface

Mehdi Abaakouk
Hi,

On Thu, May 18, 2017 at 11:14:06AM +0800, Andres Alvarez wrote:

>Hello folks
>
>The gnocchi-api command allows running the API server usign a spefic port:
>
>usage: gnocchi-api [-h] [--port PORT] -- [passed options]
>
>positional arguments:
>  -- [passed options]   '--' is the separator of the arguments used to start
>                        the WSGI server and the arguments passed to the WSGI
>                        application.
>
>optional arguments:
>  -h, --help            show this help message and exit
>  --port PORT, -p PORT  TCP port to listen on (default: 8000)
>
>I was wondering if it's possible as well to use a specific interface? (In
>my case, I am working on a cloud dev environment, so I need 0.0.0.0)?
gnocchi-api is for testing purpose, for production or any HTTP server
advanced usage, I would recommend to use the wsgi application inside a
real HTTP server, you can find an example with uwsgi here:
http://gnocchi.xyz/running.htm

Cheers,

--
Mehdi Abaakouk
mail: [hidden email]
irc: sileht

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

signature.asc (902 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [gnocchi] Running Gnocchi API in specific interface

aalvarez
I do not need this functionality for production, but for testing. I think it would be nice if we can specify the interface for the gnocchi-api even for test purposes, just like the port.
Reply | Threaded
Open this post in threaded view
|

Re: [gnocchi] Running Gnocchi API in specific interface

Julien Danjou
On Wed, May 17 2017, aalvarez wrote:

> I do not need this functionality for production, but for testing. I think it
> would be nice if we can specify the interface for the gnocchi-api even for
> test purposes, just like the port.

Feel free to send a patch. This is provided by pbr so that's where you
should sent the patch:

  https://docs.openstack.org/developer/pbr/

--
Julien Danjou
// Free Software hacker
// https://julien.danjou.info

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

signature.asc (815 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [gnocchi] Running Gnocchi API in specific interface

Hanxi Liu


On Thu, May 18, 2017 at 3:06 PM, Julien Danjou <[hidden email]> wrote:
On Wed, May 17 2017, aalvarez wrote:

> I do not need this functionality for production, but for testing. I think it
> would be nice if we can specify the interface for the gnocchi-api even for
> test purposes, just like the port.

Feel free to send a patch. This is provided by pbr so that's where you
should sent the patch:

  https://docs.openstack.org/developer/pbr/

Hi jd,

Ceilometer, Gnocchi, Aodh all use pbr, so the port is 8000 by default.

I guess we also should hardcode Gnocchi's port in rdo project, together with Aodh.
i proposed patchs for Aodh and Gnocchi:


But hguemar suggest not to hardcode port.

How do you think about this?

Cheers,
Hanxi Liu
_________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Reply | Threaded
Open this post in threaded view
|

Re: [gnocchi] Running Gnocchi API in specific interface

aalvarez
In reply to this post by Julien Danjou
I thought the API was based on and mounted by Pecan? Isn't there a way to pass these options to Pecan?
Reply | Threaded
Open this post in threaded view
|

Re: [gnocchi] Running Gnocchi API in specific interface

Julien Danjou
On Thu, May 18 2017, aalvarez wrote:

> I thought the API was based on and mounted by Pecan? Isn't there a way to
> pass these options to Pecan?

Pecan is an API framework, not a HTTP server.

--
Julien Danjou
# Free Software hacker
# https://julien.danjou.info

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

signature.asc (815 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [gnocchi] Running Gnocchi API in specific interface

Julien Danjou
In reply to this post by Hanxi Liu
On Thu, May 18 2017, Hanxi Liu wrote:

> Ceilometer, Gnocchi, Aodh all use pbr, so the port is 8000 by default.
>
> I guess we also should hardcode Gnocchi's port in rdo project, together
> with Aodh.
> i proposed patchs for Aodh and Gnocchi:
>
> https://review.rdoproject.org/r/#/c/5848/
> https://review.rdoproject.org/r/#/c/5847/
>
> But hguemar suggest not to hardcode port.
>
> How do you think about this?
Port for HTTP is 80. The rest, unless assigned by IANA, is fantasy. :-)

You can make all your (OpenStack) services run under
http://example.com/openstack, e.g. http://example.com/openstack/metric
for Gnocchi, if you want. So there's no good reason to assigne a port to
a service more than there is to assigne a hardcoded URL prefix.

So I think I'd agree with Haikel here. But ultimately, in the RDO case,
the packaging files should leverage a real WSGI Web server like uwsgi if
they want to start the service, rather than defaulting *all* packages to
the same pbr default. Which will conflict and is bad user experience.

Nobody asks what the default port of e.g. phpmyadmin. The same should go
with OpenStack services ultimately. Unfortunately, the bad habit has
spread from the early day of Nova and Swift using a port and not
providing a WSGI file.

--
Julien Danjou
/* Free Software hacker
   https://julien.danjou.info */

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

signature.asc (815 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [gnocchi] Running Gnocchi API in specific interface

aalvarez
In reply to this post by Julien Danjou
Yes but doesn't Pecan allow to use a development server (pecan serve) that can accept interface and port options? I thought this would be the test/development server Gnocchi would use.
Reply | Threaded
Open this post in threaded view
|

Re: [gnocchi] Running Gnocchi API in specific interface

Julien Danjou
On Thu, May 18 2017, aalvarez wrote:

> Yes but doesn't Pecan allow to use a development server (pecan serve) that
> can accept interface and port options? I thought this would be the
> test/development server Gnocchi would use.

We could but there's no need and it's just one line to rely on pbr's
WSGI server. I'm sure adding the feature to pbr and be framework
agnostic would not be a big deal. :)

--
Julien Danjou
# Free Software hacker
# https://julien.danjou.info

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [hidden email]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

signature.asc (815 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [gnocchi] Running Gnocchi API in specific interface

aalvarez
Understood.

I have submitted a patch to pbr for review here: https://review.openstack.org/#/c/466225/