Tango on the cloud

Dear All,

you can now try out the latest version of Tango 9.2.5a on the cloud. I have created an Amazon image running Ubuntu 16.04 with Tango 9.2.5a pre-installed and configured to start up at boot time. The image is public and can be found under this id and region:
AMI-ID: ami-d503cfba
region=EU-Frankfurt
(see [1] to find out how to do this).

Launch VM with this image and you will have Tango 9.2.5 + PyTango 9.2.0 up and running including the Tango REST API [2] so you can access it from internet.

Note that the TANGO_HOST is the private IP address of the VM. This means the Tango database and device servers are not accessible from the internet but only on the VM or set of VMs which share the same VPN. This can be seen as a security feature. Use the REST api and Tango security to open up access to the device servers you want to expose.

To experiment with the REST api I have started an instance of the AMI image on Amazon cloud. You can connect to the TangoWebApp as follows:
1. point your browser to this url:
http://ec2-35-157-86-137.eu-central-1.compute.amazonaws.com:8080/TangoWebapp/
2. click on cancel on the popup login window
3. set the TANGO_REST_URL to
http://ec2-35-157-86-137.eu-central-1.compute.amazonaws.com:8080/tango/rest
(note: NO spaces before or after and no quotes)
5. set the TANGO_HOST to
ip-172-31-29-94.eu-central-1.compute.internal:10000
(note: NO spaces or quotes otherwise it won't work!)
6. click on the refresh button to the right of the TANGO_HOST field
7. login as user=tango-cs and pw=tango when prompted (note: if you do not get a new prompt for user name and pwd from the host ec2-35-156-147-163.eu-central-1.compute.amazonaws.com then the WebApp is down and it won't work)
8. expand the tree of devices at the top left of the application

See picture below to find out more. You should be able to play with the TangoTest device sys/tg_test/1 :


Let me know if you get the AMI image to launch for you. I can share some more tips about security and how to start a remote desktop.

Have fun (I did)!

Andy

[1] http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html#finding-an-ami-console
[2] http://tango-rest-api.readthedocs.io/en/latest/
Edited 7 years ago
Hi Andy,

Very interesting experience. Thank you very much for this instruction. You have done a huge work.

For now when I try to access the provided link to TangoWebapp there is no response. Is image down?

Regards,
Hi Igor

glad it helps. I admit to having had some fun playing with this and exploring the use of the cloud for Tango. You are right the machine has been changed. I have downgraded the instance type to a t2.micro which is free. The new public IP is :

ec2-35-157-86-137.eu-central-1.compute.amazonaws.com
The image has been updated since the original one to include pytango 9.2.1, starter + astor configured to start TangoTest and WeatherUnderground device servers. The WeatherUnderground server is a server to give the live weather from the towns where there is a major Tango site. I will update the public image soon so these changes can be shared.

You can test the REST api by executing this command:
curl -u "tango-cs:tango" http://ec2-35-157-86-137.eu-central-1.compute.amazonaws.com:8080/tango/rest/rc3/hosts/ip-172-31-29-94.eu-central-1.compute.internal/10000/devices/earth/weather/tango/attributes/Grenoble_t/value
should give something like this:

{"name":"Grenoble_t","value":6.0,"quality":"ATTR_VALID","timestamp":1485896746082}
Or by typing the url into your browser it should display the output nicely formatted if you have a extension JSONview:
{

"name": "Grenoble_t",
"value": 6.0,
"quality": "ATTR_VALID",
"timestamp": 1485896593083

}
Any feedback or ideas on how to go forward would be appreciated. My current thinking is to use this setup to link Tango to the IoT.

Regards

Andy
Edited 7 years ago
Hi Andy,

I wish to try my hand on Tango image on the cloud. But, I am unable to connect to it. Tried to connect using Curl, but the connection is refused.

May you please redirect me to the correct path.

Kind regards,
Jyotin
Hi,

I have started the image on the amazon cloud again. The new ip is:

ec2-52-59-170-195.eu-central-1.compute.amazonaws.com

I noticed the TangoWebApp is not working. I need to investigate this. But curl should work:

curl -u "tango-cs:tango" http://ec2-52-59-170-195.eu-central-1.compute.amazonaws.com:8080/tango/rest/rc3/hosts/ip-172-31-29-94.eu-central-1.compute.internal/10000/devices/earth/weather/tango/attributes/Grenoble_t/value

should return :

{"name":"Grenoble_t","value":23.0,"quality":"ATTR_VALID","timestamp":1498200623996}

You can try with the names of the other Tango cities like Paris, Cape Town, Moscow, …

I suggest you start your own image to play with. This way you can login and change things.

Andy
Hi Andy,

I have looked into TangoWebapp. It is version 0.1. There is an issue with this version. To solve it, user must refresh the page (press F5):



My suggestion is to update the image with 0.2-rc1: https://github.com/tango-controls/tango-webapp/releases/tag/v0.2-rc1

Cheers,
 
Register or login to create to post a reply.