Skip to content
Snippets Groups Projects
Commit 6077c3c2 authored by lennart's avatar lennart
Browse files

adjust maximal number of threads 32

also add /goemaxima to paths
parent b5ca4b0e
No related branches found
No related tags found
No related merge requests found
......@@ -19,3 +19,4 @@ tags
[._]*.un~
bin
src/web/web
......@@ -2,7 +2,7 @@ FROM debian:stable
# e.g. 5.41.0
ARG MAXIMA_VERSION
# e.g. 2.0.22.0.2
# e.g. 2.0.2
ARG SBCL_VERSION
ENV SRC=/opt/src \
......@@ -35,7 +35,7 @@ RUN grep stackmaximaversion ${LIB}/stackmaxima.mac | grep -oP "\d+" >> /opt/maxi
&& cd ${ASSETS} \
&& maxima -b optimize.mac \
&& mv maxima-optimised ${BIN}/maxima-optimised \
&& for i in $(seq 16); do \
&& for i in $(seq 32); do \
useradd -M "maxima-$i"; \
done
......@@ -45,7 +45,7 @@ COPY ./bin/web ${BIN}/goweb
ENV GOEMAXIMA_LIB_PATH=/opt/maxima/assets/maximalocal.mac
ENV LANG C.UTF-8
EXPOSE 80
EXPOSE 8080
# rm /dev/tty because we do not want it to be opened by maxima for security reasons,
# and clear tmp because when kubernetes restarts a pod, it keeps the /tmp content even if it's tmpfs,
......
......@@ -23,6 +23,12 @@ $ ./buildimage.sh 2020061000
The image should then be available as `goemaxima:2020061000-dev`.
Using the Docker Image
======================
The prebuilt docker images are available from the docker hub at `mathinstitut/goemaxima:[version]-latest`.
The port of the server in the container is `8080` and the path that has to be input into stack is `http://[address:port]/goemaxima`.
License
=======
......
......@@ -14,7 +14,9 @@
#include <bsd/unistd.h>
#include <limits.h>
#include <grp.h>
#define N_SLOT 16
#ifndef N_SLOT
#define N_SLOT 32
#endif
#define RNOFILE 256
#define FILEPATH_LEN (PATH_MAX + 1)
char filepath[FILEPATH_LEN];
......
......@@ -463,7 +463,7 @@ func main() {
log.Fatal("Fatal: wrong cli-argument usage: web [path to maxima executable]")
}
// number of maxima users
user_number, err := get_env_number_positive("GOEMAXIMA_NUSER", 16)
user_number, err := get_env_number_positive("GOEMAXIMA_NUSER", 32)
if err != nil {
log.Fatal("Fatal: GOEMAXIMA_NUSER contains invalid number");
}
......@@ -522,10 +522,13 @@ func main() {
go generate_maximas(os.Args[1], os.Getenv("GOEMAXIMA_LIB_PATH"), queue, user_queue, &metrics)
http.Handle("/metrics", promhttp.Handler())
http.HandleFunc("/maxima/",
func (w http.ResponseWriter, r *http.Request) {
handler := func (w http.ResponseWriter, r *http.Request) {
handler(w, r, queue, user_queue, &metrics)
})
}
http.HandleFunc("/maxima", handler)
http.HandleFunc("/maxima/", handler)
http.HandleFunc("/goemaxima", handler)
http.HandleFunc("/goemaxima/", handler)
log.Print("Info: goe handler started")
err = http.ListenAndServe(":8080", nil)
log.Printf("Fatal: http handler closed unexpectedly, %s", err)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment