Skip to content
Karan Kotabagi edited this page Aug 13, 2018 · 31 revisions

Google Summer of Code 2018 - Integrate NextCloud for Apache Airavata's Data Transfer Use Cases

Project Proposal

The goal of this project is to design and implement a Nextcloud module and replace the existing transfer of the files from the client applications via Hypertext Transfer Protocol (HTTP) and Secure File Transfer Protocol (SFTP) with the API’s of this module. The existing protocols to transfer the uploaded files via client application window differ from each other and run in different ways to establish the connection and transfer the files. The existing mechanisms involve the HTTP and SFTP in order to transfer the files from the client window. To effectively enable the unified mechanism and collaboration of the files with the quick and reliable way we plan to implement the file upload using Nextcloud API. The API’s of the Nextcloud will be targeted in order to transfer the files from the client window and save the files to the Nextcloud. The Nextcloud enables the developers to reliably establish and support an unified mechanism to transfer the files from different clients running on the different platforms. \

View Complete Proposal
https://docs.google.com/document/d/1yAyA1xXTWT6keco2nNtzAcSc6e5wEouV-3sZfY8_gG8/edit?usp=sharing

Flow Diagram

Work Description

The first step of the project was to set-up the nextcloud and start the nextcloud with the users being able to login to the nextcloud server. At first, the nextcloud was configured to login with the keycloak and the user-saml app to enable the single-sign on so as to integrate the nextcloud with the apache airavata as airavata client users currently get authenticated with the Keycloak user backend.

To note that, Keycloak is an open source software product to allow single sign-on with Identity Management and Access Management aimed at modern applications and services.

In order to achieve the same authentication from the backend the custom API was developed in order to connect the nextcloud and the airavata users in the backend, this was part of the first phase demo. In order to replace the custom API developed for the authentication of the nextcloud API in java the new nextcloud app was developed along with one of the Apache Developer.

Running nextcloud instance configured with the Nextcloud Airavata App hosted at the jetstream instance.
http://149.165.156.34

Test credentials:
To get the test credentials please contact my email: karankotz@gmail.com

The users can login to the nextcloud instance if they create the account at the following link:
https://dev.seagrid.org/ and contact the dev list dev@airavata.apache.org for the approval.

Pull requests:

1> Integration of the SEAGrid rich client to upload and download the files from the nextcloud. Airavata users can login and run the experiment with the seagrid rich client. The necessary changes were made in the seagrid rich client in order to upload, download and retrieve the files from the nextcloud server replacing the SFTP authentication with the nextcloud API.
https://github.com/SciGaP/seagrid-rich-client/pull/5

2> Nextcloud App Pull Request To achieve the authentication the nextcloud app was developed with one of the Apache developer, and the pull request submitted to modify the app in order to talk to get the users authenticated from the oAuth token is at the following link.
https://github.com/DImuthuUpe/airavata-nextcloud-app/pull/1

3> Implementation of the WebDAV Adapater in Apache Airavata In order to fulfill the advanced data transfer use cases the WebDAV adapter is implemented with all the details as mentioned in the pull request description at the following link.
https://github.com/apache/airavata/pull/205

4> Implementation of the client changes for the PGA admin portal to add a new data movement interface and support WebDAV Adapter in the airavata-php-gateway repository.
https://github.com/apache/airavata-php-gateway/pull/83

5> Additional pull request contributed to the nextcloud java-api repository to download the files and folders in the backend modules.
https://github.com/a-schild/nextcloud-java-api/pull/11

6> Validation API developed to connect the nextcloud with the Keycloak and enable the authentication via WebDAV using the OAuth token, this was developed in the phase 1 and later the same code is used to modify and run the nextcloud-airavata app developed in the phase 2.
https://github.com/apache/airavata-sandbox/pull/38

Mailing List Communications Link:

Airvata Dev List Communications:

Apache Dev List eMails communicated

Nextcloud Issues raised and communications:

[Activity in the Nextcloud Community] - https://help.nextcloud.com/u/Karan_Kotabagi/activity
[Github Issues Raised] -
https://github.com/nextcloud/server/issues/9637
https://github.com/felixrupp/user_cas/issues/25
https://github.com/a-schild/nextcloud-java-api/issues/10

End to End Demo from the Seagrid-rich-client

Challenges Faced

The major challenge was the authentication of the nextcloud with the OAuth token. The nextcloud doesn't have the ability at present to authenticate the users via external OAuth token and while in the project this was the hardest task. In order to get this issue resolved, I have raised multiple issues and co-ordinated with the Nextcloud developers as in the following links.

In order to overcome this I had developed a validation API that will connect the nextcloud instance and the validate the OAuth token using the token introspection endpoint of the Keycloak and this code was developed as the part of the first phase (later this was used to build and contribute to the nextcloud-app that we have developed for the Airavata, at the pull request https://github.com/nextcloud/server/issues/9637) and demo for the first phase can be found at the following link: https://youtu.be/hn0eQcGbYPs

Future work

The client side changes of the two other portals in the PGA (php-portal) and the Django portal need to be carried out to upload and download the files to and fro from the nextcloud instance and need to be tested with the end-to-end flow.

Clone this wiki locally