53
Copyright © 2015 KNIME.com AG KNIME Server Workshop Jon Fuller Application Scientist KNIME.com AG

KNIME Server Workshop · • Install Tomcat/TomEE 1.7 • Configure Application Server – JVM Options – KNIME Server settings – Create email resource • Define users (or configure

  • Upload
    others

  • View
    18

  • Download
    0

Embed Size (px)

Citation preview

Copyright © 2015 KNIME.com AG

KNIMEServerWorkshopJonFullerApplicationScientistKNIME.com AG

Copyright © 2015 KNIME.com AG

TableofContents

ServerArchitectureServerAdministrationWorkflowandDataSharingMetanode /Subnode TemplatesRemote&ScheduleExecutionKNIMEWebPortalWebserviceInterface

2

Copyright © 2015 KNIME.com AG 3

Architecture&Administration

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 9

ClientAccess

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

Permissions

14

Available in KNIME Server

Owner

Groups

Everybody Else

Copyright © 2015 KNIME.com AG

RemoteExecutionandScheduling

15

Available in KNIME Server

Copyright © 2015 KNIME.com AG

RemoteExecutionandScheduling

16

Available in KNIME Server

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 18

KNIMEWebPortal

Copyright © 2015 KNIME.com AG

WebPortal EnabledDataMining(legacy)

19

Copyright © 2015 KNIME.com AG

WrappedMetanodes

• SimilartoMetanodes• Differinkeyareas:

– Limitedvariablescope(c.f.globalscopeforMetanodes)– UsewithQuickFormnodes(AnalyticsPlatform3.1+)

• KeytoadvancedfunctionalityinKNIMEproducts:– UsefornewWebPortal pages

20

Copyright © 2015 KNIME.com AG

WrappedMetanodes

21

Select

Collapse

Wrap

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 EnabledDataMining

23

Copyright © 2015 KNIME.com AG

ExecutiononServerviaWebPortal- 1Webportal EnabledDataMining

24

Copyright © 2015 KNIME.com AG

Execution onServerviaWebPortal - 2Webportal EnabledDataMining

25

Copyright © 2015 KNIME.com AG

Execution onServerviaWebPortal - 3Webportal EnabledDataMining

26

Copyright © 2015 KNIME.com AG

Execution onServerviaWebPortal - 4Webportal EnabledDataMining

27

Copyright © 2015 KNIME.com AG

Execution onServerviaWebPortal - 5Webportal EnabledDataMining

28

Copyright © 2015 KNIME.com AG

ExecutiononServerviaWebPortal- 6Webportal EnabledDataMining

29

Copyright © 2015 KNIME.com AG

KNIMEWebPortal:URLParameter

30

Copyright © 2015 KNIME.com AG

WebPortal Templates(I)

Copyright © 2015 KNIME.com AG

WebPortal Templates(II)

Copyright © 2015 KNIME.com AG

WebPortal Templates(III)

Copyright © 2015 KNIME.com AG

WebPortal Templates(IV)

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 37

WebserviceAccess(SOAPandREST)

Copyright © 2015 KNIME.com AG

SOAPWebservice API

38

• SOAPBased,InstalledwiththeKNIMEServerapplicationhttp://<servername>:8080/GenericWorkflowService/GenericWorkflow?wsdl

• Supportsauthentication

• ExecuteworkflowsfromwithinKNIMEorotherapplications

• Codeexamplesavailableuponrequest

Copyright © 2015 KNIME.com AG

KNIMEServer:Webservice Interface

39

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:ListWorkflows(II)

• ViaKNIMEand KRESTnodes

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:ExecuteWorkflow(II)

• ViaKNIMEand KRESTnodes

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

Copyright © 2015 KNIME.com AG

JSON– “JSONPath”

$.['UGMsessions'].['talks'].[*].['presenter']

Copyright © 2015 KNIME.com AG

KNIME.comAGTechnoparkstr.18005ZurichSwitzerland

[email protected]