knime server workshop · • install tomcat/tomee 1.7 • configure application server – jvm...
TRANSCRIPT
Copyright © 2015 KNIME.com AG
TableofContents
ServerArchitectureServerAdministrationWorkflowandDataSharingMetanode /Subnode TemplatesRemote&ScheduleExecutionKNIMEWebPortalWebserviceInterface
2
Copyright © 2015 KNIME.com AG
KNIMEServer– FunctionalSetup
WizardExecution
REST/SOAPInterface
WorkflowVersioning /Diff
WebPortal Templates
Tomcat/TomEEAppServer
Copyright © 2015 KNIME.com AG
KNIMEServer– Architecture
5
Java8
Tomcat/TomEEApplicationServer
VAADIN7
KNIMEWebPortal KNIME
ServerKNIMEExecutor(headlessKNIME
AnalyticsPlatform)
Copyright © 2015 KNIME.com AG
Why TomEE?
6
• ApacheTomEE isbasedonApacheTomcat– MuchhigheradoptionthanGlassfish– AdditionallibrariestosupportEJB
• CommunicationsolelyviaHTTP– Less firewall problems– SSLEncryptionforclient- andweb-to-servercommunication
• Installationand deployment considerably easier• Betteruserandgroupmanagement• Simultaneousconnectiontomultipleservers• KNIMEServer4.0availablemidof2015
Copyright © 2015 KNIME.com AG
InstallationOverview
7
• InstallJava8• InstallKNIMEAnalyticsPlatform• Createsharedworkflowrepository• InstallTomcat/TomEE 1.7• ConfigureApplicationServer
– JVMOptions– KNIMEServersettings– Createemailresource
• Defineusers(orconfigureLDAP/AD)• DeployKNIMEServer• DeployKNIMEWebPortal
Copyright © 2015 KNIME.com AG
AdministrationOverview
8
Typicalresponsibilities oftheKNIMEServerAdministrator:• Performserversideupdates(~2xperyear)
– Intermediatebugfixreleasesprovided ifnecessary
• Structuretheworkflowrepository• Manageruseraccessviapermissions
Copyright © 2015 KNIME.com AG
NewfeaturesareneededfortheKNIMEAnalyticsPlatformtoaccesstheServer.
InstalltheKNIME.comClient-SideExtensionsfromtheKNIMEServerupdatesite.
KNIMEServerClientExtensions
10
Copyright © 2015 KNIME.com AG
Serverconnectionsareshownas“mountpoints”intheKNIMEExplorer.Toaddanewmountpointsimply:
1. ClickontheconfigurebuttonintheKNIMEExplorer.2. ClickNew…3. ConfigureaServerSpace withyourdetails
DefininganewServerSpace
11
Copyright © 2015 KNIME.com AG
Serverconnectionsareshownas“mountpoints”intheKNIMEExplorer.Toaddanewmountpointsimply:
1. ClickontheconfigurebuttonintheKNIMEExplorer.
2. ClickNew…3. ConfigureaServerSpace with
yourdetails
DefininganewServerSpace
12
Copyright © 2015 KNIME.com AG
TheServerprovidesanareaintheExplorerforsharingworkwithyourcolleagues.Useworkflowgroupstoorganizeyourworkflows,metanodes,anddatafiles.
• Workflowgroups• Datafiles• Workflows• Metanodes
ServerSpaceasasharedrepository
13
Tomoveresourcessimplydraganddroporcopyandpaste
Copyright © 2015 KNIME.com AG
WorkflowJobs
17
Remotelyexecutedworkflowsarerunas“Jobs”
• Aworkflowjobisacopyoftheworkflowwithspecificsettingsanddata.
• Jobsaretiedtoaparticularversionofaworkflow
• Orphanedjobsarecoloredred• Jobshavemessages(e.g.successful,or
failure)• Canbesavedasworkflowfordata
provenanceanddebugging(right-clicksaveas)
Copyright © 2015 KNIME.com AG
WrappedMetanodes
• SimilartoMetanodes• Differinkeyareas:
– Limitedvariablescope(c.f.globalscopeforMetanodes)– UsewithQuickFormnodes(AnalyticsPlatform3.1+)
• KeytoadvancedfunctionalityinKNIMEproducts:– UsefornewWebPortal pages
20
Copyright © 2015 KNIME.com AG
Metanodes vs.WrappedMetanodes (WebPortal)
Metanodes WrappedMetanodes
QuickForms Legacy Standard
Variable scope Global Local
WebPortal Execution Old New(work withloops/switches)JavaScriptviews inWebPortal
Notsupported Supported
WebPortal Usage Quickforms usedglobally Views/Quickforms mustbeembedded inaWrappedMetanode
Recommended uses Legacyworkflows NewdevelopmentsCompatibility KNIMEServer3.x/4.x KNIMEServer4.2+
22
*ValidforKNIMEAnalyticsPlatform3.1andabove
Copyright © 2015 KNIME.com AG
WebPortal Templates(V)
• Layoutcanbeconfiguredbytemplates– Footer&header– Mainpanel– Loginpage– …
• Customstylesheet• CustomJavaScriptlibraries
– Canbere-usedinJS-basedviews
Copyright © 2015 KNIME.com AG
WebPortal Templates(VI)
• Templatesarepartoftheconfigurationandarenotoverriddenbyupdates
Copyright © 2015 KNIME.com AG
SOAPWebservice API
38
• SOAPBased,InstalledwiththeKNIMEServerapplicationhttp://<servername>:8080/GenericWorkflowService/GenericWorkflow?wsdl
• Supportsauthentication
• ExecuteworkflowsfromwithinKNIMEorotherapplications
• Codeexamplesavailableuponrequest
Copyright © 2015 KNIME.com AG
Programmaticaccess
40
URLwsdlURL =...;
QName name=newQName("http://www.knime.com/soap","GenericWorkflowService");
ServiceknimeService =Service.create(wsdlURL,name);
GenericWorkflowWebService accessor =knimeService.getPort(GenericWorkflowWebService.class);
BindingProvider bin=((BindingProvider)accessor);
Map<String,Object>requestContext =bin.getRequestContext();
requestContext.put(BindingProvider.USERNAME_PROPERTY,user);
requestContext.put(BindingProvider.PASSWORD_PROPERTY,pass);
accessor.listWorkflows();accessor.invokeAsync(...);
Copyright © 2015 KNIME.com AG
SOAPNodes
41
• UsetoaccessKNIMEWebservices(orothers)
• Supportsworkflowcredentials
Copyright © 2015 KNIME.com AG
RESTInterface
• Mainaddition to KNIMEServer4.1• REST=RepresentationalStateTransfer
– Communicationbased onHTTP– Usually clear text
• Many possible clients– Webbrowser– Javaapplications (e.g.viaJAX-RS)– KRESTnodes
• https://www.knime.org/blog/the-knime-server-rest-api• https://www.knime.org/blog/giving-the-knime-server-a-rest
42
Copyright © 2015 KNIME.com AG
RESTExample:ListWorkflows(I)
• Viabrowser– http://localhost:8080/com.knime.enterprise.server/rest/v4/repository/list
– Requires user authentication
Copyright © 2015 KNIME.com AG
RESTExample:ExecuteWorkflow(I)
• Viabrowser– Loadworkflow
• http://localhost:8080/com.knime.enterprise.server/rest/v4/jobs/load/UGM2015/RESTDemo/Report
• Returnsunique job ID– Executejob
• http://localhost:8080/com.knime.enterprise.server/rest/v4/jobs/syncExec/24a76fec-a74e-45ba-b03f-cabf528b6a69
• Returnsfinalstatus– Render report
• http://localhost:8080/com.knime.enterprise.server/rest/v4/jobs/renderReport/24a76fec-a74e-45ba-b03f-cabf528b6a69/PDF
• Formatcan be specified inrequest
Copyright © 2015 KNIME.com AG
RESTExample:Live-Scoringonserver (I)
• Get expected parameter format fromworkflow• Setinput parameters ininput quickformnodes• Executeworkflow• Get results from quickformoutput nodes
Scoringworkflow,calledviaREST
Copyright © 2015 KNIME.com AG
RESTExample:Live-Scoringonserver (II)
• Get expected parameter format fromworkflow• Setinput parameters ininput quickformnodes• Executeworkflow• Get results from quickformoutput nodes
Copyright © 2015 KNIME.com AG
RESTExample:LiveScoringonserver (III)
• ViaCallRemoteWorkflownode– Analyzes input parameters– Prepare input data accordingly– Executes job and gets backresults
Copyright © 2015 KNIME.com AG
JSONType&UtilityNodes
• JSON– JavaScriptObjectNotation• Hierarchicaldataformat
Copyright © 2015 KNIME.com AG
JSONType&UtilityNodes- Applications
• WebServiceconsumption((K)REST)• NoSQL databases/MongoDB• KNIMEWebService