TEIC / Stylesheets

TEI XSL Stylesheets
231 stars 124 forks source link

jing for Test2 runs out of memory in docker #562

Closed sydb closed 1 year ago

sydb commented 2 years ago

@martindholmes, @hcayless, @peterstadler —

I cloned @joeytakeda’s fork, and from within a TEI Docker container (I don’t know which one — how can I tell?) ran make test2P in the dev branch. This runs ant test in Test2. I got a stack overflow error:

BUILD FAILED
/usr/share/xml/tei/stylesheet/Test2/build.xml:549: The following error occurred while executing this line:
/usr/share/xml/tei/stylesheet/Test2/build_odt.xml:32: The following error occurred while executing this line:
/usr/share/xml/tei/stylesheet/Test2/build_odt.xml:123: The following error occurred while executing this line:
/usr/share/xml/tei/stylesheet/Test2/build_odt.xml:151: java.lang.StackOverflowError
    at com.thaiopensource.relaxng.pattern.IdTypeMapBuilder$BuildFunction.caseChoice(IdTypeMapBuilder.java:126)
    at com.thaiopensource.relaxng.pattern.IdTypeMapBuilder$BuildFunction.caseChoice(IdTypeMapBuilder.java:101)
    at com.thaiopensource.relaxng.pattern.ChoicePattern.apply(ChoicePattern.java:24)
        …

That is from a <jing> directive in buld_odt.xml. What is really bothersome is I did not get this error when I tried the same thing locally, i.e. not in Docker.

martindholmes commented 2 years ago

Do you get the same error when you cd into Test2 and run ant test?

sydb commented 2 years ago

Yes, same error from cd Test2/ ; ant test in the Docker container, no error in my local shell.

hcayless commented 2 years ago

Hmm. If I've understood what you're doing, then I can't replicate it in my Docker. Are you using the same working directories as you are outside Docker?

sydb commented 2 years ago

Yes, I although I should double-check that I was still using the same directories when I did the 2nd test for @martindholmes (make test2P vs cd Test/ ; ant test) a 2 hours ago.

sydb commented 2 years ago

Yup, same dir.

sydb commented 2 years ago

(What I am not sure is that I am using the same Docker container you are.)

peterstadler commented 2 years ago

Just tested with current teic/teidev-docker and teic/jenkins images and ran make test2P in the Stylesheet's dev branch (not knowing what "joeytakeda’s fork" was): unable to reproduce the memory issue. Presumably it's your local setting, that restricts memory for running containers? What are your settings in Docker Desktop?

sydb commented 2 years ago

Oh dear, that was dumb of me (not to provide ptr to @joeytakeda’s fork). Will try to get one in a few mins. In the meantime, what settings in Docker would you like to know about, and how do I find out what they are? (BTW, if by “Docker Desktop” you mean the GUI desktop environment as run in a Docker container, I never run one, I just use the commandline inside the container.)

sydb commented 2 years ago

The fork in question is (I think) the issue241-preserveOrder branch of git@github.com:joeytakeda/Stylesheets.git.

BTW, I do not find any files on my system whose name includes “teidev-docker”, nor any that include “jenkins” other than the three in Documents/Editing/Jenkins/ and those within oXygen.

peterstadler commented 2 years ago

"Docker Desktop" is the client software one usually downloads to install Docker: https://www.docker.com/products/docker-desktop/ – it is available for Mac, Windows and Linux and offers a preference pane to set various Docker related features. One of these features is the amount of RAM granted to containers which you can check (also) on the command line via docker info, grepping for "Total Memory" (at least on my Mac ;).

If this doesn't help, can you tell me what OS you're running and what command you execute to start the container?

sydb commented 2 years ago

From inside the docker container or out? Outside it works (requires root privileges), and correctly claims total memory is 23.34GiB. There is no docker command inside the docker itself.

I do not recall what command I used to originally launch the container (likely something like sudo docker run --name tei -v ~/Documents/TEI_gitHub:/TEI -v ~/Documents/Stylesheets:/usr/share/xml/tei/stylesheet -v ~/bin:/sydbin -it -e TZ=America/New_York teic/teidev-docker), but the command I use to restart it is sudo docker start -ai tei.

peterstadler commented 1 year ago

Still not able to reproduce here, looks like a local issue. I'll close for now, but feel free to reopen when there's new debugging information