Skip to content

Commit f48b368

Browse files
committed
Update scripts and dockerfile
scripts now provide help and show their version. They also show useful environment variables set Dockerfile has been update to use a newer Asymptote which is needed in generating the reference PDFs mathics.sqlite adds sections from Mark S Gockenbach's Tutorial for Partial Differential Equations: Analytical and Numerical Methods
1 parent 1061f5f commit f48b368

13 files changed

+134
-23
lines changed

docker/Dockerfile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN apt-get install -qq apt-utils
2222
# npm pulls in nodejs, but we'll be explicit.
2323

2424
# Install lots of packages
25-
RUN DEBIAN_FRONTEND="noninteractive" TZ="US/Eastern" apt-get install -qq liblapack-dev llvm-12 llvm-12-dev gfortran maria libmysqlclient-dev sqlite3 python3-pip python3-setuptools git python3-numpy python3-matplotlib python-matplotlib-data x11-apps asymptote w3m latexmk texlive-xetex lmodern texlive-latex-extra texlive-fonts-recommended nodejs npm xserver-xorg-video-all libgl1-mesa-glx libgl1-mesa-dri mesa-utils evince
25+
RUN DEBIAN_FRONTEND="noninteractive" TZ="US/Eastern" apt-get install -qq liblapack-dev llvm-12 llvm-12-dev gfortran maria libmysqlclient-dev sqlite3 python3-pip python3-setuptools git python3-numpy python3-matplotlib python-matplotlib-data x11-apps latexmk texlive-xetex lmodern texlive-latex-extra texlive-fonts-recommended nodejs npm xserver-xorg-video-all libgl1-mesa-glx libgl1-mesa-dri mesa-utils evince
2626

2727
RUN pip install --no-cache-dir -r requirements.txt
2828
COPY requirements-mathicsscript.txt ./
@@ -32,15 +32,19 @@ RUN pip install --no-cache-dir -r requirements-mathicsscript.txt
3232
# Mathics core #
3333
################
3434
RUN pip install "Mathics3[full]>=4.0.0"
35+
# RUN pip install git+git://github.com/mathics/Mathics.git#egg=Mathics3[full]
3536

36-
# We need newer versions of Asymptote and GhostScript for bulding the PDF
37-
COPY ubuntu-bin/gs /usr/local/bin/
38-
39-
# We would need to copy over a *full asy distribution*
40-
# COPY ubuntu-bin/asy /usr/local/bin/
37+
# RUN DEBIAN_FRONTEND="noninteractive" TZ="US/Eastern" apt-get install -qq librsvg2-bin python3-cson python3-pyqt5 python3-pyqt5.qtsvg
4138

42-
# For now, until we package TeX sources skip building PDF and just copy it
43-
# to the place entrypoint.sh expects it.
39+
# We need newer versions of Asymptote and GhostScript for bulding the PDF
40+
# COPY ubuntu-dpkg/*.deb /tmp/
41+
# RUN dpkg --install /tmp/libgc1_8.0.4-3_amd64.deb /tmp/libgsl25_2.6+dfsg-2_amd64.deb /tmp/libgslcblas0_2.6+dfsg-2_amd64.deb
42+
# RUN DEBIAN_FRONTEND="noninteractive" TZ="US/Eastern" apt-get install -qq freeglut3 libfftw3-double3 libglew2.1 libsigsegv2 ghostscript imagemagick texlive-pstricks
43+
# RUN dpkg --install /tmp/asymptote_2.70+ds-2_amd64.deb
44+
# COPY ubuntu-bin/gs /usr/local/bin/
45+
46+
# Skip building PDF and just copy it to the place entrypoint.sh
47+
# expects it.
4448
COPY tex-images/mathics.pdf /usr/src/app/data/mathics.pdf
4549

4650
#####################
@@ -63,8 +67,6 @@ RUN ${PYTHON} -m nltk.downloader wordnet omw
6367
RUN ${PYTHON} -m pip install 'ipython<8.0,>=7.23.1'
6468
RUN ${PYTHON} -m pip install mathicsscript[full]
6569

66-
RUN ${PYTHON} -m nltk.downloader wordnet omw
67-
RUN ${PYTHON} -m spacy download en
6870

6971
##################
7072
# Mathics Django #

docker/Dockerfile-dev

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN apt-get install -qq apt-utils
2222
# npm pulls in nodejs, but we'll be explicit.
2323

2424
# Install lots of packages
25-
RUN DEBIAN_FRONTEND="noninteractive" TZ="US/Eastern" apt-get install -qq liblapack-dev llvm-12 llvm-12-dev gfortran maria libmysqlclient-dev sqlite3 python3-pip python3-setuptools git python3-numpy python3-matplotlib python-matplotlib-data x11-apps asymptote w3m latexmk texlive-xetex lmodern texlive-latex-extra texlive-fonts-recommended nodejs npm xserver-xorg-video-all libgl1-mesa-glx libgl1-mesa-dri mesa-utils evince
25+
RUN DEBIAN_FRONTEND="noninteractive" TZ="US/Eastern" apt-get install -qq liblapack-dev llvm-12 llvm-12-dev gfortran maria libmysqlclient-dev sqlite3 python3-pip python3-setuptools git python3-numpy python3-matplotlib python-matplotlib-data x11-apps latexmk texlive-xetex lmodern texlive-latex-extra texlive-fonts-recommended nodejs npm xserver-xorg-video-all libgl1-mesa-glx libgl1-mesa-dri mesa-utils evince
2626

2727
RUN pip install --no-cache-dir -r requirements.txt
2828
COPY requirements-mathicsscript.txt ./
@@ -34,7 +34,20 @@ RUN pip install --no-cache-dir -r requirements-mathicsscript.txt
3434
# RUN pip install "Mathics3[full]>=4.0.0"
3535
RUN pip install git+git://github.com/mathics/Mathics.git#egg=Mathics3[full]
3636

37+
RUN DEBIAN_FRONTEND="noninteractive" TZ="US/Eastern" apt-get install -qq librsvg2-bin python3-cson python3-pyqt5 python3-pyqt5.qtsvg
38+
39+
# We need newer versions of Asymptote and GhostScript for bulding the PDF
40+
COPY ubuntu-dpkg/*.deb /tmp/
41+
RUN dpkg --install /tmp/libgc1_8.0.4-3_amd64.deb /tmp/libgsl25_2.6+dfsg-2_amd64.deb /tmp/libgslcblas0_2.6+dfsg-2_amd64.deb
42+
RUN DEBIAN_FRONTEND="noninteractive" TZ="US/Eastern" apt-get install -qq freeglut3 libfftw3-double3 libglew2.1 libsigsegv2 ghostscript imagemagick texlive-pstricks
43+
RUN dpkg --install /tmp/asymptote_2.70+ds-2_amd64.deb
44+
COPY ubuntu-bin/gs /usr/local/bin/
45+
3746
RUN git clone https://github.com/mathics/Mathics.git
47+
ENV DATA_DIR=/usr/src/app/Mathics/mathics/doc/tex/
48+
ENV DOC_USER_TEX_DATA_PATH=/usr/src/app/Mathics/mathics/doc/tex/doc_tex_data.pcl
49+
ENV DOC_USER_HTML_DATA_PATH=/usr/src/app/Mathics/mathics/doc/tex/doc_html_data.pcl
50+
3851
COPY tex-images/*.pdf Mathics/mathics/doc/tex/
3952
ENV DOC_LATEX_FILE=/usr/src/app/Mathics/mathics/doc/tex/documentation.tex
4053
RUN (cd Mathics && ${PYTHON} ./setup.py develop)
@@ -55,6 +68,11 @@ RUN ${PYTHON} -m nltk.downloader wordnet omw
5568
# Mathicsscript #
5669
##################
5770

71+
72+
# prompt toolkit needs an IPython that is newer than what got
73+
# implicitly installed above
74+
RUN ${PYTHON} -m pip install 'ipython<8.0,>=7.23.1'
75+
5876
RUN ${PYTHON} -m pip install -e git://github.com/Mathics3/mathicsscript#egg=mathicsscript[full]
5977
RUN (cd src/mathicsscript && make)
6078

@@ -65,7 +83,7 @@ RUN ${PYTHON} -m pip install -e git://github.com/Mathics3/mathics-django#egg=Mat
6583

6684
RUN (cd src/mathics-django && npm install && make)
6785
RUN (cd src/mathics-django && ${PYTHON} mathics_django/docpipeline.py -o)
68-
RUN mkdir -p /usr/src/app/.local/var/mathics && cp -v /root/.local/var/mathics/doc_data.pcl /usr/src/app/.local/var/mathics/doc_data.pcl
86+
RUN mkdir -p /usr/src/app/.local/var/mathics && cp -v $DOC_USER_HTML_DATA_PATH /usr/src/app/.local/var/mathics/doc_data.pcl
6987

7088
##################
7189
# debug stuff #

docker/Dockerfile-dev+debug

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN apt-get install -qq apt-utils
2222
# npm pulls in nodejs, but we'll be explicit.
2323

2424
# Install lots of packages
25-
RUN DEBIAN_FRONTEND="noninteractive" TZ="US/Eastern" apt-get install -qq liblapack-dev llvm-12 llvm-12-dev gfortran maria libmysqlclient-dev sqlite3 python3-pip python3-setuptools git python3-numpy python3-matplotlib python-matplotlib-data x11-apps asymptote w3m latexmk texlive-xetex lmodern texlive-latex-extra texlive-fonts-recommended nodejs npm xserver-xorg-video-all libgl1-mesa-glx libgl1-mesa-dri mesa-utils evince
25+
RUN DEBIAN_FRONTEND="noninteractive" TZ="US/Eastern" apt-get install -qq liblapack-dev llvm-12 llvm-12-dev gfortran maria libmysqlclient-dev sqlite3 python3-pip python3-setuptools git python3-numpy python3-matplotlib python-matplotlib-data x11-apps latexmk texlive-xetex lmodern texlive-latex-extra texlive-fonts-recommended nodejs npm xserver-xorg-video-all libgl1-mesa-glx libgl1-mesa-dri mesa-utils evince
2626

2727
RUN pip install --no-cache-dir -r requirements.txt
2828
COPY requirements-mathicsscript.txt ./
@@ -34,7 +34,20 @@ RUN pip install --no-cache-dir -r requirements-mathicsscript.txt
3434
# RUN pip install "Mathics3[full]>=4.0.0"
3535
RUN pip install git+git://github.com/mathics/Mathics.git#egg=Mathics3[full]
3636

37+
RUN DEBIAN_FRONTEND="noninteractive" TZ="US/Eastern" apt-get install -qq librsvg2-bin python3-cson python3-pyqt5 python3-pyqt5.qtsvg
38+
39+
# We need newer versions of Asymptote and GhostScript for bulding the PDF
40+
COPY ubuntu-dpkg/*.deb /tmp/
41+
RUN dpkg --install /tmp/libgc1_8.0.4-3_amd64.deb /tmp/libgsl25_2.6+dfsg-2_amd64.deb /tmp/libgslcblas0_2.6+dfsg-2_amd64.deb
42+
RUN DEBIAN_FRONTEND="noninteractive" TZ="US/Eastern" apt-get install -qq freeglut3 libfftw3-double3 libglew2.1 libsigsegv2 ghostscript imagemagick texlive-pstricks
43+
RUN dpkg --install /tmp/asymptote_2.70+ds-2_amd64.deb
44+
COPY ubuntu-bin/gs /usr/local/bin/
45+
3746
RUN git clone https://github.com/mathics/Mathics.git
47+
ENV DATA_DIR=/usr/src/app/Mathics/mathics/doc/tex/
48+
ENV DOC_USER_TEX_DATA_PATH=/usr/src/app/Mathics/mathics/doc/tex/doc_tex_data.pcl
49+
ENV DOC_USER_HTML_DATA_PATH=/usr/src/app/Mathics/mathics/doc/tex/doc_html_data.pcl
50+
3851
COPY tex-images/*.pdf Mathics/mathics/doc/tex/
3952
ENV DOC_LATEX_FILE=/usr/src/app/Mathics/mathics/doc/tex/documentation.tex
4053
RUN (cd Mathics && ${PYTHON} ./setup.py develop)
@@ -55,6 +68,10 @@ RUN ${PYTHON} -m nltk.downloader wordnet omw
5568
# Mathicsscript #
5669
##################
5770

71+
# prompt toolkit needs an IPython that is newer than what got
72+
# implicitly installed above
73+
RUN ${PYTHON} -m pip install 'ipython<8.0,>=7.23.1'
74+
5875
RUN ${PYTHON} -m pip install -e git://github.com/Mathics3/mathicsscript#egg=mathicsscript[full]
5976
RUN (cd src/mathicsscript && make)
6077

@@ -65,7 +82,7 @@ RUN ${PYTHON} -m pip install -e git://github.com/Mathics3/mathics-django#egg=Mat
6582

6683
RUN (cd src/mathics-django && npm install && make)
6784
RUN (cd src/mathics-django && ${PYTHON} mathics_django/docpipeline.py -o)
68-
RUN mkdir -p /usr/src/app/.local/var/mathics && cp -v /root/.local/var/mathics/doc_data.pcl /usr/src/app/.local/var/mathics/doc_data.pcl
85+
RUN mkdir -p /usr/src/app/.local/var/mathics && cp -v $DOC_USER_HTML_DATA_PATH /usr/src/app/.local/var/mathics/doc_data.pcl
6986

7087
##################
7188
# debug stuff #

docker/django-db/mathics.sqlite

0 Bytes
Binary file not shown.

docker/ubuntu-bin/asy

-38.9 MB
Binary file not shown.
File renamed without changes.
File renamed without changes.
233 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)