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

Build the PDF docs on Buildkite #199

Merged
merged 4 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pipelines/main/launch_unsigned_jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ steps:
commands: |
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/analyzegc.yml
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/doctest.yml
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/pdf_docs/build_pdf_docs.yml
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/embedding.yml
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/llvmpasses.yml
buildkite-agent pipeline upload .buildkite/pipelines/main/misc/whitespace.yml
Expand Down
51 changes: 51 additions & 0 deletions pipelines/main/misc/pdf_docs/build_pdf_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
steps:
- group: "Check"
steps:
- label: "pdf_docs_build"
key: pdf_docs_build
depends_on:
- "build_x86_64-linux-gnu"
plugins:
- JuliaCI/external-buildkite#v1:
version: "./.buildkite-external-version"
repo_url: "https://github.com/JuliaCI/julia-buildkite"
- JuliaCI/julia#v1:
# Drop default "registries" directory, so it is not persisted from execution to execution
persist_depot_dirs: packages,artifacts,compiled
version: '1'
- staticfloat/sandbox#v1:
rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/v5.38/latex.x86_64.tar.gz
rootfs_treehash: "be2d12d899ee334c470a79f6d3f3faa4e63c7c3c"
uid: 1000
gid: 1000
workspaces:
# Include `/cache/repos` so that our `git` version introspection works.
- "/cache/repos:/cache/repos"
commands: |
echo "--- Download pre-built julia, extract into usr/"
buildkite-agent artifact download --step "build_x86_64-linux-gnu" 'julia-*-linux-x86_64.tar.gz' .
mkdir -p ./usr
tar -C ./usr --strip-components=1 -zxf julia-*-linux-x86_64.tar.gz
ln -s ./usr/bin/julia ./julia

echo "--- Print Julia version info"
export JULIA_NUM_THREADS=1
./julia -e 'using InteractiveUtils; InteractiveUtils.versioninfo()'

echo "--- Set some environment variables and create some directories"
export DOCUMENTER_LATEX_DEBUG="$$(pwd)/latex-debug-logs"
mkdir -p $${DOCUMENTER_LATEX_DEBUG:?}
echo "DOCUMENTER_LATEX_DEBUG is $${DOCUMENTER_LATEX_DEBUG:?}"

echo "--- Build the PDF"
./julia .buildkite/pipelines/main/misc/pdf_docs/make.jl

echo "--- Upload the PDF files as Buildkite artifacts"
find . -type f -name "*.pdf"
cd doc/_build/pdf/en && buildkite-agent artifact upload TheJuliaLanguage.pdf
timeout_in_minutes: 120
agents:
queue: "julia"
sandbox_capable: "true"
os: "linux"
arch: "x86_64"
20 changes: 20 additions & 0 deletions pipelines/main/misc/pdf_docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const root_pipelines_main_misc_pdfdocs = @__DIR__
const root_pipelines_main_misc = dirname(root_pipelines_main_misc_pdfdocs)
const root_pipelines_main = dirname(root_pipelines_main_misc)
const root_pipelines = dirname(root_pipelines_main)
const root = dirname(root_pipelines)
const root_utilities = joinpath(root, "utilities")
include(joinpath(root_utilities, "proc_utils.jl"))

documenter_latex_debug = ENV["DOCUMENTER_LATEX_DEBUG"]
@info "" documenter_latex_debug

julia_executable = Base.julia_cmd().exec[1]
cmd = `make -C doc pdf JULIA_EXECUTABLE=$(julia_executable)`
proc = run(ignorestatus(cmd))

rm("latex-debug-logs.tar.gz"; force = true)
run(`tar czvf latex-debug-logs.tar.gz $(documenter_latex_debug)`)
run(`buildkite-agent artifact upload latex-debug-logs.tar.gz`)

mirror_exit_code(proc)