Introducing Wolfram Web Engine

Carlo Barbieri, ECE

(RowDefault[, (Spacer1), , (Spacer1), ])  #SocialMediaAreBadForYou

ABSTRACT

Wolfram Web Engine is a new solution for serving your Wolfram-Language-based web applications. It is lean and mean and you can configure it any way you want.  It supports modern WL web deployments like APIFunction and FormFunction, and is also backwards compatible with JSP-based technology. You can run it directly on your own server, or deploy it in a Docker container.

When you want give the power of the Wolfram Language to the world, this is your gateway.

Outline

What it isn’t

What it is

Architecture

ServiceDeploy

Bare metal

Docker

Remote server

Q&A

What it isn’t

Doesn’t support gratuitous violence

Doesn’t have a handlebar moustache

What it is

Standards-based web server

Runs everywhere the Wolfram Language does

Supports modern and legacy deployments

Architecture

Based on the Java Servlet interface

Fully modular and configurable

No users out of the box

No limitations on Wolfram Language functionality

No cloud notebooks

Can be installed on the same machine as other web services

ServiceDeploy

Revamped ServiceDeploy

so=ServiceConnect["WolframWebEngine", "http://localhost:8080"]

Supports automatic naming of resources

ServiceDeploy[so, Delayed[Now]]

…or named ones

ServiceDeploy[so, FormFunction["city"-> "City", GeoGraphics[GeoMarker[#city]]&], "citymap"]

…static resources

ServiceDeploy[so, RandomImage[], "random.png"]

…files

ServiceDeploy[so, File[Export["selfie.jpg",CurrentImage[]]], "selfie.jpg"]

and URLDispatcher!

ServiceDeploy[so, vatican, "/"]

Bare metal

Wolfram Web Engine can run directly on a server (or your local machine)

SystemOpen["/opt/homebrew/opt/tomcat@9/libexec/webapps/ROOT"]

Files on disk are hot reloaded and can be deployed using any tool that works with files (rsync, git, …)

Hybrid workflows: ServiceDeploy + rsync/git

Docker

Simple container based on the wolframengine one

ExternalEvaluate["Shell","/usr/local/bin/./docker run -p 8000:8000 -p 8081:8080  -v /Users/ka/git/webMathematica/Licensing/:/home/wolframengine/.WolframEngine/Licensing -v /Users/ka/Documents/active/:/opt/tomcat/webapps/ROOT/active -e JPDA_ADDRESS=\"*:8000\" -td wwe"]

so1=ServiceConnect["WolframWebEngine", "http://localhost:8081"]

ServiceDeploy[so1, Delayed[Now], "active/date"]

SystemOpen["/Users/ka/Documents/active"]

Docker volumes allow you to work with files as if this was a bare metal deployment

FormFunction["x" -> "String"]>>"Documents/active/date/index.wl"

Remote server

so2 = ServiceConnect["WolframWebEngine","http://10.10.154.170:8080"]

dep =ServiceDeploy[so2, APIFunction["x" -> "Integer", #x!&], "factorial"]

Stress testing!

URLRead[Table[URLBuild[dep["Service"],{"x" -> 24}],16], "Body"]//AbsoluteTiming