Stack server process.conf setup help please

Stack server process.conf setup help please

by Brian Merritt -
Number of replies: 13
Picture of Particularly helpful Moodlers

The process.conf file (to date) is below.  Maxima is not yet optimized.  What please should the command line and process started elements be?

-----------------------------------------------------------------------------------------------

### Config for this Maxima process


# As a sanity check, this must match the name of the containing folder, but not the full path.

# Typically this is the name of the version number of the current STACK, e.g. 20160922001

name = 2018080600


# Whether processes of this type should be automatically made available when

# the server starts.

auto.start = true


### Maxima related commands and parameters


# Working directory for the process

working.directory = /tmp


# Command-line to launch the optimised Maxima process.

# This information is given at the end of the STACK healthcheck script.  It will need to be updated

# to reflect the move of the optimised image to /var/lib/maxima/%%VERSION%%/

#

# Do not include the "timeout" command.  The servlet deals with timeouts itself.

#

# This will depend on your maxima (and lisp) setup.  E.g.

# /usr/lib/clisp-2.49/base/lisp.run -q -M /var/lib/maximapool/%%VERSION%%/maxima_opt_auto.mem

# /var/lib/maximapool/%%VERSION%%/maxima-optimised

command.line = maxima


# Input the load command after this, if defined.

process.started = Maxima restarted.


# A file to load to maxima using load(""); set to false or empty if not needed

extra.file = /shared/maximapool/2018080600/maximalocal.mac


# The process has loaded when this appears.

process.ready = "/shared/maximapool/2018080600/maximalocal.mac"



# Environment variables may be set like this, in most cases you should not need to set them:

# env.LANG = C

# env.TERM = xterm


### File handling related parameters

# these make the difference between shared filesystem installations and truly

# separate servers


# Do we handle files?

file.handling = true


# The command template to pass the current working and output directories to the process, use placeholders to mark the paths, depending on your system we may escape \-chars in the path.

# Usable placeholders:

#  %WORK-DIR% the directory that won't be transferred to the client side

#  %WORK-DIR-NE% use this if you do not want \-chars escaped

#  %OUTPUT-DIR% the directory that will be transferred to the client side

#  %OUTPUT-DIR-NE% use this if you do not want \-chars escaped

path.command = maxima_tempdir: "%WORK-DIR%/"$ IMAGE_DIR: "%OUTPUT-DIR%/"$ URL_BASE: "%PLOT-URL-BASE%"$



### Maximum lifetimes.


# This is the time that a process is allowed to take when starting up (ms).

startup.timeout = 10000


# This is the time added to the lifetime of a process when it is taken to use

# so that it wont be killed while in use (ms).

execution.timeout = 30000


# This is the lifetime given to a process (ms).

maximum.lifetime = 600000



### Estimates used to start the pool size planning.


# Estimated time to start a process of this type (ms).

startup.time.estimate = 2000


# Estimated demand for these processes (number per second).

demand.estimate = 0.1

Average of ratings: -
In reply to Brian Merritt

Re: Stack server process.conf setup help please

by Brian Merritt -
Picture of Particularly helpful Moodlers

I also have a feeling the WORK-DIR seciton needs something  

In reply to Brian Merritt

Re: Stack server process.conf setup help please

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You need to log in to the server and work out the commands to run to start maxima and load the STACK libraries. (These should be in the STACK documents.)

I have to say, if you are doing that, why not just work out the commands to generate maxima-optimised? (https://github.com/maths/moodle-qtype_stack/blob/master/doc/en/CAS/Optimising_Maxima.md)

Getting all this working the first time is a real pain. The good news is, once you have got it working, it seems to keep working just fine.

In reply to Tim Hunt

Re: Stack server process.conf setup help please

by Brian Merritt -
Picture of Particularly helpful Moodlers

Thanks Tim 

I've followed the instructions but simply do not know what else is needed.

I'm hoping someone can post a working process.conf for a maximapool server.

In reply to Brian Merritt

Re: Stack server process.conf setup help please

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Does MaximaPool servlet start up?

If not, what is the error message?

If it does, what appears on the status page? Are any pools listed? If so, what happens when you click on the 'Low-level health-check' link?


In reply to Tim Hunt

Re: Stack server process.conf setup help please

by Brian Merritt -
Picture of Particularly helpful Moodlers

Hi Tim - I get a pool


System performance

NameValue
Servlet started:2019-05-09 11:48:53
Up time:
Active threads:34
Java free memory:107.1 MB out of 149.0 MB total memory (3.5 GB max limit)
System load:1.59 over 4 processors

Overall pool performance

NameValue
Processes starting up:0
Processes in use:0
Total number of processes started:0

Running versions

Pool performance - 2018080600

NameValue
Ready processes in the pool:0
Total processes started:0
Current demand estimate:0.001 Hz
Current start-up time estimate:2000 ms
Recent start-up times:2000 ms
Recent request times:11:48:53

Run the high-level health-check

Run the low-level health-check

Password

Pool configuration - 2018080600

NameValue
Maxima command-line:maxima
File to load:/shared/maximapool/2018080600/maximalocal.mac
Started test string:Maxima restarted.
Loaded test string:"/shared/maximapool/2018080600/maximalocal.mac"
File handling:On
File paths template:maxima_tempdir: "%WORK-DIR%/"$ IMAGE_DIR: "%OUTPUT-DIR%/"$ URL_BASE: "%PLOT-URL-BASE%"$
Startup time limit:10000 ms
Execution extra time limit:30000 ms
Process life time limit:600000 ms
Initial estimate for the process startup time:2000 ms
Initial estimate for demand:0.1 Hz

In reply to Tim Hunt

Re: Stack server process.conf setup help please

by Brian Merritt -
Picture of Particularly helpful Moodlers

Low level test gives:

Executing command-line: maxima

Waiting for target text: 'Maxima restarted.'

WARNING:
Couldn't re-execute SBCL with proper personality flags (/proc isn't mounted? setuid?)
Trying to continue anyway.
WARNING: Maxima is unable to set up the help system.
(Details: CL-INFO::LOAD-PRIMARY-INDEX: Couldn't load
                                       "/usr/share/info/./maxima-index.lisp":
                                       file does not exist.)

Maxima 5.41.0 http://maxima.sourceforge.net
using Lisp SBCL 1.4.0-0.1.el7.bootstrap
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) 

Average of ratings: Useful (1)
In reply to Brian Merritt

Re: Stack server process.conf setup help please

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Well, "Maxima restarted." is what maxima-optmiised outputs when it starts up. As you can see, maxima outputs something else. Try changing the setting

process.started = Maxima restarted.

to

process.started = (%i1)

(hopefully that does not need to be escaped.)

In reply to Tim Hunt

Re: Stack server process.conf setup help please

by Brian Merritt -
Picture of Particularly helpful Moodlers

Thanks yet again Tim!

I got fairly far but missed that bit, plus the maxima permissions on the docker container were owned by root so changed those to tomcat:tomcat

Onwards - hope to share the final docker environ on unikent github.

In reply to Tim Hunt

Re: Stack server process.conf setup help please

by Brian Merritt -
Picture of Particularly helpful Moodlers

So now the Moodle server is failing the CAS portion of the healthtest.  Do I need to change the stackmaxima.mac ending 

stackmaximaversion:2018080600$
To a different value for 5.41.0 ??  Or is it something else?

Settings below:

----------------------------------------------------------------------------------------------


Platform typeqtype_stack | platform
             Linux             Linux (optimised)             Windows             Server     

STACK needs to know what sort of operating system it is running on. The Server option give better performance at the cost of having to set up an additional server. The option "Linux (optimised)" is explained on the Optimising Maxima page in the documentation.

Maxima versionqtype_stack | maximaversion
             5.23.2             5.25.1             5.26.0             5.27.0             5.28.0             5.30.0             5.31.1             5.31.2             5.31.3             5.32.0             5.32.1             5.33.0             5.34.0             5.34.1             5.35.1             3.35.1.2             5.36.0             5.36.1             5.37.3             5.38.0             5.38.1             5.39.0             5.40.0             5.41.0             5.42.0             5.42.1             5.42.2             default     

The version of Maxima being used.

CAS connection timeoutqtype_stack | castimeout
 
Default: 10

The timout to use when trying to connect to Maxima.

CAS result cachingqtype_stack | casresultscache
             Do not cache             Cache in the database      
Default: Cache in the database

This setting determines whether calls the to CAS are cached. This setting should be turned on unless you are doing development that involves changing the Maxima code. The current state of the cache is shown on the healthcheck page. If you change your settings, e.g. the gnuplot command, you will need to clear the cache before you can see the effects of these changes.

Maxima commandqtype_stack | maximacommand

For Platform type: Server, this is must be set to the URL of the Maxima Pool servlet. For other platform types, if this is blank, STACK will make an educated guess as to where to find Maxima. If that fails, this should be set to the full path of the maxima or maxima-optimised executable. Consider using the timeout command on unix based systems. E.g. timeout --kill-after=10s 10s maxima

Server username:passwordqtype_stack | serveruserpass
 
Default: Empty

If you are using Platform type: Server, and if you have set up your Maxima pool server with HTTP authentication, then you can put the username and password here. That is slighly safer than putting them in the URL. The format is username:password.

Plot commandqtype_stack | plotcommand
 
Default: Empty

Normally this can be left blank, but if graph plotting is not working, you may need to supply the full path to the gnuplot command here.

Load optional Maxima libraries:qtype_stack | maximalibraries

This is a comma separated list of Maxima library names which will be automatically loaded into Maxima. Only supported library names can be used: "stats, distrib, descriptive, simplex". These libraries will not be loaded if you have saved a maxima image to optimise performance.

CAS debuggingqtype_stack | casdebugging
 
Default: No

Whether to store debugging information about the CAS connection.




In reply to Tim Hunt

Re: Stack server process.conf setup help please

by Brian Merritt -
Picture of Particularly helpful Moodlers

Final hurdle was related to docker!  

In a docker container, the hostname was maxima, not maxima-dev.kent.ac.uk.

Thanks again for your help Tim. 


Sorry for being a pain!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!>>>>>>>>>>>>>>>>>>>>>>>>>!!!!

In reply to Brian Merritt

Re: Stack server process.conf setup help please

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Well done for getting that worked out.

Based on what you have learned, can you suggest any improvements to the docs at https://github.com/maths/stack_util_maximapool/tree/multiple-pools/doc? Pull requests welcome, or send them through any way you can.

In reply to Tim Hunt

Re: Stack server process.conf setup help please

by Brian Merritt -
Picture of Particularly helpful Moodlers

That seems v.reasonable :D  Will have a go next week