Mathematica License Server

7 views
Skip to first unread message

Cheryll Witting

unread,
Aug 4, 2024, 11:07:58 PM8/4/24
to sutenmabu
Ihave a Mathematica program that modifies images that I would like to make available for other people to use through the web. The input is only one parameter. So, for example, I could run it as a command line action which takes an argument, then returns the image which pops up as a download from the web page.

or whatever which returns a PNG. I want to know how to hook up a function like this (or another equivalent mechanism) to a web page. In one approach Mathematica itself would run as the web server; another idea would be to have the web server call Mathematica somehow (through shared memory maybe?). This would probably be running on a Linux box.


One approach might be to use CGI. The web page makes a CGI call to Mathematica, executes the function to create the file, returns the path to the file and quits. The problem with this approach is that the whole program has to load which takes a relatively long time. It would be better to have mathematica in memory and just call it like a server somehow from the web server OR have Mathematica be the web server itself.


I use a ProcessObject wrapper to python's SimpleHTTPServer. In many way it's similar to this. The code is like 25 lines long or something. The basic function is something I called PySimpleServerOpen which starts the server in a page directory and opens it. The implementation is here.


Of course, as C. E. mentions, the simple thing is to make an APIFunction. Unless you have massive traffic to it you probably won't run out of cloud credits as they seem to accumulate. I'm currently up to >4500 on one account, >5500 on another, and have a few other accounts I don't really use much. I move between these using a key-chain function I called KeyChainConnect so it's not even like having multiple accounts causes me any trouble.


If you're really worried about running out of credits, make like 6 accounts now, deploy the same APIFunction to all of them, then put an HTTPRedirect page at a consistent URI and if you run out of credits on one account, just change that page to route to a new account. It's the cheap-skates way to use the cloud.


In general, yes. Wolfram Application Server supports backward compatibility with the features of webMathematica that are compatible with the modern web. Additionally, Wolfram Language code is backward compatible.


Wolfram Application Server does not provide a user model. Endpoints are accessible by any user that has network access to the server. Individual Wolfram Language applications can easily integrate OAuth, as well as other authentication standards and security protocols.


Say, however, that I have a valid license (which I do) and that I am running some code which takes a long time to evaluate and includes multiple separate instructions being sent to the kernel (i.e. not all in a single cell evaluation). If the license server in my institute goes down will Mathematica continue to run without error as long as I keep the program open or will it immediately give an error and cease operation?


Typically, Mathematica contacts the license server every 2 minutes. If you have a license which supports a very large number of processes, that interval can grow (to help MathLM to scale better). It will never be more than 30 minutes.


If three consecutive license checks fail, then Mathematica will instead revalidate the entire license file on what would have been the fourth consecutive check. If that also fails (even if the MathLM server is down, it's potentially conceivable that there's another valid entry in the license file), then the front end will force you to either fix the licensing situation or quit Mathematica. It will allow you to save files before quitting, but it won't allow you to perform any more work.


I am trying to activate Mathematica from the command line (I am logged remotely) by connecting to a remote network license server, but no success so far. I run the command math but Mathematica keeps asking me for the activation key and password. Is it possible to choose the network license server as the way to activate Mathematica from the command line?


I've been attempting to get the below linked VSCode extension working for quite a while now. I might be doing something wrong but it seems to be configured correctly. The below picture is the 'server' listening but I cannot seem to connect to it from within a notebook in Mathematica or within VSCode.


I am running Mathematica on Windows 7, the license manager mathlm is running in a local network. How can I access Mathematica when being outside the local network. Is there some tool like license checkout for let's say two hours?


If this is not possible with Mathematica, is there some way to forward the ports for license manager via ssh and are there problems/restrictions with Windows 7? Btw, contacting the server via ssh is possible.


You question does basically not fit here, but I'm sure it is still one of the best places to ask. I think we shouldn't be too pedantic with the rules. Let me give you some advice, which will unfortunately only help you, if you can cooperate with your admin of the server:


You have to ensure, that you can reach the license server over an IP, because this is what you will write in the mathpass file. If the license-server does run in a local network and has no public IP and you want to access it from anywhere public, I think the usual way will not work.


You have to ensure, that you can reach the license-server over the port 16286! Since you can access it over ssh it seems this port is not open to the outside world. In our setting at university, the firewall has to know every pc which wants to access the license server.


I would like to use Google Maps tiles for maps inside of my Wolfram Language projects. There are currently 18 Google Maps APIs and I think I need the Static Maps API. However, this API appears to return whole maps instead of individual tiles.


Which API do I need for use as a URL tile server for the GeoServer option in the Wolfram Language Maps & Cartography functions? Also, where is there official documentation of the URL tile server in Google's documentation?


From @ChrisDegnen answer below I think the Static Map API is the only option. However. I wanted to use the map as a background to the existing Maps & Cartography functions in the Wolfram Language. Unfortunately, the Static Map API does not allow explicit specification of the lat-long boundaries so it is not a good fit.


I have Mathematica's light grid server installed on my computer, but I cannot share the computer so that it can be accessed from anywhere on the network. I tried typing localhost:3737 in my browser, but the page isn't loading.


Network access might be blocked by a software (or hardware) firewall. See if you can "ping" the server from another computer on the network and vice versa. Check your firewall rules to permit Mathematica to receive incoming connections (on both computers).Can you give any details about your network?


We have designed Wolfram Application Server for customers who for regulatory, security or business reasons may not wish to deploy onto the Wolfram Cloud but prefer to host their Wolfram Language applications on clusters they control.


Wolfram Application Server tightly focuses on stateless web applications built around functions like APIFunction, FormFunction and HTTPResponse, eschewing online notebook interactivity and user session management. (If those features are important to you, then consider Wolfram Enterprise Private Cloud.) Wolfram Application Server components are built into containers (Docker) and integrated with Kubernetes, the most popular container management system, to yield maximal flexibility for deploying into your cluster, using either your own hardware or a third-party cloud provider. This makes Wolfram Application Server an ideal platform for deploying enterprise-grade applications built with the Wolfram Language and Wolfram technologies.


To support transparent deployment of applications to Wolfram Application Server, a pair of additional services are provided: the Resource Manager and the Endpoint Manager. Any content to be accessed by an end user is deployed as a resource through the Resource Manager. The Resource Manager stores the uploaded content in persistent storage and updates any AWES instances with information about the resource, which can be fetched as needed in response to user requests.


The Endpoint Manager creates, modifies and deletes endpoints. By decoupling the resource from the user endpoint, Wolfram Application Server developers gain additional flexibility in presenting content to users. For example, using endpoints makes it easy to maintain and switch between versions of an application for A/B testing or to quickly undo an update if a bug should appear.


Wolfram Application Server also offers a service to deploy files directly to the local file system of all the servers in the cluster: the Node Files Manager. Typically, these node files are configuration files and packages for the Wolfram Engine to support deployed resources. The Wolfram Engine accesses the local file system to read these types of files, so they must exist there, unlike resource files that may or may not be cached locally. Other types of files typically distributed as node files can include compiled executables and libraries that may be called or loaded by the Wolfram Engine. Node files are not end-user accessible and cannot be referred to by an endpoint. They are intended for internal use only by the Wolfram Engine.


Finally, a pair of supporting services are provided and used by Wolfram Application Server but not directly accessed by public APIs. The Storage Service and the Streaming Service provide necessary support for applications behind the scenes.


The Streaming Service enables communications between the various instances of services in the cluster and is necessary for keeping existing instances in sync with the state of the cluster (e.g. existing resources and endpoints) and for provisioning new instances when they come up (e.g. when a new AWES is added to handle excess load).

3a8082e126
Reply all
Reply to author
Forward
0 new messages