Re: Create NDS Labs API


An interesting question arises from Zeo's work here and our recent discussions, captured in the v4 diagram here:
https://wiki.ncsa.illinois.edu/display/NDS/NDS+Explorer+Design+and+Implementation


First, I observe that Zeo's nds-webservices implementation depends on an installed and working startup_ndslabs.py script locally on the same node where the webservices code is running. My initial reaction was: We should move the startup_ndslabs.py script to the webservices repo -- so all these related pieces of code are version controlled together and self contained. The 'nds_labs' repo, where the script currently resides, contains NDS services. NDS services are not tightly coupled to the nds labs environment startup script.

This last point made me realize further -- there will be numerous _optional_ services that require persistent storage (i.e. OpenStack volumes or object containers). We should not be allocating OpenStack volumes for all the optional services during NDS Labs startup. Actually, I think a stronger statement can be made: We don't have apriori knowledge of where (in which Instances) future services requiring persistent storage will be launched, therefore we cannot allocate persistent storage at "nds labs create" time. So storage allocation should only occur if and when the NDS service is first launched, which is performed by the internal (to the labs environment) REST API for the management of NDS services (currently labelled as "nds-django" on the v4 diagram).

A couple of options for how to do that:

1. Put functionality for calling OpenStack inside that internal REST implementation (labelled "nds-django") to allocate OpenStack volumes, or
2. Have the internal REST implementation (labelled "nds-django") call out to the nds-webservices to allocate OpenStack Volumes, or
3. Door number 3


Thoughts?

- Mike


On 7/14/2015 4:32 PM, Lengyue Chen wrote:
Hi all

I have pushed the code of REST API to create NDS Lab to the
nds-27-implement-create-rest-endpoint branch.
https://bitbucket.org/nds-org/nds-webservice/src/8eeff20c855b27893418b1cc056db17c284b89f7?at=nds-27-implement-create-rest-endpoint
<https://urldefense.proofpoint.com/v2/url?u=https-3A__bitbucket.org_nds-2Dorg_nds-2Dwebservice_src_8eeff20c855b27893418b1cc056db17c284b89f7-3Fat-3Dnds-2D27-2Dimplement-2Dcreate-2Drest-2Dendpoint&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=iEj4zY2m23d9QPzTewICNOX29P1IYSX9q3kyeqIQKeo&m=89NnXcXnhkwcENaqjCnS9Q86T2FUVe3fBndL6TGTVuc&s=5krOedlROcqw2IMxxT6cTEY9R-6zZtvE4jGV0ISiGTk&e=>

To try the API, you have to install strongloop on which the api are
built. It provides a test server running on you local host and a GUI to
send HTTP request. https://strongloop.com/get-started/
<https://urldefense.proofpoint.com/v2/url?u=https-3A__strongloop.com_get-2Dstarted_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=iEj4zY2m23d9QPzTewICNOX29P1IYSX9q3kyeqIQKeo&m=89NnXcXnhkwcENaqjCnS9Q86T2FUVe3fBndL6TGTVuc&s=8oQlgrgFaa9Qd2-IB0e_HPKwX0956-FHlkkcxLy9tFE&e=>

After installing the strongloop, cd into nds-webservice directory and run
npm install
to install all dependencies.

And then you need to
1. modify nds-webservice/common/models/environment.js. In line 10,
specify your ssh key name, openstack user name, password in the
arguments of the python script.
2. modify nds-webservice/startup_ndslabs.py in line 129-136, specify
your own volumes ids which can be found in openstack dash board.

The last step is to follow instructions here provided by Mike to resolve
the connectivity issue to the vlad-mgmt:

https://wiki.ncsa.illinois.edu/display/NDS/Connectivity+to+the+VLAD+OpenStack+Management+Network
<https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.ncsa.illinois.edu_display_NDS_Connectivity-2Bto-2Bthe-2BVLAD-2BOpenStack-2BManagement-2BNetwork&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=iEj4zY2m23d9QPzTewICNOX29P1IYSX9q3kyeqIQKeo&m=89NnXcXnhkwcENaqjCnS9Q86T2FUVe3fBndL6TGTVuc&s=1AEZ3qFWwrjj4LqRnPD-Q37chGSgmvyNHtCyjOJWEvw&e=>


You can start the server with command: node .

and then browse to http://localhost:3000/explorer/
<https://urldefense.proofpoint.com/v2/url?u=http-3A__localhost-3A3000_explorer_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=iEj4zY2m23d9QPzTewICNOX29P1IYSX9q3kyeqIQKeo&m=89NnXcXnhkwcENaqjCnS9Q86T2FUVe3fBndL6TGTVuc&s=C8GusXWOtRw61nBuDjzOYZxjWgKCmfWcZQTz3p8Cyf8&e=>
to try the API.


At this point, just specify the lab name and put 3 for the number of instances. It will create 3 instances in openstack and one of them is master node with public ip. It will store the instance id and ip address to the mongodb, with which we can manipulate those instances in other apis. Email me any issues you run into. Thank you.

Best
Zeo





Other Mailing lists | Author Index | Date Index | Subject Index | Thread Index