Back

Tech Blog: How New Django Portal for Apache Airavata Can Be Used by Gateways

By Eroma Abeysinghe & Marcus Christie

Explanation of New Django Portal for Apache Airavata

The Apache Airavata project provides middleware and APIs needed to build a modern science gateway. In addition to this, the Airavata project has also developed a web user interface to its APIs that serves as a reference implementation of an Airavata client. That web user interface was implemented in PHP and at that time the recommendation for gateway developers was that they can use this PHP web app to get started but they should develop their own user interface to the Airavata API. However, recently the Airavata project has been working on building a brand new modern web application based on Django with a dynamic frontend written in Vue.js. This Django portal is designed to be a first-class user interface to Airavata and it is designed to be extensible by gateway developers.

Briefly, the Airavata Django portal allows gateways admins to register their application codes and their community allocations and make them available to their gateway users. Users can use the portal to execute scientific applications, monitor those executions and manage, analyze and share the resulting data from those executions.

The Computational System Biology Group (CSBG) at LSU, with consultation and development support from the EDS team of Science Gateways Community Institute (SGCI), developed the https://sciencegateway.brylinski.org gateway for existing and new users of CSBG tools. The major focus of the CSBG group is the design and development of novel tools for the structure-based modeling and analysis of biological networks. Computational Systems Biology is considered a complex platform that integrates many algorithms from different research areas such as Structural Bioinformatics, Functional Genomics, Cheminformatics, and Pharmacogenomics. Currently, the primary application of the CSBG LSU tools is for modern drug discovery and design. The hosted gateway is the platform through which their requirements and tools are made available to existing and new users.

What are the benefits to science gateway developers? What problems does it address?

Gateway developers can build customizations on top of the Airavata Django portal instead of needing to reimplement all aspects of a science gateway from scratch. There are three ways gateway developers can customize the Django portal:

  1. Customized application input interfaces - in the Django portal when a user wants to run an application (an "application" here means a scientific code that Airavata will execute and manage on an HPC resource) they need to provide values for all of its inputs. The inputs are defined by the gateway administrator. Gateway admins can customize what UI component is displayed to the user for each input. For example, the application may need to be provided with one of several values from a list of permitted values. The gateway admin can choose to use a dropdown UI component to list the permitted values and allow the user to pick one. Further, gateway developers can develop custom components in Vue.js when the existing set of components aren't sufficient.

  2. Customized application output viewers - typically when applications are executed they generate files. Airavata transfers output files to the portal server and the Django portal displays these files to the user where they can download them to their local desktop. However, a gateway may want to provide some sort of view of the output files right there in the portal instead of requiring users to download the files. Gateway developers can write Python code to take the output files and generate links or images or charts.

  3. Custom Django apps - a gateway may have unique UI needs that require a completely different UI than the ones provided by the Django portal for data and execution management. Gateway developers can develop a custom Django app that provides whatever UI is required for the gateway. A "Django app" is a kind of plugin to Django that can be automatically loaded into the portal when the Django app is installed into the server's Python virtual environment. Gateway developers can make use of the REST API and JavaScript REST and data model utilities when they take this approach so they don't need to implement everything from scratch. In general, a custom Django app will involve developing custom UI code that can leverage the existing REST APIs in the Django portal.


eFindSitePPI Experiment Creation - Option selections, Checkboxes, 
and String inputs with Character length validations

How can has it been implemented by SGCI staff?

  1. The LSU CSBG gateway is one of the very first gateways to adopt the new Django user interface for Apache Airavata. The PI wanted several well-controlled advance inputs for his applications to minimize user mistakes.

  2. At the time we deployed a PGA gateway portal for this project the PI came to us with his requirements for more controlled application inputs. The requirements to be implemented in the PGA needed code level changes and it got our system architects to think and research on better ways to accommodate different gateway requirements. Requirements which need different system integrations, different application interface configurations, etc

  3. Hence the Django implementation started and LSU CSBG gateway got one of the first beta gateways deployed. The gateway PI and his team helped us with the initial testing and providing us with valuable user reviews on the gateway.

  4. The beta gateway was deployed in Jetstream, XSEDE cloud resource and the gateway middleware was also in Jetstream.

  5. After the gateway was deployed we provided the PI and his team with documentation on configuring the gateway, registering applications and how to configure advanced input features using JSON formatting.

  6. The two other major features with the Django implementation are the fine-grain control a gateway admin would have over compute resource availability and managing access to license software through the gateway.

  7. As for now, the beta gateway is being used by the PI, PI’s team, several students from his classes and few friendly users.

What would make someone choose this solution over another?

Building customizations to the Airavata Django portal is preferable to implementing a user interface from scratch since there are several general pieces of functionality that the Django portal provides that would be tedious to re-implement:

  1. Authentication and authorization - the Django portal provides user interfaces for account creation, password management, and integration with Keycloak and federated identity providers. The portal also provides admins with tools to manage user accounts and authorize them to execute application codes.

  2. REST API bridge to the Airavata middleware API - as mentioned above, the Django portal provides a REST API for accessing the functionality exposed by the Airavata middleware API

  3. Administrative tools - the Django portal provides gateway admins with tools to register their community allocations and share them with the gateway's users. Admins also can register their applications and they can monitor usage of the gateway and have access to advanced troubleshooting views so that they can help their users resolve any issues that arise during application execution.

  4. Sharing tools - the Django portal provides admins and gateway users with user interfaces for defining groups of users and sharing experiment results with other users of the gateway.

Tech Blogs are written by SGCI experts and offer a variety of resources for gateway builders and developers. It's likely that, from reading this post, you'll have what you need to incorporate these technologies on your own, but we're here to help if you ever need it. Submit a Consulting Services Request Form to get help with adding this or any other tool, or email us at help@sciencegateways.org with questions. 

View all Tech Blogs here.


More than just everyday musings...

Have an idea for a topic you’d like to share (or you’d like us to write)? Let us know! Email help@sciencegateways.org with your idea.