Skip to content

Commit

Permalink
Fixing the docker build when Morpheus is a submodule (#1914)
Browse files Browse the repository at this point in the history
Fixes #1870 by ensuring that the root directory is mounted instead of just the Morpheus repo.

Authors:
  - Michael Demoret (https://github.com/mdemoret-nv)

Approvers:
  - David Gardner (https://github.com/dagardner-nv)

URL: #1914
  • Loading branch information
mdemoret-nv committed Sep 27, 2024
1 parent fdfcbfc commit 56c57f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
9 changes: 5 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,13 @@ FROM conda_env_dev as git_clone
ARG MORPHEUS_ROOT_HOST

# Source the morpheus env to pick up the git-lfs package
RUN --mount=type=bind,source=${MORPHEUS_ROOT_HOST},target=/opt/host_repo \
RUN --mount=type=bind,source=.,target=/opt/host_repo \
source activate morpheus &&\
git clone file:///opt/host_repo /tmp/morpheus_repo &&\
# Use a local clone to allow unpushed commits to be included
git clone file:///opt/host_repo/${MORPHEUS_ROOT_HOST} /tmp/morpheus_repo &&\
cd /tmp/morpheus_repo &&\
git lfs install &&\
/tmp/morpheus_repo/scripts/fetch_data.py fetch datasets examples
./scripts/fetch_data.py fetch datasets examples

# ============ Stage: runtime ============
# Setup container for runtime environment
Expand All @@ -357,7 +358,7 @@ ARG MORPHEUS_ROOT_HOST
# Only copy specific files/folders over that are necessary for runtime
COPY --from=git_clone "/tmp/morpheus_repo/conda/environments/*.yaml" "./conda/environments/"
COPY --from=git_clone "/tmp/morpheus_repo/docker" "./docker"
COPY --from=build_docs "/workspace/build/docs/html" "./docs"
COPY --from=build_docs "/workspace/${MORPHEUS_ROOT_HOST}/build/docs/html" "./docs"
COPY --from=git_clone "/tmp/morpheus_repo/examples" "./examples"
COPY --from=git_clone "/tmp/morpheus_repo/models/datasets" "./models/datasets"
COPY --from=git_clone "/tmp/morpheus_repo/scripts" "./scripts"
Expand Down
12 changes: 2 additions & 10 deletions docs/source/developer_guide/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,7 @@ Note: These instructions assume the user is using `mamba` instead of `conda` sin
- Volta architecture GPU or better
- [CUDA 12.1](https://developer.nvidia.com/cuda-12-1-0-download-archive)
- `conda` and `mamba`
- Refer to the [Getting Started Guide](https://conda.io/projects/conda/en/latest/user-guide/install/index.html) if `conda` is not already installed
- Install `mamba`:
```bash
conda activate base
conda install -c conda-forge mamba
```
- **Note:** `mamba` should only be installed once in the base environment
- If `conda` and `mamba` are not installed, we recommend using the MiniForge install guide which is located [here](https://github.com/conda-forge/miniforge). This will install both `conda` and `mamba` and set the channel default to use `conda-forge`.
1. Set up environment variables and clone the repo:
```bash
Expand All @@ -177,7 +169,7 @@ Note: These instructions assume the user is using `mamba` instead of `conda` sin
cd $MORPHEUS_ROOT
```
1. Ensure all submodules are checked out:
2. Ensure all submodules are checked out:
```bash
git submodule update --init --recursive
Expand Down

0 comments on commit 56c57f1

Please sign in to comment.