Skip to content

Commit

Permalink
Install built documentation into release container (#1806)
Browse files Browse the repository at this point in the history
* 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: #1806
  • Loading branch information
dagardner-nv authored Jul 24, 2024
1 parent 134cee7 commit a88a6fa
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit a88a6fa

Please sign in to comment.