Thursday, February 06, 2014

SAP HANA Cloud: OpenSocial widgets auto-discovery and operation

Recently we added functionality that enables deployment of OpenSocial widgets and their auto-discovery in SAP HANA Cloud Portal. 

As Wikipedia states:
OpenSocial is a public specification that defines a component hosting environment (container) and a set of common application programming interfaces (APIs) for web-based applications. Initially it was designed for social network applications
You can check the developer guide for OpenSocial widgets in the Portal for more information how to create such widget. 

There is also a short topic on how to package the widget which notes that your spec.xml needs to be:
  • publicly accessible resource
  • named so that it ends with the .spec.xml suffix
  • with name, description and thumbnail that will be shown in Portal Content Catalog

Deploying & running your widget as SAP HANA Cloud application allows you to use the Portal auto-discovery. This means that when your application is started successfully on the HANA Cloud, it will be visible in the Portal Content Catalog, so you can build a site with such widgets.

Soon you should also be able to deploy Cloud Portal sites with the widgets layout you created. Of course we will also be able to do auto-discovery for them as well.

The widgets has to be running and accessible no matter if hosted or not in SAP HANA Cloud. This is needed so the Portal can fetch the spec.xml from the publicly accessible URL of the widget application.

Since widgets and sites are relatively small, they will make small application packages (WAR files). To run several widgets you may need several compute units and you may need to pay for all of them.

However there is a way to combine several small WAR files and run them on a single compute unit as a single application. 

Just copy all WAR files in one directory and use the Command Line deploy command to deploy the whole directory. As the documentation of deploy command states you can use the --source parameter to provide:
a comma-separated list of file locations, pointing to WAR files, or folders containing them
The result will be a single application from SAP HANA Cloud point of view (lifecycle, monitoring, billing), having multiple WAR files running inside.
Please have in mind that all these applications (no matter if widgets or plain Java apps) are running on  the same compute unit and they share the memory, CPU and storage resources of the unit.  

So if you have resource hungry applications, perhaps it is not very wise to save money by increasing the response time (or latency) of your customers.

You can however use this multiple-wars-in-a-single-application approach for development or testing environments, modelled for staged development

So use this for testing, but beware the performance impact for productive scenarios.

No comments:

id_rsa.pub: invalid format, error in libcrypto

After I upgraded my Linux and got Python 3.10 by default, it turned out that Ansible 2.9 will no longer run and is unsupported together with...