2.4. Deploying¶
You can copy the built result to any of your favorite places that can
serve content online. Otherwise d2lbook
provides two ways to deploy
your build results: deploying through Github or
through AWS.
2.4.1. Deploying Through Github¶
Github Pages allow us to host a website
through a Github repo. To do so, we first need to create a github repo,
for example we created
d2l-ai/d2l-book-deploy-demo
for this example. Then enable serving from the master branch in
Settings -> GitHub Pages
. You will get a URL to access it. It is
d2l-ai.github.io/d2l-book-deploy-demo
for this example. You can add anything to README.md
, which will not
show on the website.
Now let’s create a project with [deploy] github_repo
specified and
build both HTML and PDF. You will see a large amount of logging
information thanks to LaTeX, more exactly, xelatex
.
!mkdir -p deploy
%%writefile deploy/index.md
# Deploying Demo for d2lbook
This is a demo to deploy on Github.
````toc
get_started
````
Writing deploy/index.md
%%writefile deploy/get_started.md
# Getting Started
Please first install my favorite package `numpy`.
Writing deploy/get_started.md
%%writefile deploy/config.ini
[project]
name = deply-demo
[html]
header_links = PDF, https://https://d2l-ai.github.io/d2l-book-deploy-demo/deply-demo.pdf, fas fa-file-pdf
[deploy]
github_repo = d2l-ai/d2l-book-deploy-demo
Writing deploy/config.ini
!cd deploy; d2lbook build html pdf
[d2lbook:config.py:L12] INFO Load configure from config.ini [d2lbook:build.py:L147] INFO 2 notebooks are outdated [d2lbook:build.py:L149] INFO [1] ./index.md [d2lbook:build.py:L149] INFO [2] ./get_started.md [d2lbook:build.py:L153] INFO Evaluating notebooks in parallel with 8 CPU workers and 8 GPU workers [d2lbook:resource.py:L196] INFO Starting task "Evaluating ./index.md" on CPU [7] [d2lbook:resource.py:L159] INFO Status: 1 running tasks, 0 done, 1 not started [d2lbook:resource.py:L164] INFO - Task "Evaluating ./index.md" on CPU [7] is running for 00:00:00 [d2lbook:resource.py:L196] INFO Starting task "Evaluating ./get_started.md" on CPU [4] [d2lbook:resource.py:L159] INFO Status: 2 running tasks, 0 done, 0 not started [d2lbook:resource.py:L164] INFO - Task "Evaluating ./index.md" on CPU [7] is running for 00:00:02 [d2lbook:resource.py:L164] INFO - Task "Evaluating ./get_started.md" on CPU [4] is running for 00:00:00 [d2lbook:resource.py:L223] INFO Task "Evaluating ./index.md" on CPU [7] is finished in 00:00:03 [d2lbook:resource.py:L223] INFO Task "Evaluating ./get_started.md" on CPU [4] is finished in 00:00:02 [d2lbook:resource.py:L142] INFO All 2 tasks are done, sorting by runtime: [d2lbook:resource.py:L148] INFO - 00:00:02 on CPU [4] for Evaluating ./get_started.md [d2lbook:resource.py:L148] INFO - 00:00:03 on CPU [7] for Evaluating ./index.md [d2lbook:build.py:L56] INFO === Finished "d2lbook build eval" in 00:00:05 [d2lbook:build.py:L322] INFO 2 rst files are outdated [d2lbook:build.py:L324] INFO Convert _build/eval/index.ipynb to _build/rst/index.rst [d2lbook:build.py:L324] INFO Convert _build/eval/get_started.ipynb to _build/rst/get_started.rst [d2lbook:build.py:L56] INFO === Finished "d2lbook build rst" in 00:00:06 [d2lbook:build.py:L56] INFO === Finished "d2lbook build ipynb" in 00:00:00 [d2lbook:build.py:L56] INFO === Finished "d2lbook build colab" in 00:00:00 [d2lbook:build.py:L56] INFO === Finished "d2lbook build sagemaker" in 00:00:00 Running Sphinx v5.3.0 making output directory... done checking bibtex cache... out of date parsing bibtex file /home/d2l-worker/workspace/d2l-book/docs/_build/eval/user/deploy/_build/rst... WARNING: could not open bibtex file /home/d2l-worker/workspace/d2l-book/docs/_build/eval/user/deploy/_build/rst. building [mo]: targets for 0 po files that are out of date building [html]: targets for 2 source files that are out of date updating environment: [new config] 2 added, 0 changed, 0 removed looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... done generating indices... genindex done writing additional pages... search done copying static files... done copying extra files... done dumping search index in English (code: en)... done dumping object inventory... done build succeeded, 1 warning. The HTML pages are in _build/html. [d2lbook:build.py:L56] INFO === Finished "d2lbook build html" in 00:00:07 Running Sphinx v5.3.0 making output directory... done checking bibtex cache... out of date parsing bibtex file /home/d2l-worker/workspace/d2l-book/docs/_build/eval/user/deploy/_build/rst... WARNING: could not open bibtex file /home/d2l-worker/workspace/d2l-book/docs/_build/eval/user/deploy/_build/rst. building [mo]: targets for 0 po files that are out of date building [latex]: all documents updating environment: [new config] 2 added, 0 changed, 0 removed looking for now-outdated files... none found pickling environment... done checking consistency... done processing deply-demo.tex... index get_started resolving references... done writing... done copying TeX support files... copying TeX support files... done build succeeded, 1 warning. The LaTeX files are in _build/pdf. Run 'make' in that directory to run these through (pdf)latex (use `make latexpdf' here to do that automatically). latexmk -pdf -dvi- -ps- 'deply-demo.tex' Latexmk: This is Latexmk, John Collins, 1 January 2015, version: 4.41. Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': Rules & subrules not known to be previously run: pdflatex Rule 'pdflatex': The following rules & subrules became out-of-date: 'pdflatex' ------------ Run number 1 of rule 'pdflatex' ------------ ------------ Running 'xelatex -recorder "deply-demo.tex"' ------------ This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017/Debian) (preloaded format=xelatex) restricted write18 enabled. entering extended mode (./deply-demo.tex LaTeX2e <2017-04-15> Babel <3.18> and hyphenation patterns for 84 language(s) loaded. (./sphinxmanual.cls Document Class: sphinxmanual 2019/12/01 v2.3.0 Document class (Sphinx manual) (/usr/share/texlive/texmf-dist/tex/latex/base/report.cls Document Class: report 2014/09/29 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo))) (/usr/share/texlive/texmf-dist/tex/latex/cmap/cmap.sty Package cmap Warning: pdftex not detected - exiting. ) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex) (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/tuenc.def)) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/polyglossia.sty (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/share/texlive/texmf-dist/tex/latex/makecmds/makecmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty) (/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-english.ldf) (/usr/share/texlive/texmf-dist/tex/latex/fncychap/fncychap.sty) (./sphinx.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg) (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/xetex.def)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty))) (./sphinxoptionshyperref.sty) (./sphinxoptionsgeometry.sty) (/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty (/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def)) (/usr/share/texlive/texmf-dist/tex/latex/float/float.sty) (/usr/share/texlive/texmf-dist/tex/latex/wrapfig/wrapfig.sty) (/usr/share/texlive/texmf-dist/tex/latex/capt-of/capt-of.sty) (/usr/share/texlive/texmf-dist/tex/latex/tools/multicol.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg))) (./sphinxlatexgraphics.sty) (./sphinxpackageboxes.sty) (./sphinxlatexadmonitions.sty (/usr/share/texlive/texmf-dist/tex/latex/framed/framed.sty)) (./sphinxlatexliterals.sty (/usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix <2008/02/07> (tvz)) (/usr/share/texlive/texmf-dist/tex/latex/base/alltt.sty) (/usr/share/texlive/texmf-dist/tex/latex/upquote/upquote.sty) (/usr/share/texlive/texmf-dist/tex/latex/needspace/needspace.sty)) (./sphinxlatexshadowbox.sty) (./sphinxlatexcontainers.sty) (./sphinxhighlight.sty) (./sphinxlatextables.sty (/usr/share/texlive/texmf-dist/tex/latex/tabulary/tabulary.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty)) (/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty) (/usr/share/texlive/texmf-dist/tex/latex/varwidth/varwidth.sty) (/usr/share/texlive/texmf-dist/tex/latex/colortbl/colortbl.sty)) (./sphinxlatexnumfig.sty (/usr/share/texlive/texmf-dist/tex/latex/carlisle/remreset.sty)) (./sphinxlatexlists.sty) (./sphinxpackagefootnote.sty) (./sphinxlatexindbibtoc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty)) (./sphinxlatexstylepage.sty (/usr/share/texlive/texmf-dist/tex/latex/parskip/parskip.sty) (/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)) (./sphinxlatexstyleheadings.sty (/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty)) (./sphinxlatexstyletext.sty) (./sphinxlatexobjects.sty)) (/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def) (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def) (/usr/share/texlive/texmf-dist/tex/latex/url/url.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hxetex.def (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/stringenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/hypcap.sty) (./sphinxmessages.sty) (/usr/share/texlive/texmf-dist/tex/latex/blindtext/blindtext.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/xspace.sty)) (/usr/share/texlive/texmf-dist/tex/latex/natbib/natbib.sty) Writing index file deply-demo.idx (./deply-demo.aux) (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd) (/usr/share/texlive/texmf-dist/tex/latex/pict2e/pict2e.sty (/usr/share/texlive/texmf-dist/tex/latex/pict2e/pict2e.cfg) (/usr/share/texlive/texmf-dist/tex/latex/pict2e/p2e-xetex.def)) geometry driver: auto-detecting geometry detected driver: xetex (/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) Package hyperref Warning: Rerun to get /PageLabels entry. (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) [1] [2] [1] [2] [1] [2] Chapter 1. No file deply-demo.ind. [3] (./deply-demo.aux) LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right. ) Output written on deply-demo.pdf (7 pages). Transcript written on deply-demo.log. Latexmk: Index file 'deply-demo.idx' was written Latexmk: References changed. Latexmk: Missing input file: 'deply-demo.ind' from line 'No file deply-demo.ind.' Latexmk: References changed. Latexmk: Log file says output to 'deply-demo.pdf' Latexmk: applying rule 'makeindex deply-demo.idx'... Rule 'makeindex deply-demo.idx': File changes, etc: Non-existent destination files: 'deply-demo.ind' ------------ Run number 1 of rule 'makeindex deply-demo.idx' ------------ ------------ Running 'internal xindy -L english -C utf8 -M sphinx.xdy -o "deply-demo.ind" "deply-demo.idx"' ------------ Latexmk: calling xindy( -L english -C utf8 -M sphinx.xdy -o deply-demo.ind deply-demo.idx ) Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': File changes, etc: Changed files, or newly in use since previous run(s): 'deply-demo.aux' 'deply-demo.ind' ------------ Run number 2 of rule 'pdflatex' ------------ ------------ Running 'xelatex -recorder "deply-demo.tex"' ------------ This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017/Debian) (preloaded format=xelatex) restricted write18 enabled. entering extended mode (./deply-demo.tex LaTeX2e <2017-04-15> Babel <3.18> and hyphenation patterns for 84 language(s) loaded. (./sphinxmanual.cls Document Class: sphinxmanual 2019/12/01 v2.3.0 Document class (Sphinx manual) (/usr/share/texlive/texmf-dist/tex/latex/base/report.cls Document Class: report 2014/09/29 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo))) (/usr/share/texlive/texmf-dist/tex/latex/cmap/cmap.sty Package cmap Warning: pdftex not detected - exiting. ) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex) (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/tuenc.def)) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/polyglossia.sty (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/share/texlive/texmf-dist/tex/latex/makecmds/makecmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty) (/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-english.ldf) (/usr/share/texlive/texmf-dist/tex/latex/fncychap/fncychap.sty) (./sphinx.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg) (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/xetex.def)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty))) (./sphinxoptionshyperref.sty) (./sphinxoptionsgeometry.sty) (/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty (/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def)) (/usr/share/texlive/texmf-dist/tex/latex/float/float.sty) (/usr/share/texlive/texmf-dist/tex/latex/wrapfig/wrapfig.sty) (/usr/share/texlive/texmf-dist/tex/latex/capt-of/capt-of.sty) (/usr/share/texlive/texmf-dist/tex/latex/tools/multicol.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg))) (./sphinxlatexgraphics.sty) (./sphinxpackageboxes.sty) (./sphinxlatexadmonitions.sty (/usr/share/texlive/texmf-dist/tex/latex/framed/framed.sty)) (./sphinxlatexliterals.sty (/usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix <2008/02/07> (tvz)) (/usr/share/texlive/texmf-dist/tex/latex/base/alltt.sty) (/usr/share/texlive/texmf-dist/tex/latex/upquote/upquote.sty) (/usr/share/texlive/texmf-dist/tex/latex/needspace/needspace.sty)) (./sphinxlatexshadowbox.sty) (./sphinxlatexcontainers.sty) (./sphinxhighlight.sty) (./sphinxlatextables.sty (/usr/share/texlive/texmf-dist/tex/latex/tabulary/tabulary.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty)) (/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty) (/usr/share/texlive/texmf-dist/tex/latex/varwidth/varwidth.sty) (/usr/share/texlive/texmf-dist/tex/latex/colortbl/colortbl.sty)) (./sphinxlatexnumfig.sty (/usr/share/texlive/texmf-dist/tex/latex/carlisle/remreset.sty)) (./sphinxlatexlists.sty) (./sphinxpackagefootnote.sty) (./sphinxlatexindbibtoc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty)) (./sphinxlatexstylepage.sty (/usr/share/texlive/texmf-dist/tex/latex/parskip/parskip.sty) (/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)) (./sphinxlatexstyleheadings.sty (/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty)) (./sphinxlatexstyletext.sty) (./sphinxlatexobjects.sty)) (/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def) (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def) (/usr/share/texlive/texmf-dist/tex/latex/url/url.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hxetex.def (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/stringenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/hypcap.sty) (./sphinxmessages.sty) (/usr/share/texlive/texmf-dist/tex/latex/blindtext/blindtext.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/xspace.sty)) (/usr/share/texlive/texmf-dist/tex/latex/natbib/natbib.sty) Writing index file deply-demo.idx (./deply-demo.aux) (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd) (/usr/share/texlive/texmf-dist/tex/latex/pict2e/pict2e.sty (/usr/share/texlive/texmf-dist/tex/latex/pict2e/pict2e.cfg) (/usr/share/texlive/texmf-dist/tex/latex/pict2e/p2e-xetex.def)) geometry driver: auto-detecting geometry detected driver: xetex (/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) (./deply-demo.out) (./deply-demo.out) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) [1] [2] (./deply-demo.toc) [1] [2] [1] [2] Chapter 1. (./deply-demo.ind) [3] (./deply-demo.aux) ) Output written on deply-demo.pdf (7 pages). Transcript written on deply-demo.log. Latexmk: Index file 'deply-demo.idx' was written Latexmk: Log file says output to 'deply-demo.pdf' Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': File changes, etc: Changed files, or newly in use since previous run(s): 'deply-demo.out' 'deply-demo.toc' ------------ Run number 3 of rule 'pdflatex' ------------ ------------ Running 'xelatex -recorder "deply-demo.tex"' ------------ This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017/Debian) (preloaded format=xelatex) restricted write18 enabled. entering extended mode (./deply-demo.tex LaTeX2e <2017-04-15> Babel <3.18> and hyphenation patterns for 84 language(s) loaded. (./sphinxmanual.cls Document Class: sphinxmanual 2019/12/01 v2.3.0 Document class (Sphinx manual) (/usr/share/texlive/texmf-dist/tex/latex/base/report.cls Document Class: report 2014/09/29 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo))) (/usr/share/texlive/texmf-dist/tex/latex/cmap/cmap.sty Package cmap Warning: pdftex not detected - exiting. ) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex) (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/tuenc.def)) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/polyglossia.sty (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/share/texlive/texmf-dist/tex/latex/makecmds/makecmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty) (/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-english.ldf) (/usr/share/texlive/texmf-dist/tex/latex/fncychap/fncychap.sty) (./sphinx.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg) (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/xetex.def)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty))) (./sphinxoptionshyperref.sty) (./sphinxoptionsgeometry.sty) (/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty (/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def)) (/usr/share/texlive/texmf-dist/tex/latex/float/float.sty) (/usr/share/texlive/texmf-dist/tex/latex/wrapfig/wrapfig.sty) (/usr/share/texlive/texmf-dist/tex/latex/capt-of/capt-of.sty) (/usr/share/texlive/texmf-dist/tex/latex/tools/multicol.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg))) (./sphinxlatexgraphics.sty) (./sphinxpackageboxes.sty) (./sphinxlatexadmonitions.sty (/usr/share/texlive/texmf-dist/tex/latex/framed/framed.sty)) (./sphinxlatexliterals.sty (/usr/share/texlive/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix <2008/02/07> (tvz)) (/usr/share/texlive/texmf-dist/tex/latex/base/alltt.sty) (/usr/share/texlive/texmf-dist/tex/latex/upquote/upquote.sty) (/usr/share/texlive/texmf-dist/tex/latex/needspace/needspace.sty)) (./sphinxlatexshadowbox.sty) (./sphinxlatexcontainers.sty) (./sphinxhighlight.sty) (./sphinxlatextables.sty (/usr/share/texlive/texmf-dist/tex/latex/tabulary/tabulary.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty)) (/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty) (/usr/share/texlive/texmf-dist/tex/latex/varwidth/varwidth.sty) (/usr/share/texlive/texmf-dist/tex/latex/colortbl/colortbl.sty)) (./sphinxlatexnumfig.sty (/usr/share/texlive/texmf-dist/tex/latex/carlisle/remreset.sty)) (./sphinxlatexlists.sty) (./sphinxpackagefootnote.sty) (./sphinxlatexindbibtoc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty)) (./sphinxlatexstylepage.sty (/usr/share/texlive/texmf-dist/tex/latex/parskip/parskip.sty) (/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)) (./sphinxlatexstyleheadings.sty (/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty)) (./sphinxlatexstyletext.sty) (./sphinxlatexobjects.sty)) (/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def) (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def) (/usr/share/texlive/texmf-dist/tex/latex/url/url.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hxetex.def (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/stringenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/hypcap.sty) (./sphinxmessages.sty) (/usr/share/texlive/texmf-dist/tex/latex/blindtext/blindtext.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/xspace.sty)) (/usr/share/texlive/texmf-dist/tex/latex/natbib/natbib.sty) Writing index file deply-demo.idx (./deply-demo.aux) (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd) (/usr/share/texlive/texmf-dist/tex/latex/pict2e/pict2e.sty (/usr/share/texlive/texmf-dist/tex/latex/pict2e/pict2e.cfg) (/usr/share/texlive/texmf-dist/tex/latex/pict2e/p2e-xetex.def)) geometry driver: auto-detecting geometry detected driver: xetex (/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) (./deply-demo.out) (./deply-demo.out) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) [1] [2] (./deply-demo.toc) [1] [2] [1] [2] Chapter 1. (./deply-demo.ind) [3] (./deply-demo.aux) ) Output written on deply-demo.pdf (7 pages). Transcript written on deply-demo.log. Latexmk: Index file 'deply-demo.idx' was written Latexmk: Log file says output to 'deply-demo.pdf' Latexmk: All targets (deply-demo.pdf) are up-to-date [d2lbook:build.py:L56] INFO === Finished "d2lbook build pdf" in 00:00:04
To deploy to Github, you need to have your machine’s SSH key imported to Github. Otherwise, you may need to type in your account and password. When it is done, you can assess the results online in one or two minutes. For this example, the URL is /d2l-ai.github.io/d2l-book-deploy-demo/.
!cd deploy; d2lbook deploy html pdf
[d2lbook:config.py:L12] INFO Load configure from config.ini
Cloning into '/home/d2l-worker/workspace/d2l-book/docs/_build/eval/user/deploy/_build/github_deploy-git'...
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Exception ignored in: <function GithubDeployer.__del__ at 0x7fa572cf9e50>
Traceback (most recent call last):
File "/home/d2l-worker/miniconda3/envs/d2l-book-build/lib/python3.9/site-packages/d2lbook/deploy.py", line 106, in __del__
run_cmd(['bash', bash_fname, self.git_dir, self.config.deploy['github_repo'], self.config.project['release']])
File "/home/d2l-worker/miniconda3/envs/d2l-book-build/lib/python3.9/site-packages/d2lbook/utils.py", line 152, in run_cmd
exit(-1)
File "/home/d2l-worker/miniconda3/envs/d2l-book-build/lib/python3.9/_sitebuiltins.py", line 26, in __call__
raise SystemExit(code)
SystemExit: -1
Lastly, let’s clean our workspace.
!rm -rf deploy
2.4.2. Deploying Through AWS¶
Another supported option is deploying through AWS. This option provides more flexibility but requires you to know the basic usage of AWS.
We recommend the following procedure for the deployment:
Copying results into S3.
Serving with a CDN by using CloudFront to reduce the latency.
Buying and adding a customized domain at Route 53
Now let’s walk through these three steps one-by-one. Before getting
started, you need to have a valid AWS account and type in your AWS
access
key
by running aws configure
.
First, create a S3 bucket. You can use the targeted domain name as your
bucket name. For example, this site is deployed at book.d2l.ai, then we
created a bucket with the name book.d2l.ai
. In addition, we need to
disable blocking public access through ACLs when creating this bucket,
see Fig. 2.4.2 and enable static website hosting, see
Fig. 2.4.3. Then you will get a URL to access this
bucket. In our example, it’s
http://book.d2l.ai.s3-website-us-west-2.amazonaws.com/.
- width
500px
- width
500px
Second, create a new CloudFront distribution, by specifying the
following options: - Origin Domain Name: the previous S3 URL without
http://
, e.g. book.d2l.ai.s3-website-us-west-2.amazonaws.com
-
Default Root Object: index.html
- [optional] Alternate Domain Names
(CNAMEs): your target domain name, e.g. book.d2l.ai
- [optional] SSL
Certificate: you can create one in Certificate
Manager and then select
it.
After a few minute, we will obtain the domain name such as
d1y0wi2ibwmzrt.cloudfront.net
.
Third, you can either buy a domain at Route 53 or add Route 53’s DNS into your existing domain. After that, create a “Hosted Zone” and then a Type-A Record Set with the CoundFront domain name as the alias target, see Fig. 2.4.4 for an example.
- width
350px
Once you are done, specify your S3 bucket name in the following
config.ini
entry.
[deploy]
s3_bucket = s3://book.d2l.ai
Each time you run d2lbook deploy
, all results will be synchronized
to this bucket and deployed automatically. Note that since we enabled a
CDN, any new change may take a while to be shown in your URL (e.g.
http://book.d2l.ai). But you can check the S3 bucket URL (e.g.
http://book.d2l.ai.s3-website-us-west-2.amazonaws.com) to review the
changes immediately.