diff --git a/.gitignore b/.gitignore index fa44107a84bf70c33fe4d1b2a32b5a79ef8b5fba..1b2f1904ca46f9a58ef9880feadac846dd3d4646 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ tags [._]*.un~ bin +src/web/web diff --git a/Dockerfile b/Dockerfile index 8a1d927bfe29e761ffc0bad96b865988120f9b12..4e02f162c990adc7c5f420f85ad070b7311f663d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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, diff --git a/README.md b/README.md index e555132ce93162a860008404867643128c8e108e..2deef32e5a3509a72949cb789c7e6e61fca9c56b 100644 --- a/README.md +++ b/README.md @@ -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 ======= diff --git a/src/maxima_fork.c b/src/maxima_fork.c index 6c4dd216ce5cd331af46c9887239007a281e26dc..c32298be1a93080832710204b9508c1be553eac4 100644 --- a/src/maxima_fork.c +++ b/src/maxima_fork.c @@ -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]; diff --git a/src/web/web.go b/src/web/web.go index 75f34eab24e602951f6860e4c2b83adf6f7c7286..6402eebb27eb040e1564348535c698d0da508576 100644 --- a/src/web/web.go +++ b/src/web/web.go @@ -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)