nv-morpheus / Morpheus

Morpheus SDK
Apache License 2.0
362 stars 135 forks source link

[BUG]: building `runtime` target fails at `git_clone` when Morpheus is a submodule #1870

Closed ashsong-nv closed 1 month ago

ashsong-nv commented 2 months ago

Version

24.10

Which installation method(s) does this occur on?

Docker

Describe the bug.

When trying to build the Morpheus Docker container using the runtime target, the build fails at the git_clone stage.

The relevant line in the error log is the following:

#0 0.570 fatal: not a git repository: /opt/host_repo/../../.git/modules/morpheus

I believe the issue is in Dockerfile lines 298-300. This command does a local clone from an existing cloned morpheus repo located at MORPHEUS_ROOT_HOST using the info in its .git/ directory. However, when morpheus is a submodule, the .git file points to the relative path ../../.git/modules/morpheus, which doesn't get mounted to the container and therefore doesn't exist.

Minimum reproducible example

From within the submodule root:

MORPHEUS_ROOT_HOST=. ./docker/build_container_release.sh

Relevant log output

Click here to see error details

```
=> ERROR [git_clone 1/1] RUN --mount=type=bind,source=.,target=/opt/host_repo     source activate morpheus &&    git clone file:///opt/host_repo /tmp/morp  0.6s
 => CANCELED [conda_bld_morpheus 3/3] RUN --mount=type=cache,id=workspace_cache,target=/workspace/.cache,sharing=locked     --mount=type=cache,id=conda_pkg  0.4s
------                                                                                                                                                            
 > [git_clone 1/1] RUN --mount=type=bind,source=.,target=/opt/host_repo     source activate morpheus &&    git clone file:///opt/host_repo /tmp/morpheus_repo &&    cd /tmp/morpheus_repo &&    git lfs install &&    /tmp/morpheus_repo/scripts/fetch_data.py fetch datasets examples:
#0 0.565 Cloning into '/tmp/morpheus_repo'...
#0 0.570 fatal: not a git repository: /opt/host_repo/../../.git/modules/morpheus
#0 0.571 fatal: Could not read from remote repository.
#0 0.571 
#0 0.571 Please make sure you have the correct access rights
#0 0.571 and the repository exists.
------
Dockerfile:298
--------------------
 297 |     # Source the morpheus env to pick up the git-lfs package
 298 | >>> RUN --mount=type=bind,source=${MORPHEUS_ROOT_HOST},target=/opt/host_repo \
 299 | >>>     source activate morpheus &&\
 300 | >>>     git clone file:///opt/host_repo /tmp/morpheus_repo &&\
 301 | >>>     cd /tmp/morpheus_repo &&\
 302 | >>>     git lfs install &&\
 303 | >>>     /tmp/morpheus_repo/scripts/fetch_data.py fetch datasets examples
 304 |     
--------------------
ERROR: failed to solve: process "/bin/bash -c source activate morpheus &&    git clone file:///opt/host_repo /tmp/morpheus_repo &&    cd /tmp/morpheus_repo &&    git lfs install &&    /tmp/morpheus_repo/scripts/fetch_data.py fetch datasets examples" did not complete successfully: exit code: 128
```

Full env printout

Click here to see environment details

 [Paste the results of print_env.sh here, it will be hidden by default]

Other/Misc.

Relevant PR and comment:

Code of Conduct

morpheus-bot-test[bot] commented 2 months ago

Hi @ashsong-nv!

Thanks for submitting this issue - our team has been notified and we'll get back to you as soon as we can! In the meantime, feel free to add any relevant information to this issue.