Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TO BE REPLACE: Discussions about Docker + originally hard copy fixes / extensions for WW 2.15 branch + move Docker base image to Ubuntu 18.04 LTS #972

Conversation

taniwallach
Copy link
Member

@taniwallach taniwallach commented Jul 14, 2019

Replaced by:


Much discussion about revisions to the Docker configuration appears in the conversation below.


Original:

Reinsert the $externalPrograms{pdflatex} setting in conf/site.conf.dist as it was removed in commit bea85e1 apparently by accident.

The hard copy generation code in lib/WeBWorK/ContentGenerator/Hardcopy.pm and
the web service hard PDF generation code in lib/WebworkWebservice/MathTranslators.pm both expect this setting to exist.

@taniwallach taniwallach requested review from heiderich and a team July 14, 2019 13:43
taniwallach referenced this pull request Jul 14, 2019
also added spacing to site.conf.dist
@taniwallach
Copy link
Member Author

I think this is a critical fix.

  • I just ran a test to see what exactly will be reported. See below.
  • This bug certainly will break hard-copy generation if a user uses the site.conf.dist file to create a site.conf file that does not contain the missing setting.
Warning messages
Use of uninitialized value in concatenation (.) or string at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Hardcopy.pm line 851.
Hardcopy Generator
Warning -- There may be something wrong with this question. Please inform your instructor including the warning messages below.
4 errors occured while generating hardcopy:

Failed to convert TeX to PDF with command 'cd /opt/webwork/webwork2/htdocs/tmp/ODE_modelCourse/hardcopy/work.zRVB1mFc && >pdflatex.stdout 2>pdflatex.stderr hardcopy' (exit=127 signal=0 core=0).
No TeX log was found.
Failed to rename 'hardcopy.pdf' to 'ODE_modelCourse.tani.5-01-MiamiUOhio-Definitions_and_Terminology.pdf' in directory '/opt/webwork/webwork2/htdocs/tmp/ODE_modelCourse/hardcopy/work.zRVB1mFc':
/bin/mv: cannot stat '/opt/webwork/webwork2/htdocs/tmp/ODE_modelCourse/hardcopy/work.zRVB1mFc/hardcopy.pdf': No such file or directory
Final hardcopy file '/opt/webwork/webwork2/htdocs/tmp/ODE_modelCourse/hardcopy/work.zRVB1mFc/hardcopy.pdf' not found after calling 'generate_hardcopy_pdf': No such file or directory
WeBWorK was unable to generate a paper copy of this homework set. Please inform your instructor.

@taniwallach
Copy link
Member Author

On WW running in Docker - after defining the setting, generating PDF fails due to path.sty being missing.

  • This is the package texlive-generic-recommended for Ubuntu 16.04.
    • Installing that package fixes the problem.
    • I will add the package for Ubuntu 16.04 to the Dockerfile in an addition to this PR.
  • For Ubuntu 18.04 it is in the texlive-plain-generic package (and is also there in 19.04).
Hardcopy Generator
4 errors occured while generating hardcopy:

Failed to convert TeX to PDF with command 'cd /opt/webwork/webwork2/htdocs/tmp/ODE_modelCourse/hardcopy/work.hXQjNyLp && /usr/bin/pdflatex --shell-escape >pdflatex.stdout 2>pdflatex.stderr hardcopy' (exit=1 signal=0 core=0).
First error in TeX log is:
! LaTeX Error: File `path.sty' not found.

@taniwallach taniwallach changed the title Reinsert $externalPrograms{pdflatex} setting in conf/site.conf.dist hard copy fixes / extensions for WW 2.15 branch Jul 15, 2019
@taniwallach taniwallach added Do Not Merge Yet PR to allow others to inspect -- not ready for prime time Undergoing revisions Additional changes are needed in this PR labels Jul 15, 2019
@taniwallach taniwallach removed request for a team and heiderich July 15, 2019 12:19
@heiderich
Copy link
Member

How about using ubuntu:18.04 as docker base image in the future? One problem with newer Ubuntu versions was fixed in #938.

The main goal was to support multilingual PDF generation using
XeLaTeX and polyglossia. My test case was English+Hebrew, so I
have added XeLaTeX conf/snippets/hardcopyThemes directories for
using polyglossia for English and English+Hebrew. Fonts (culmus)
were installed in the Docker image to provide the Hebrew fonts
needed to test the English+Hebrew xelatex compilation.

conf/localOverrides.conf.dist contains sample code to use the\
new themes.

conf/site.conf.dist contains a commented out option to use
xelatex instead of pdflatex.

The docker-config/ has additional sample config files, and
docker-entrypoint.sh was moved into docker-config/.
In particular there are very rough sample files for using
WW with SSL in Docker, but the placeholder certificate and
key files would need to be put in place, as well as various
settings adjusted in the config files.

The code in lib/WeBWorK/ContentGenerator/Hardcopy.pm which displays
the available hardcopyThemes options was changed to avoid the
use of maketext. Local installations may have local hardcopyThemes
and they will not have entries in the PO translations files, and
the prior code would trigger errors as a result.

The version of xelatex and various latex packages in Ubuntu 16.04
did not manage to compile the Hebrew+English latex files I tested,
but they compile under Ubuntu 18.04. As a result, the Dockerfile was
changed to build upon Ubuntu 18.04 (LTS), which had originally
been intended to be done in a different PR. Along the way, many
Perl modules are now installed from the Ubuntu repositories, which
saved on "cpanm" local installation. Several additional tools, as
well as some packages for SSL support were added to the image.

The docker-compose.yml was updated, and includes sample code to use
various external resources, and to store Apache logs outside the image.
At present, the docker config files are set up under the assumption that
the OPL is mounted from OUTSIDE the docker image. That saves on build time,
and allows sharing it between different images (but may slow things down
somewhat) but there is a commented out block in Dockerfile to put the
OPL in the image.

The Dockerfile also updates the base Ubuntu image, created locales,
sets the timezone, etc. Several lines for SSL support are commented
out, and should be enabled for sites using SSL, once the relevant
customized configuration files and certificates are provided to the
image (possibly via external mounts).

Settings for SQL password in docker-compose.yml should be effective
if they are set/exist when the MariaDB container boots up with an empty
database directory/volume. Thus, those passwords should be set BEFORE
the first "docker-compose up" or after the mysql data volume is deleted.
@taniwallach
Copy link
Member Author

@heiderich - I had hoped to make a change to ubuntu:18.04 as the Docker base image independently from this PR. However, Ubuntu 16.04 had trouble compiling the Hebrew+English latex files being generated for me using xelatex and the polyglossia packages... so the change are in this PR.

Along the way, more Perl modules are installed via Ubuntu, additional tools and packages are added, include some needed for SSL support.

The result is that this is a pretty "heavy" PR in terms of changes.

See the commit message from the second commit, which has lots of explanation.

On 2 machines I tested on using Docker I can generate PDF files using xelatex both with the English+Hebrew hardcopy theme and with an English only hardcopy theme for all English problem sets. Making use of the new hardcopy themes requires changes in conf/localOverrides.conf and there is a sample in conf/localOverrides.conf.dist.

The commit message also explains about when/how to set the SQL passwords (= before first DB startup).

@taniwallach taniwallach removed Do Not Merge Yet PR to allow others to inspect -- not ready for prime time Undergoing revisions Additional changes are needed in this PR labels Jul 19, 2019
@taniwallach taniwallach added Multilingual Part of the Multilingual (localization) project NeedsTesting Tentatively fixed bug or implemented feature labels Jul 19, 2019
@taniwallach taniwallach changed the title hard copy fixes / extensions for WW 2.15 branch hard copy fixes / extensions for WW 2.15 branch + move Docker base image to Ubuntu 18.04 LTS Jul 19, 2019
@mgage
Copy link
Member

mgage commented Jul 27, 2019

I've successfully built webwork-2.15 with PR #972 and #973 merged both in a docker environment
and in my old laptop environment. In the latter I had trouble installing Email::Address::XS -- the problem is that the binary modules were set to be compiled by gcc-4.2 and my Mac had only the gcc compiler (not sure what version). I modified the Makefile to use /usr/bin/gcc and seem to have installed Email::Address::XS -- it claimed to have compiled successfully.

I haven't done much testing yet. I probably won't be able to test the handling of hebrew easily but I can run these for a while and see if there are any more issues with just using 2.15 for existing courses and problems.

@mgage
Copy link
Member

mgage commented Jul 27, 2019

After running docker-compose up there was a problem communicating with the database from webwork2. This was fixed by updating the password in docker-compose.yml -- just remember this for documentation. Does the specification of the mysql password and other data in the Dockerfile have any relevance? Is it necessary? It appears to be overwritten by the docker-compose file.

@mgage
Copy link
Member

mgage commented Jul 27, 2019

I'm puzzled by the intended "out of the box" operation of docker and the OPL. Is it intended that the OPL be installed manually inside the container after it is set up? Linking to an external OPL was commented out but there were no instructions for cloning the OPL in the docker-compose.yml

@taniwallach
Copy link
Member Author

After running docker-compose up there was a problem communicating with the database from webwork2. This was fixed by updating the password in docker-compose.yml -- just remember this for documentation. Does the specification of the mysql password and other data in the Dockerfile have any relevance? Is it necessary? It appears to be overwritten by the docker-compose file.

The mysql passwords are not not really needed in the Dockerfile, as far as I understand, as that is used only to build the webwork app image, however that may have been the original manner in which they were put into the environment variables for the set of images. Instead, they should now be set via docker-compose.yml, and the value of the passwords are really set when the database container (and it's stored control database) is first created, normally when docker-compose up is first run. The values were changed in the file, as part of my preparations for instructions on running WW via Docker in production.

@taniwallach
Copy link
Member Author

@taniwallach : By the way... I'm at:
ww2-test002.pdf
So I think I've hit what you are talking about....

Note: This is also a PR against the WW 2.15 tree...

Yes - the older Docker builds did not have the package with path.sty... For ubuntu 16.04 it is in texlive-generic-recommended but in ubuntu 18.04 that is a dummy package which loads the newer texlive-plain-generic. ( https://packages.ubuntu.com/bionic/all/texlive-generic-recommended )

To get support for additional languages with Unicode: you could try pdflatex + babel, but xelatex + polyglossia are far more Unicode friendly. However, the hardcopy theme using either option needs to load the correct languages, provide fonts, etc. polyglossia and and fonts. Polyglossia + fontspec of xelaytex uses system installed fonts, which require far less work to get functioning than using fonts with pdflatex and babel.

References:

They critical bits are more-or-less something like

% For XeLaTeX + polyglossia 
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{booktabs,tabularx,colortbl,caption,xcolor}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\setmainfont{Frank Ruehl CLM}
\setmonofont{Miriam Mono CLM}
\setsansfont{Simple CLM}

but with the languages needed and suitable font names.

As explained above, the versions of various latex/xelatex packages/code under Ubuntu 16.04 did not support compiling the same tex files which worked under Ubuntu 18.04...

Here is a xelatex compiled file from my server:
104019_1819b.tani.HW08-InverseMatrix.pdf

The source LaTeX code was renamed to end with .txt so it can be uploaded:
104019_1819b.tani.HW08-InverseMatrix.tex.txt

I will email you a tgz file with the PG files of this assignment and the set definition file.

@nmoller
Copy link
Member

nmoller commented Jul 31, 2019

I think this approach is going to work if yo do the right header setup (either for babel or polyglossia) but is going to depend of your "locale". So the need to get personalised headers... can not be bypassed.
At a more generic level, the database (a fresh, clean one... dont tested update as by
https://mathiasbynens.be/notes/mysql-utf8mb4 or
https://medium.com/@manish_demblani/breaking-out-from-the-mysql-character-set-hell-24c6a306e1e5 ) works perfect.
Great work!

@taniwallach
Copy link
Member Author

@taniwallach : By the way... I'm at:
ww2-test002.pdf
So I think I've hit what you are talking about....

Regarding the specifics of the error on the second page of ww2-test002.pdf:

@taniwallach
Copy link
Member Author

I think this approach is going to work if yo do the right header setup (either for babel or polyglossia) but is going to depend of your "locale". So the need to get personalized headers... can not be bypassed.

Yes, that is currently the case for any non-English latex document. 😄

@nmoller - If you want to prepare hardcopy theme headers for French - that would be nice to add before WW 2.15 is released. It could be that the CCDMD team already have one somewhere in there, possibly CCDMD@b289cf7#diff-f69176fb70ee3fea438b14262d26ae16

@heiderich - do you want to tackle German? Would your colleague who helped write a sample Arabic PG problem maybe help with an Arabic hardcopy theme?

At a more generic level, the database (a fresh, clean one... dont tested update as by
https://mathiasbynens.be/notes/mysql-utf8mb4 or
https://medium.com/@manish_demblani/breaking-out-from-the-mysql-character-set-hell-24c6a306e1e5 ) works perfect.
Great work!

This has been a long team effort, and I joined the party very late. Almost all the core UTF-8 support in the WW 2.15 branch was added by:

@mgage seems to be ready to close up WW 2.15 with the last few things soon, so it can be formally released later in the summer.

@taniwallach taniwallach requested a review from nmoller July 31, 2019 20:54
Copy link
Member

@nmoller nmoller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this approach is going to work if yo do the right header setup (either for babel or polyglossia) but is going to depend of your "locale". So the need to get personalised headers... can not be bypassed.
At a more generic level, the database (a fresh, clean one... dont tested update as by
https://mathiasbynens.be/notes/mysql-utf8mb4 or
https://medium.com/@manish_demblani/breaking-out-from-the-mysql-character-set-hell-24c6a306e1e5 ) works perfect.
Great work!

Copy link
Member

@xcompass xcompass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more comment: are you able to separate this docker change and hard copy fixes into two different commits? It will be better for the git history and much easier for people who needs to look this change in the future.

RUN apt-get update \
&& apt-get -y upgrade \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this, as from Dockerfile best practices (https://docs.docker.com/develop/develop-images/dockerfile_best-practices/)

Avoid RUN apt-get upgrade and dist-upgrade, as many of the “essential” packages from the parent images cannot upgrade inside an unprivileged container. If a package contained in the parent image is out-of-date, contact its maintainers. If you know there is a particular package, foo, that needs to be updated, use apt-get install -y foo to update automatically.

libuniversal-can-perl \
libuniversal-isa-perl \
libtest-fatal-perl \
libjson-xs-perl \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find using system packages instead of cpan sometimes can be troublesome. Often times, system packages are not up-to-date. What packages people are using when doing webwork core development? I suggest we use the same packages for consistency and stability.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope most developers will now be working using the "current" Docker image + their local modifications, so standardizing on what is packed by our root OS image is convenient, for what is available. As I understand it, that is also how @mgage would like to see core system developers working.

If there are specific CPAN packages where a newer version are needed, we should use them and document it in the WW install instructions, as such issues are likely to effect people on some Linux distributions (ex. RHEL/CentOS) where changes to newer versions are very slow to happen.

I think @mgage and I ran into such an issue with the DBI or DBD on an older machine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having started out using cpan packages almost exclusively I have found system packages a bit quicker and sometimes easier. We have also run into problems where the system files are out of date. On the other hand we have run into several cpan modules that are unreliable to download and install (XML-simple
libxml-simple-perl \ libsoap-lite-perl \
were two examples where loading the CPAN modules were would sometimes work and sometimes not.
I haven't yet found a universal rule for preferring system install over cpan install.

ca-certificates \
culmus \
fonts-linuxlibertine \
lmodern \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid to include the tools that are not necessary to run webwork, e.g. vim, telnet, etc. The goal is to build a smaller image that doesn't necessary include everything.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point accepted. I found telnet helpful when there were issues with outgoing connections, and some reasonable editor is sometimes needed when working/debugging in the running container. However, they can be installed on the running container as needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also found such tools very useful. Especially during development it is handy not to be in need to install them after every rebuild.

I did not catch up with all the discussions going on, but maybe one option could be to have two Dockerfiles, one mainly for production and one mainly for development. Of course this would require to maintain two Dockerfiles and probably some code duplication.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw #972 (comment). I agree with @xcompass in that having a single Dockerfile / image for dev and ops would be desirable. @xcompass how is your development cycle? When you change parts of webwork2 or pg, do you do this on the host system and rebuild the container? If this is the recommended way, then I think we should try to assure that such kind of changes will result in short rebuild times.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In trying to understand how to speed up docker performance on the mac I have found that Docker allows for "cascading" files -- at least for docker-compose.yml.
You can have docker-compose.yml (for production) and docker-compose.dev.yml (for development) with the latter containing only the additions needed for development.
docker-compose -f docker-compose.yml -f docker-compose-dev.yml up create the development environment.


RUN echo 'America/New_York' > /etc/timezone \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use UTC for container timezone as it is best practises for ops. People often mount the /etc/timezone file from host to have container in sync with host.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm not a devops expert (yet). That makes lots of sense and will be done, and I will add a note somewhere in docker-compose.yml about maybe mounting the system file.

@xcompass - what do you recommend about the generation of locale files? I think the same logic regarding timezone means that the code to generate locales might best be moved to the very end of the Dockerfile or to the startup file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 😄

@@ -104,72 +168,90 @@ RUN mkdir -p $APP_ROOT/courses $APP_ROOT/libraries $APP_ROOT/webwork2
# && mv webwork2-${WEBWORK_BRANCH} $APP_ROOT/webwork2 \
# && rm -rf /tmp/${WEBWORK_BRANCH}.tar.gz /tmp/webwork2-${WEBWORK_BRANCH}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the container not include webwork source anymore? What if I'm an OPL developer and I have no interests in changing webwork core code. Or I just want to test webwork out. I still needs to download a copy of webwork source code outside container.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. For any operational use it should be included, even if system developers don't need it.


ENTRYPOINT ["docker-entrypoint.sh"]

EXPOSE 80

# Comment out the next line if SSL is not needed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change it to Uncomment the next line if SSL is needed


# setup apache
# if no SSL needed - comment out the line && a2enmod ssl && a2ensite default-ssl \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change it to if SSL is needed - uncomment the line && a2enmod ssl && a2ensite default-ssl

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the revised PR #980 which focuses on the Docker changes only. I tried to implement all the changes suggested.

WORKDIR $APP_ROOT




Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why so many empty lines?

build: .
image: webwork

image: webwork_215_ubuntu_1804
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not change this. In the future (or maybe we should do it now), we should set up dockerhub to automatically build the image, so people don't need to build the image locally. It is much faster to pull down an image from dockerhub than building it locally.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xcompass - Thanks for all the feedback about the Docker files and best practices.

  1. I think that at the least we should somehow "tag" for WW release version, so that people can depend on getting the version they expect.
    - @xcompass - How should that be done "correctly"?
  2. I will work on splitting this into two different PRs: one only for the WW hardcopy code without any of the Docker changes, and one with the Docker changes taking your comments into account.
    - I don't know if I will have it ready until early next week.

@mgage - Can we merge in #973 soon as that had very minor change to Dockerfile and working in steps will avoid merge conflicts. Then I will build the "hardcopy only" PR based on a branch with that merged in, and then the major Docker changes from this PR as a step after the revised "hardcopy" PR. We probably want to consider @heiderich's suggestion of moving all the Docker files out of webwork2 and having webwork2 and pg as submodules of the "ww-docker" module. I don't know if those people able to work on that task have time to try to do it before WW 2.15 becomes an official release candidate.

@xcompass
Copy link
Member

xcompass commented Aug 1, 2019

Sorry for the delay, we were busy with a few deadlines in the past a few weeks. Here are my comments:

  • The goal for the container is:
    1. To make devs life easier
    2. To make ops life easier
    3. To have consistent dev/prod environment
      So when I build any image, I prefer to make the image as generic as possible so it can be used for both dev and prod. They can be differentiated by environment variable settings, e.g. DEV=0
  • I would recommend against moving docker files outside ww repo. As sometimes, you need to adjust the Dockerfile or other related docker files while making your core code change. e.g. adding a new library needed by a new feature. Having everything in one place is easier for developer and also easier for other people to see the changes within a single commit
  • I noticed the ww source code is not included in the container anymore. Sorry I missed that PR, if there is any, to provide my feedback. I'm also against this approach. Having the code inside container is the key to be used in prod environment. (Goal #2). If I'm an OPL developer and no interests in changing webwork core code. Or I just want to test webwork out. I still needs to download a copy of webwork source code outside container.
  • I agree to move OPL outside image. But I suggest to have a piece of bash code in docker-entrypoint.sh to check if OPL files are in OPL directory. If not, download a copy of OPL from github (not git clone). In this way, if developer mounts OPL from outside image, the script will skip downloading. If instructor just wants to try out webwork, he/she doesn't need to do any additional step. For prod, we can also mount a shared volume with OPL to multiple webwork containers.
  • I also suggest we create the image on dockerhub using auto build. So we can have an already built image for people who don't want to build image locally to use. If I'm an instructor and want to try out webwork. I can just download the docker-compose.yml and run docker-compose up. I'll have a fully working copy of webwork.
  • I would prefer not to build my own image for k8s. If the official WW image published on dockerhub and generic enough to be used in prod, I would rather use that one. I don't want to maintain different copies of images.

Sorry for the wall of text. I do both dev and ops, so I tend to think what is the best approach for both sides.

@taniwallach taniwallach added Do Not Merge Yet PR to allow others to inspect -- not ready for prime time To be replaced by a revised PR and removed NeedsTesting Tentatively fixed bug or implemented feature labels Aug 1, 2019
@taniwallach
Copy link
Member Author

@xcompass Thanks.

  • I'll work on splitting the PR into the 2 components as different PRs. (Probably available early next week.)
  • I will probably add in many sample mount lines to docker-compose.yml showing what sort of things I am doing while running using Docker in production.
  • I'll ask you to review the docker PR after the split into 2 parts.
  • Once we get the revised Docker changes settled down - we can try to make an official dockerhub image. I can try to do it (and later maintain it) if someone can help walk me through the process the first time.

@mgage
Copy link
Member

mgage commented Aug 1, 2019

@xcompass Thanks for your 'wall of text'. We need comments from those experienced in both dev and ops. While we are continuously learning, that fact that many of us are mathematicians and don't work on many different types of software development limits the breadth of our experience.

One of the time consuming aspects of installing webwork2 quickly is building the index for the OPL in the database (running OPL-update ). Is there some way to keep that part of the database in an image so that it loads quickly even if it's a bit out of date? Perhaps the better long term fix would be to consider how to improve OPL-update so that it does updates as opposed to starting from scratch.

@taniwallach taniwallach changed the title hard copy fixes / extensions for WW 2.15 branch + move Docker base image to Ubuntu 18.04 LTS TO BE REPLACE: Discussions about Docker + originally hard copy fixes / extensions for WW 2.15 branch + move Docker base image to Ubuntu 18.04 LTS Aug 1, 2019
@taniwallach
Copy link
Member Author

One of the time consuming aspects of installing webwork2 quickly is building the index for the OPL in the database (running OPL-update ). Is there some way to keep that part of the database in an image so that it loads quickly even if it's a bit out of date?

Why don't we figure out how to distribute a tarball of the OPL SQL tables (sort of like the SL portion of the course archives) which can be installed using the admin course? That would allow installing a "recent" set of OPL tables without any need to scan the entire OPL file tree and parse the PG files? It might be necessary to provide GPG signatures and/or SHA-256 sums of the internal data/tarball to make this a bit more secure.

Such an approach would mean that "most people" could avoid running OPL-update at all, so long as they don't have "local code" merged into the OPL for search purposes. Once we finish and release multi-library support people will no longer need that hack.

Perhaps the better long term fix would be to consider how to improve OPL-update so that it does updates as opposed to starting from scratch.

I suspect that might be hard to do, as there is a dependence on "id numbers" of objects in the SQL tables which get created when the tables are created. Determining what they were from a modified OPL might not be simple, nor would be detecting deletions of files of changes to tags.

@mgage
Copy link
Member

mgage commented Aug 1, 2019

Creating an SQL dump of the library is an excellent idea. We could use some checks to make sure that the database version matches the current OPL repos. Even if it doesn't, the match would probably be good enough for most development purposes. For production sites, which change infrequently, the overhead of building the OPL database is not so bad.

We could create a github hook that creates a new OPL database when changes are made (or once a day if changes are made).

@nmoller
Copy link
Member

nmoller commented Aug 1, 2019

@mgage @taniwallach @xcompass : Before embarquing in a long process... I think it could be helpful to stablish where we are heading to.

I explain... Pan has set a way to get an image (as light as possible with all the setup done and that everything works out of the box... because of that the inclusion of the opl update in the docker-entryscript.sh). I believe the 10 min it takes ... are worth :) because somebody can use it as it is without any hacking.

If you are thinking in a DEV env without the opl update option.... it is easier to do that in the entryscript.
For sure getting a ligther image without unused extra packages is a harder story... and that is the defying point.
I admire your work... and it is really a great learning experience.
Have a nice day.

@taniwallach
Copy link
Member Author

The Docker configuration changes (after additional modifications) were moved to #980

@taniwallach taniwallach closed this Aug 3, 2019
@taniwallach taniwallach removed Do Not Merge Yet PR to allow others to inspect -- not ready for prime time Multilingual Part of the Multilingual (localization) project To be replaced by a revised PR labels Aug 16, 2019
@taniwallach taniwallach removed the request for review from mgage August 16, 2019 14:54
@taniwallach taniwallach deleted the tani_reinsert_pdflatex_setting branch August 22, 2019 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants