Skip to content
Snippets Groups Projects
Commit 056babd3 authored by martin heide's avatar martin heide
Browse files

base and webservice images separated

parent 7e9d29dd
No related branches found
No related tags found
No related merge requests found
[submodule "assStackQuestion"]
path = maxima_baseimage/assStackQuestion
path = maxima_webservice/assStackQuestion
url = https://github.com/ilifau/assStackQuestion.git
branch = master-ilias53
[submodule "maximapool-docker"]
path = maxima_baseimage/maximapool-docker
url = https://github.com/uni-halle/maximapool-docker.git
branch = stack-2017121800
[submodule "goe_web"]
path = goe_web
url = https://gitlab.gwdg.de/martin.heide/goe_web.git
......
FROM debian
FROM debian:stable
ENV MAXIMAPOOL=/opt/maximapool \
STACK_MAXIMA=/opt/maxima \
MAXIMA_LOCAL_PATH=assStackQuestion/classes/stack/maxima \
MAXIMA_VERSION=5.41.0 \
SBCL_VERSION=1.4.11
ARG MAXIMA_VERSION=5.41.0
ARG SBCL_VERSION=1.4.11
ENV SRC=/opt/src
RUN SBCL_ARCH=$(dpkg --print-architecture); if [ $SBCL_ARCH = amd64 ]; then SBCL_ARCH=x86-64; fi; echo $SBCL_ARCH > /SBCL_ARCH
......@@ -15,18 +14,16 @@ RUN apt-get update \
make \
wget \
python3 \
gnuplot \
gettext-base \
ca-certificates \
curl \
# ca-certificates \
# curl \
texinfo
RUN mkdir -p ${MAXIMAPOOL}
RUN wget https://sourceforge.net/projects/maxima/files/Maxima-source/${MAXIMA_VERSION}-source/maxima-${MAXIMA_VERSION}.tar.gz -O ${MAXIMAPOOL}/maxima-${MAXIMA_VERSION}.tar.gz
RUN wget https://sourceforge.net/projects/sbcl/files/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-$(cat /SBCL_ARCH)-linux-binary.tar.bz2 -O ${MAXIMAPOOL}/sbcl-${SBCL_VERSION}-$(cat /SBCL_ARCH)-linux.tar.bz2
RUN mkdir -p ${SRC}
RUN wget https://sourceforge.net/projects/maxima/files/Maxima-source/${MAXIMA_VERSION}-source/maxima-${MAXIMA_VERSION}.tar.gz -O ${SRC}/maxima-${MAXIMA_VERSION}.tar.gz
RUN wget https://sourceforge.net/projects/sbcl/files/sbcl/${SBCL_VERSION}/sbcl-${SBCL_VERSION}-$(cat /SBCL_ARCH)-linux-binary.tar.bz2 -O ${SRC}/sbcl-${SBCL_VERSION}-$(cat /SBCL_ARCH)-linux.tar.bz2
# Compile sbcl
RUN cd ${MAXIMAPOOL} \
RUN cd ${SRC} \
&& bzip2 -d sbcl-${SBCL_VERSION}-$(cat /SBCL_ARCH)-linux.tar.bz2 \
&& tar -xf sbcl-${SBCL_VERSION}-$(cat /SBCL_ARCH)-linux.tar \
&& rm sbcl-${SBCL_VERSION}-$(cat /SBCL_ARCH)-linux.tar \
......@@ -35,7 +32,7 @@ RUN cd ${MAXIMAPOOL} \
&& ./install.sh
# Compile maxima
RUN cd ${MAXIMAPOOL} \
RUN cd ${SRC} \
&& tar -xf maxima-${MAXIMA_VERSION}.tar.gz \
&& rm maxima-${MAXIMA_VERSION}.tar.gz \
&& cd maxima-${MAXIMA_VERSION} \
......@@ -44,23 +41,5 @@ RUN cd ${MAXIMAPOOL} \
&& make install \
&& make clean
# deinstallieren: wget, curl, python3, make, bzip2,
COPY ${MAXIMA_LOCAL_PATH} ${STACK_MAXIMA}
COPY maximapool-docker/assets/process.conf.template maximapool-docker/assets/optimize.mac maximapool-docker/assets/maximalocal.mac.template ${MAXIMAPOOL}/
RUN VER=$(grep stackmaximaversion ${STACK_MAXIMA}/stackmaxima.mac | grep -oP "\d+") \
&& mkdir -p ${MAXIMAPOOL}/${VER} \
&& mv ${STACK_MAXIMA} ${MAXIMAPOOL}/${VER}/maxima \
&& mkdir -p ${MAXIMAPOOL}/${VER}/tmp/plots/ \
&& mkdir -p ${MAXIMAPOOL}/${VER}/tmp/logs/ \
&& cd ${MAXIMAPOOL}/ \
&& echo "Configuring Maxima for STACK" \
&& VER=$VER sh -c 'envsubst < process.conf.template > ${VER}/process.conf \
&& envsubst < maximalocal.mac.template > ${VER}/maximalocal.mac \
&& echo "Successfully configured Maxima for STACK ${VER}" \
&& echo "Optimizing Maxima (There will be some warnings due to docker container restrictions and strictness of sbcl) ..." \
&& mv ${MAXIMAPOOL}/optimize.mac ${MAXIMAPOOL}/${VER} \
&& cd ${MAXIMAPOOL}/${VER} \
&& maxima -b optimize.mac \
&& echo "Successfully optimized Maxima."'
RUN rm -r ${SRC} /SBCL_ARCH
RUN apt-get purge -y wget python3 make bzip2 texinfo
assstackquestion 12439ff
stack_util_maximapool 8cfdfee
maximapool-docker febb5c3
Subproject commit febb5c3a0a794de48b7f7d0047674209134e5b9c
ARG BASEIMAGE=maxima_base:latest
FROM $BASEIMAGE
COPY ./bin/web /goweb
ENV LIB=/opt/maxima/lib \
LOG=/opt/maxima/log \
TMP=/opt/maxima/tmp \
PLOT=/opt/maxima/plot \
ASSETS=/opt/maxima/assets \
BIN=/opt/maxima/bin
RUN apt-get update \
&& apt-get install -y \
gnuplot \
gettext-base
# specify here which stack or moodle to use:
ARG LIB_PATH=assStackQuestion/classes/stack/maxima
RUN mkdir -p ${LIB} ${LOG} ${TMP} ${PLOT} ${ASSETS} ${BIN}
# Copy Libraries
COPY ${LIB_PATH} ${LIB}
# Copy optimization scripts
COPY assets/optimize.mac.template assets/maximalocal.mac.template ${ASSETS}/
RUN grep stackmaximaversion ${LIB}/stackmaxima.mac | grep -oP "\d+" >> /opt/maxima/stackmaximaversion \
&& sh -c 'envsubst < ${ASSETS}/maximalocal.mac.template > ${ASSETS}/maximalocal.mac \
&& envsubst < ${ASSETS}/optimize.mac.template > ${ASSETS}/optimize.mac ' \
&& cat ${ASSETS}/maximalocal.mac && cat ${ASSETS}/optimize.mac \
&& cd ${ASSETS} \
&& maxima -b optimize.mac \
&& mv maxima-optimised ${BIN}/maxima-optimised \
&& rm -r ${ASSETS} ${LIB}
CMD ["/goweb"]
# Add go webserver
COPY ./bin/web ${BIN}/goweb
CMD ["/opt/maxima/bin/goweb"]
File moved
/* ***********************************************************************/
/* This file is automatically generated at installation time. */
/* The purpose is to transfer configuration settings to Maxima. */
/* Hence, you should not edit this file. Edit your configuration. */
/* This file is regularly overwritten, so your changes will be lost. */
/* ***********************************************************************/
/* File generated on June 29, 2018, 4:00 pm */
/* Add the location to Maxima's search path */
file_search_maxima:append( [sconcat("${LIB}/###.{mac,mc}")] , file_search_maxima)$
file_search_lisp:append( [sconcat("${LIB}/###.{lisp}")] , file_search_lisp)$
file_search_maxima:append( [sconcat("${LOG}/###.{mac,mc}")] , file_search_maxima)$
file_search_lisp:append( [sconcat("${LOG}/###.{lisp}")] , file_search_lisp)$
STACK_SETUP(ex):=block(
MAXIMA_VERSION_NUM_EXPECTED:41,
MAXIMA_PLATFORM:"server",
maxima_tempdir:"${TMP}/",
IMAGE_DIR:"${PLOT}/",
PLOT_SIZE:[450,300],
PLOT_TERMINAL:"svg",
PLOT_TERM_OPT:"dynamic font \",11\" linewidth 1.2",
DEL_CMD:"rm",
GNUPLOT_CMD:"gnuplot",
MAXIMA_VERSION_EXPECTED:"5.41.0",
URL_BASE:"!ploturl!",
/* Define units available in STACK. */
stack_unit_si_prefix_code:[y, z, a, f, p, n, u, m, c, d, da, h, k, M, G, T, P, E, Z, Y],
stack_unit_si_prefix_multiplier:[10^-24, 10^-21, 10^-18, 10^-15, 10^-12, 10^-9, 10^-6, 10^-3, 10^-2, 10^-1, 10, 10^2, 10^3, 10^6, 10^9, 10^12, 10^15, 10^18, 10^21, 10^24],
stack_unit_si_prefix_tex:["\\mathrm{y}", "\\mathrm{z}", "\\mathrm{a}", "\\mathrm{f}", "\\mathrm{p}", "\\mathrm{n}", "\\mu ", "\\mathrm{m}", "\\mathrm{c}", "\\mathrm{d}", "\\mathrm{da}", "\\mathrm{h}", "\\mathrm{k}", "\\mathrm{M}", "\\mathrm{G}", "\\mathrm{T}", "\\mathrm{P}", "\\mathrm{E}", "\\mathrm{Z}", "\\mathrm{Y}"],
stack_unit_si_unit_code:[m, l, L, g, s, h, Hz, Bq, cd, N, Pa, cal, Cal, Btu, eV, J, W, A, ohm, C, V, F, S, Wb, T, H, Gy, rem, Sv, lx, mol, M, kat, rad],
stack_unit_si_unit_conversions:[m, m^3/1000, m^3/1000, kg/1000, s, s*3600, 1/s, 1/s, cd, (kg*m)/s^2, kg/(m*s^2), 4.2*J, 4200*J, 1055*J, 1.602177e-19*J, (kg*m^2)/s^2, (kg*m^2)/s^3, A, (kg*m^2)/(s^3*A^2), s*A, (kg*m^2)/(s^3*A), (s^4*A^2)/(kg*m^2), (s^3*A^2)/(kg*m^2), (kg*m^2)/(s^2*A), kg/(s^2*A), (kg*m^2)/(s^2*A^2), m^2/s^2, 0.01*Sv, m^2/s^2, cd/m^2, mol, mol/(m^3/1000), mol/s, rad],
stack_unit_si_unit_tex:["\\mathrm{m}", "\\mathrm{l}", "\\mathrm{L}", "\\mathrm{g}", "\\mathrm{s}", "\\mathrm{h}", "\\mathrm{Hz}", "\\mathrm{Bq}", "\\mathrm{cd}", "\\mathrm{N}", "\\mathrm{Pa}", "\\mathrm{cal}", "\\mathrm{cal}", "\\mathrm{Btu}", "\\mathrm{eV}", "\\mathrm{J}", "\\mathrm{W}", "\\mathrm{A}", "\\Omega", "\\mathrm{C}", "\\mathrm{V}", "\\mathrm{F}", "\\mathrm{S}", "\\mathrm{Wb}", "\\mathrm{T}", "\\mathrm{H}", "\\mathrm{Gy}", "\\mathrm{rem}", "\\mathrm{Sv}", "\\mathrm{lx}", "\\mathrm{mol}", "\\mathrm{M}", "\\mathrm{kat}", "\\mathrm{rad}"],
stack_unit_other_unit_code:[min, amu, u, mmHg, bar, cc, gal, mbar, atm, torr, rev, deg, rpm, K, day, year, in, ft, mi],
stack_unit_other_unit_conversions:[s*60, amu, amu, 133.322387415*Pa, 10^5*Pa, m^3*10^(-6), 3.785*l, 10^2*Pa, 101325*Pa, 101325/760*Pa, 2*pi*rad, pi*rad/180, pi*rad/(30*s), K, 86400*s, 3.156e7*s, in, 12*in, 5280*12*in],
stack_unit_other_unit_tex:["\\mathrm{min}", "\\mathrm{amu}", "\\mathrm{u}", "\\mathrm{mmHg}", "\\mathrm{bar}", "\\mathrm{cc}", "\\mathrm{gal}", "\\mathrm{mbar}", "\\mathrm{atm}", "\\mathrm{torr}", "\\mathrm{rev}", "\\mathrm{{}^{o}}", "\\mathrm{rpm}", "\\mathrm{K}", "\\mathrm{day}", "\\mathrm{year}", "\\mathrm{in}", "\\mathrm{ft}", "\\mathrm{mi}"],
true)$
/* Load the main libraries */
/* load("stackmaxima.mac")$ */
/* Lisp is able to save a snapshot of its current state to a file.
Credit goes to:
https://github.com/maths/moodle-qtype_stack/blob/master/doc/en/CAS/Optimising_Maxima.md */
load("${ASSETS}/maximalocal.mac");
load("${LIB}/stackmaxima.mac");
load(stats);
load(distrib);
load(descriptive);
:lisp (sb-ext:save-lisp-and-die "maxima-optimised" :toplevel #'run :executable t)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment