From a88a6fa747c036417cfdfaa634db7998418286f3 Mon Sep 17 00:00:00 2001 From: David Gardner <96306125+dagardner-nv@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:22:40 -0700 Subject: [PATCH] Install built documentation into release container (#1806) * Copy built documentation into the `docs` dir rather than the documentation source. * Add a new docker stage `build_docs` Closes #1788 ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/nv-morpheus/Morpheus/blob/main/docs/source/developer_guide/contributing.md). - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Michael Demoret (https://github.com/mdemoret-nv) URL: https://github.com/nv-morpheus/Morpheus/pull/1806 --- docker/Dockerfile | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 6f67668571..875d935c7d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -21,6 +21,8 @@ # [base] -> [conda_env] -> [base_extended] -> [runtime_conda_create] -> [runtime] # \ # [conda_env_dev] -> [development] -> [development_pydbg] +# \ +# [build_docs] # # base: Contains all system packages common across all environments # conda_env: Create morpheus conda environment and set it as the new base @@ -35,6 +37,7 @@ # source directory. # development_pydbg: Development + debug build of cpython and various GDB # debugging macros. +# build_docs: Build the Morpheus documentation # ========================================================================= # # Args used in FROM commands must come first @@ -220,6 +223,35 @@ RUN --mount=type=cache,id=workspace_cache,target=/workspace/.cache,sharing=locke cd ${MORPHEUS_ROOT_HOST} &&\ MORPHEUS_PYTHON_BUILD_STUBS=OFF CONDA_BLD_PATH=/opt/conda/conda-bld ./ci/conda/recipes/run_conda_build.sh morpheus +# ============ Stage: build_docs ============ +# Now build the morpheus docs +FROM conda_env_dev as build_docs + +ARG MORPHEUS_ROOT_HOST + +# Copy the source +COPY . ./ + +RUN --mount=type=cache,id=workspace_cache,target=/workspace/.cache,sharing=locked \ + --mount=type=bind,from=conda_bld_morpheus,source=/opt/conda/conda-bld,target=/opt/conda/conda-bld \ + --mount=type=cache,id=conda_pkgs,target=/opt/conda/pkgs,sharing=locked \ + source activate morpheus &&\ + CONDA_ALWAYS_YES=true /opt/conda/bin/mamba install -n morpheus \ + -c local \ + -c conda-forge \ + -c huggingface \ + -c rapidsai \ + -c rapidsai-nightly \ + -c nvidia \ + -c nvidia/label/dev \ + -c pytorch \ + -c defaults \ + morpheus && \ + # Change to the morpheus directory and build the docs + cd ${MORPHEUS_ROOT_HOST} &&\ + CMAKE_CONFIGURE_EXTRA_ARGS="-DMORPHEUS_BUILD_DOCS=ON -DMORPHEUS_PYTHON_BUILD_STUBS=OFF -DMORPHEUS_CUDA_ARCHITECTURES=RAPIDS"\ + ./scripts/compile.sh --target morpheus_docs + # ============ Stage: runtime_conda_create ============ # Setup conda for the runtime environment FROM base_extended as runtime_conda_create @@ -260,7 +292,7 @@ ARG MORPHEUS_ROOT_HOST # Only copy specific files/folders over that are necessary for runtime COPY "${MORPHEUS_ROOT_HOST}/conda/environments/*.yaml" "./conda/environments/" COPY "${MORPHEUS_ROOT_HOST}/docker" "./docker" -COPY "${MORPHEUS_ROOT_HOST}/docs" "./docs" +COPY --from=build_docs "/workspace/build/docs/html" "./docs" COPY "${MORPHEUS_ROOT_HOST}/examples" "./examples" COPY "${MORPHEUS_ROOT_HOST}/models" "./models" COPY "${MORPHEUS_ROOT_HOST}/scripts" "./scripts"