sonata-nfv / son-mano-framework

SONATA's Service Platform MANO Framework
http://www.sonata-nfv.eu
Apache License 2.0
20 stars 13 forks source link

Hardcoded uri Repositories #100

Closed felipevicens closed 8 years ago

felipevicens commented 8 years ago

Hello! https://github.com/sonata-nfv/son-mano-framework/blob/master/plugins/son-mano-service-lifecycle-management/son_mano_slm/slm.py

Are these urls hardcoded?

The NSR Repository can be accessed through a RESTful API

NSR_REPOSITORY_URL = "http://api.int.sonata-nfv.eu:4002/records/nsr/" VNFR_REPOSITORY_URL = "http://api.int.sonata-nfv.eu:4002/records/vnfr/";

Monitoring repository, can be accessed throught a RESTful API

MONITORING_REPOSITORY_URL = "http://sp.int2.sonata-nfv.eu:8000/api/v1/";

tsoenen commented 8 years ago

@felipevicens : Hi Felipe! Yes, for the moment they are hardcoded. Is there something in place so we can prevent this / somewhere to read them from?

mpeuster commented 8 years ago

What about using ENV variables for it? This would be the most Docker-like approach to do it. You can then easily configure these properties when starting the SLM container.

Just like it is done e.g. for the message system: https://github.com/sonata-nfv/son-mano-framework/blob/master/son-mano-base/sonmanobase/messaging.py#L77

What do you think?

tsoenen commented 8 years ago

Sounds good, I'll look into changing it like that.

When starting the SLM, where will it be red from? Is their a RESTful api call that gives me the different urls?

jbonnet commented 8 years ago

Yes, definitely ENV variables, 'though we're getting long trains of ENV variables in Jenkins' jobs specifications. And we have it out in the open (I know, it's our environment -- Athens' testbed -- but hey! we're outsourcing this!), including database passwords... Ansible has a way of putting this kind of information into an encrypted 'bag'. I heard GitHub also has something similar, since recently, but I've never used it.

felipevicens commented 8 years ago

Thanks Thomas! currently we have the integration server sp.int3.sonata-nfv.eu and I found this issue because it will not work deployed there.

jbonnet commented 8 years ago

I'm doing it like this (for my dev environment, for others I adjust this -- see Jenkins jobs definition): PORT=5000 PACKAGE_MANAGEMENT_URL=http://localhost:5100 SERVICE_MANAGEMENT_URL=http://localhost:5300 FUNCTION_MANAGEMENT_URL=http://localhost:5400 foreman start In which foreman start is the command

tsoenen commented 8 years ago

@mpeuster : this can be closed. All links are converted towards ENV variables.

mpeuster commented 8 years ago

@tsoenen Perfect.