Add a Dockerfile for huxley tests
Summary: Add the dockerfile that I've been using to make huxley screenshots so others can test their changes by making huxley screenshots. Include a readme about how to use it correctly. Test Plan: - Use the dockerfile by running the given commands, see it works Reviewers: alpert Reviewed By: alpert Differential Revision: http://phabricator.khanacademy.org/D12773
This commit is contained in:
parent
6b674873ea
commit
38a6ce7990
13
dockers/HuxleyTests/Dockerfile
Normal file
13
dockers/HuxleyTests/Dockerfile
Normal file
|
@ -0,0 +1,13 @@
|
|||
FROM ubuntu:14.04
|
||||
MAINTAINER xymostech <xymostech@gmail.com>
|
||||
RUN apt-get -qq update
|
||||
RUN apt-get -qqy install nodejs=0.10.25~dfsg2-2ubuntu1 default-jre=2:1.7-51 firefox=28.0+build2-0ubuntu2 xvfb=2:1.15.1-0ubuntu2 wget=1.15-1ubuntu1 || true
|
||||
RUN wget http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar
|
||||
RUN ln -s /usr/bin/nodejs /usr/bin/node
|
||||
ENV DISPLAY :1
|
||||
CMD /bin/bash ~/run.sh
|
||||
RUN echo "java -jar /selenium-server-standalone-2.42.2.jar > /dev/null &" >> ~/run.sh
|
||||
RUN echo "Xvfb :1 2> /dev/null &" >> ~/run.sh
|
||||
RUN echo "make -C /KaTeX serve > /dev/null &" >> ~/run.sh
|
||||
RUN echo "sleep 2" >> ~/run.sh
|
||||
RUN echo "/KaTeX/node_modules/.bin/hux --update /KaTeX/test/huxley/" >> ~/run.sh
|
29
dockers/HuxleyTests/README.md
Normal file
29
dockers/HuxleyTests/README.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
### How to generate huxley images
|
||||
---------------------------------
|
||||
|
||||
Now you too can generate huxley images from your own computer, and (hopefully)
|
||||
have them look mostly the same as the current ones! To start, make a docker
|
||||
image from the included Dockerfile using a command like
|
||||
|
||||
sudo docker build --tag=huxley .
|
||||
|
||||
from within this directory (note you need to have docker installed and running
|
||||
for this to work). This will build a docker image with the huxley tag,
|
||||
which you can then use to run dockers based on them.
|
||||
|
||||
This huxleyfile is set up such that it will run everything and generate all the
|
||||
huxley images when the image is run, so no interactive input is required. All
|
||||
that you need to do is mount the KaTeX directory you want to test into the
|
||||
`/KaTeX` directory in the docker, and run the huxley docker, like so:
|
||||
|
||||
sudo docker run --volume=/your/KaTeX/:/KaTeX huxley
|
||||
|
||||
The `--volume=/your/KaTeX:/KaTeX` switch mounts your KaTeX directory into the
|
||||
docker. Note this is a read-write mounting, so the new huxley images will be
|
||||
directly placed into your KaTeX directory.
|
||||
|
||||
Since this docker is very self-contained, there should be no need to do
|
||||
interactive management of the docker, but if you feel the need, you can read the
|
||||
General Docker Help section of the MathJaxFonts docker readme.
|
||||
|
||||
That's it!
|
|
@ -1,45 +1,45 @@
|
|||
### How to generate MathJax fonts
|
||||
-----------------------------
|
||||
---------------------------------
|
||||
|
||||
It's really simple (now)! Just make a docker image from the included Dockerfile
|
||||
using a command like
|
||||
|
||||
sudo docker build --tag=mathjaxfonts .
|
||||
sudo docker build --tag=mathjaxfonts .
|
||||
|
||||
from within this directory (note you need to have docker installed and running
|
||||
for this to work). This will build a docker image with the mathjaxfonts tag,
|
||||
which you can then use to run dockers based on them. Then, run a mathjaxfonts
|
||||
docker with
|
||||
|
||||
sudo docker run --interactive --tty --name mjf mathjaxfonts /bin/bash
|
||||
sudo docker run --interactive --tty --name mjf mathjaxfonts /bin/bash
|
||||
|
||||
We name this docker "mjf" so we can reference it later when we want to copy the
|
||||
files off. (If you get an error about the name being in use, perhaps because you
|
||||
are trying to create another docker, you can either delete the old docker with
|
||||
|
||||
sudo docker rm mjf
|
||||
sudo docker rm mjf
|
||||
|
||||
or use a different name.) This will get you into the docker in the root
|
||||
directory. From there, cd into the `/MathJax-dev/fonts/OTF/TeX` directory, and
|
||||
run
|
||||
|
||||
make ttf eot woff
|
||||
make ttf eot woff
|
||||
|
||||
to build all of the fonts that we need. Finally, leave the docker and copy all
|
||||
the files off with
|
||||
|
||||
docker cp mjf:/MathJax-dev/fonts/OTF/TeX/ttf ./
|
||||
docker cp mjf:/MathJax-dev/fonts/OTF/TeX/eot ./
|
||||
docker cp mjf:/MathJax-dev/fonts/OTF/TeX/woff ./
|
||||
docker cp mjf:/MathJax-dev/fonts/OTF/TeX/ttf ./
|
||||
docker cp mjf:/MathJax-dev/fonts/OTF/TeX/eot ./
|
||||
docker cp mjf:/MathJax-dev/fonts/OTF/TeX/woff ./
|
||||
|
||||
(note we're using `mjf:` to specify the name of the docker we created above)
|
||||
Compile the fonts into a single directory
|
||||
|
||||
mv {ttf,eot,woff}/* ./
|
||||
mv {ttf,eot,woff}/* ./
|
||||
|
||||
Remove the WinIE6 and WinChrome fonts
|
||||
|
||||
rm KaTeX_Win*
|
||||
rm KaTeX_Win*
|
||||
|
||||
And you're good to go! Don't forget to update the font metrics with the
|
||||
metric_parse.rb script once you're done.
|
||||
|
@ -50,17 +50,17 @@ metric_parse.rb script once you're done.
|
|||
When you quit the docker, it will stop the docker from running. If you want to
|
||||
reattach to the docker, you can start it again with
|
||||
|
||||
sudo docker start mjf
|
||||
sudo docker start mjf
|
||||
|
||||
and then attach with
|
||||
|
||||
sudo docker attach mjf
|
||||
sudo docker attach mjf
|
||||
|
||||
Alternatively, if you want to detach from the docker when you're done instead of
|
||||
quitting and stopping it, you can detach with `C-p C-q`, and then re-attach with
|
||||
|
||||
sudo docker attach mjf
|
||||
sudo docker attach mjf
|
||||
|
||||
To see a list of your current dockers, you can run
|
||||
|
||||
docker ps
|
||||
docker ps
|
||||
|
|
Loading…
Reference in New Issue
Block a user