[This article was first published on Open Analytics, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.ShinyProxy 3.0.0Today we release version 3.0.0 of ShinyProxy, providing improvements on all aspects of using anddeploying ShinyProxy. ShinyProxy is a novel, open source platform to deploy Shiny apps for theenterprise or larger organizations. Nevertheless, ShinyProxy is also an excellent choice fordeploying a handful of apps in smaller organizations. While ShinyProxy is generally used to hostShiny applications, it has always been designed with the idea to host any application that can bepackaged into a Docker container. For example, ShinyProxy is used more and more to host completedevelopment environments. This blog post covers some major improvements of this release. Allchanges in this version can be found in the release notes.
High Availability and ScalingAlthough a single ShinyProxy server is able to handle a large amount of users and apps, it does notprovide high availability. All apps are inaccessible if that single server crashes or restarts. WithShinyProxy 3.0.0, it is now possible to run multiple replicas of ShinyProxy, providing both highavailability and scaling. Therefore, one of the replicas may crash without the apps becominginaccessible. Furthermore, by using a load balancer all requests are spread over the replicas, whichreduces the load on a single server and increases the maximum throughput.
In order to fully benefit of this feature, it is advised to make use of Kubernetes and theShinyProxy Operator. Together with this release we are releasing the ShinyProxy Operator 2.0.0, withfull support for high availability and scaling. Nevertheless, the high availability mode is alsosupported when using Docker Swarm.
App ParametersA completely new feature in this release is the support for app parameters. As part of an appconfiguration, you can now specify a set of parameters for the app. Whenever the user launches anapplication, ShinyProxy will show a form and ask the user to select a (pre-defined) value for eachparameter. For example, the following app defines a parameter for the amount of CPU cores andmemory:
This feature has lots of possibilities and applications. For example, in the case of a Shinyapplication it could be useful to allow the user to start older versions of the application (e.g. tocompare different models). This can be achieved by adding a parameter with the version of theapplication and using the value of this parameter to launch a specific Docker image. In othercircumstances, e.g. when deploying IDE’s, it is possible to add a parameter for the amount of CPUand memory which will be reserved for the app. Or you could add a parameter to let the user specifythe max lifetime of an app.
This feature has been designed to be easy to use for both the administrator of ShinyProxy and theend-users. Because there is no built-in list of parameters, you can freely add parameters for(almost) all configuration properties of an application. Furthermore, you can use the parameters asenvironment variables in order to make them available to the app itself. Finally, it is possible toprovide your own form for choosing the parameters.
Check out the app parameters documentation.
Improved APIIn order to support all new features of this release, we have improved the (HTTP) API of ShinyProxy.In addition, the API is now documented using the OpenAPIspecification which can be viewedusing the Swagger UI. Together with thenew API being more consistent, this makes the API much easier to use.
The API has also been improved in terms of security. In the first place, the API no longer returnsany sensitive information to users. For example, the user can no longer retrieve the complete specof an application or retrieve which docker image is used by a running application. Furthermore, itis now possible to configure CORS or add additional headers to API responses.
A key advantage of the improved API is that the request to start an app now takes at most tenseconds to complete, even if the app needs more time to startup. Therefore, there is no longer aneed to configure load balancer or proxies in front of ShinyProxy to have (very) longrequest-timeouts.
Improved logging and hidden error messagesHandling error messages and logging is yet another area that has been improved a lot in thisrelease. First of all, ShinyProxy does no longer return any internal errors or stack traces to theuser. Instead, a nice looking page is shown to the user:
For many deployments this improves security, as end-users should not know any details on the reasonthe app failed to start. However, for the administrators of ShinyProxy it should be very easy todiscover why applications are failing to start. For the Docker (Swarm) backend, ShinyProxy hasalways logged the exact error. However, for Kubernetes this is more difficult because of thedistributed nature of Kubernetes. Fortunately, this has been fixed in this release: ShinyProxy isable to extract the error message from Kubernetes and log it in the ShinyProxy log. Along with otherimprovements with respect to logging this makes debugging ShinyProxy on Kubernetes a lot easier.
For example, using the ShinyProxy Monitoringstack, the complete logs of a single appcan be easily viewed in Grafana:
Shiny bookmarkingA final major improvement is the support for Shiny bookmarking. ShinyProxy is now able to track theURL of the app and reproduce changes in the URL (of the app) into the browser of the URL. In fact,this does not only work well with Shiny bookmarking, but with any web app.
Full release notes can be found on the downloadspage and updated documentation can be found onhttps://shinyproxy.io. As always community support onthis new release is available at
https://support.openanalytics.eu
Don’t hesitate to send in questions or suggestions and have fun with ShinyProxy!
To leave a comment for the author, please follow the link and comment on their blog: Open Analytics.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.Continue reading: ShinyProxy 3.0.0