Sunday, August 21, 2016

Final evaluation

About the project:

The Apache Taverna (incubating) suite is consist of Taverna Engine, which handles both Taverna Workbench and the Taverna Server. Taverna Server is used to execute remote workflows and workbench provides GUI for create, run, import workflows. This concept allow scientists who has limited knowledge in computing, limited technical resources to do complex process on Data. Also Taverna engine can be run on standard Windows, Linux or Mac OS.
At the moment Taverna 3 workflows are constructed using SCULF2 API. So, Tavera Engine can’t execute other workflows other than Taverna workflows. This is where CWL comes in ,The Common Workflow Language (CWL). CWL allows one description of a workflow to be run on multiple different platforms as long as they all support CWL.  " CWL builds on technologies such as JSON-LD and Avro for data modeling and Docker for portable runtime environments ".
The project mission is to bring CWL UI support in the Workbench   which is a graphical way to build workflows and one of the steps in Add Common Workflow Language support to Taverna.  



Mentor: Stian Soiland-Reyes
Modules: 


Org repository: https://github.com/apache/incubator-taverna-common-activities

I had a seperate branch for merging called "cwl-browse": https://github.com/apache/incubator-taverna-common-activities/tree/cwl-browse


My current branch is "cwl-licenses" which is ahead of one commit from the the last branch that got merged "master". 

Work that got merged: 

  1. https://github.com/apache/incubator-taverna-common-activities/pull/20
  2. https://github.com/apache/incubator-taverna-common-activities/pull/7
  3. https://github.com/apache/incubator-taverna-common-activities/pull/4
  4. https://github.com/apache/incubator-taverna-common-activities/pull/1


Work completed:

I have implemented CWL UI plugin for Taverna version 2 and 3, but Taverna version 2 plugin is a intermediate step towards the Taverna version 3.


Also I have written a tutorial about how to move the UI plugin  from Taverna version 2 to Version 3 in the Apache WIKI. Tutorial: https://cwiki.apache.org/confluence/display/TAVERNADEV/Tutorial%3A+Move+a+plugin+from+Taverna+2+to+Taverna+3

Previous blog posts:


Experience:

This was a really great project and it has been a pleasure to work with the Apache Taverna Community which is really a great place for a developer to be. Also i must mention my mentor, has been there for me all along. I learned a lot from him and the community. Also i must mention the CWL community as well. They have been really great and patient with me specially Michael R. Crusoe.  I will continue to contribute for the Apache Taverna and CWL community after the GSoC as well.

Tuesday, August 9, 2016

Moving the plugin to Taverna 3

Introduction

This tutorial is about moving Taverna Plugin from Taverna version 2 to Taverna version 3. In this tutorial, steps towards moving Common Workflow Language (CWL) UI plugin to Taverna 3 is explained. This case has  two main modules:
  • Taverna-cwl-activity
  • Taverna-cwl-activity-ui
Example service invocation tutorial can be found here which explains how the Taverna 2 activity is implemented.   

Taverna-cwl-activity Module

Activity

Taverna-cwl-activity contains CWLDummyAcivity  class, in Taverna 2 which is responsible for specifying the input and the output ports and doing the actual service that is required. Configuring the Activity is done using CwlActivityConfigurationBean, which holds the required configuration information of the activity.


But in Taverna 3  a JSON NODE object is used instead of CwlActivityConfigurationBean.


Activity class is released from  specifying the input and output ports duty and move that to new class called ActivityFactory, in this case CwlActivityFactory class. When the AcivityFactory class is extended, the following methods should be overridden in such a way that it will return Set containing all the details of inputs or outputs.  


All the details required for configuring the inputs and output are in the configuration JsonNode, Which can be browsed using built in methods such as configuration.get(KEY). Each detail of a parameter(input/output) returned as an  ActivityInputPort or ActivityOutputPort object which can be created like the following:


The edits is an object of org.apache.taverna.workflowmodel.Edits class which is configured in the cwl-activity-context-osgi.xml and cwl-activity-context.xml. //should explained more


cwl-activity-context.xml:


cwl-activity-context-osgi.xml:




The link between  CWLDummyAcivity and CwlActivityFactory is achieved through a URI (Activity Type) which is unique for both classes.
As for dependencies, you can see follow, how the pom.xml is different for two versions


Taverna 2: pom.xml
Taverna 3: pom.xml
As you can see now the packages are named org.apache.taverna.* and previously it was net.sf.taverna.t2.*
Taverna 2:


Taverna 3:
The location and the properties of the repositories are also changed,

Taverna-cwl-activity-UI Module

Example service discovery plugin tutorial can be found here which explains how Taverna 2  discovery plugin is implemented.    

ServiceDescription



In Taverna version 3, it is not needed to provide generics, the type of the Configuration bean for ServiceDescriptions since configuration is a org.apache.taverna.scufl2.api.configurations.Configuration object.


Taverna 2:
Taverna 3:
In Taverna version 3, getActivityClass() method is replaced with the getActivityType()  which returns an URI of the corresponding Activity type.
In this case org.apache.taverna.scufl2.api.configurations.Configuration  object contains JSON NODE, which is the configuration of the CwlDummyActivity and the activity type. Thus in Taverna 3 getActivityConfiguration() method is returning a Configuration object instead of CwlActivityConfiurationBean.
In the ActivityFactory, when the getInputPorts(JsonNode configuration) and the  getOutputPorts(JsonNode configuration) methods are called, the argument  JsonNode configuration is the object, which was  initiated in Configuration object(“c.setJson(cwlConfiguration)”).  
Service Provider


As discussed in the above topics, In service provider also configured using org.apache.taverna.scufl2.api.configurations.Configuration object. In Taverna 2 this is done using Configurable bean which contains necessary details to build a service provider.


Taverna 2:
Taverna 3:
As you can see In Taverna 3 generics are removed since all service provider type are configured using org.apache.taverna.scufl2.api.configurations.Configuration object. In this case service provider is a configurable one. That means user can configure the Service provider inside the workbench.
When the constructor of the service provider is called, Configuration should be passed. In this case this is done by the following method,
In this configuration, user will be asked for a PATH to configure  the service provider.

ServiceIcon


In terms of implementation nothing has changed except In taverna 3 packages are moved to org.apache.taverna.*  from net.sf.taverna.t2.*.


ContextualView


In this plugin HTMLBasedActivityContextualView is used as the extended class for ContextualView class. In that case, details can be represented using HTML tags inside the Service Detail panel. Here you can have a peek what it looks like. In Taverna 3, like previous classes, generics have been removed. Because although  there are different types of Activities, they all have common Configuration type org.apache.taverna.scufl2.api.configurations.Configuration. This object contains JsonNode, which holds required information to build an activity.


Taverna 3:
   Constructor:
      
Taverna 2:        
   Constructor:
As for constructors, in Taverna 3 Activity type object is passed instead of CwlDumyActivity type object. This is because  the type of the activity doesn’t matter as long as the Configuration it holds is valid. Another change is now ColourManager object is passed along with the Activity. This ColourManager object is configured  in “context-osgi.xml” and “context.xml” through the ViewFactory.

Contextual VIew Factory


Taverna 3:
Taverna 2:
As shown above In Taverna 3 generics has been changed. Now it’s org.apache.taverna.scufl2.api.activity.Activity  instead of CwlDumyActivity. This is because now the Contextual View is expecting a Activity type object instead of the Specific Activity type object.
Taverna 3 POM: pom.xml

Tuesday, August 2, 2016

New features in CWL version 1.0

There are few changes in defining an input or output in CWL command line tool.


  • No need to use "-id"  no more. Instead of an input/output can be defined as follow,
PreviousNow
                              


  • Type can be defined without the tag "type" as follow,


PreviousNow

  • An array can be defined as "<CWLTYPE>[]", for example an Integer array can be defined as follow,

PreviousNow


  • Now the type "["null",int]" which means the parameter type can be either a null or an int, can be defined as follow, 
PreviousNow
cwl-utilities module is upgraded for these specifications. Main difference is the output of the YAML parser  is changed. Previously inputs or outputs were mapped to an ArrayList but now it's a LinkedHashMap.