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

[FEA]: Use Rapids Dependency Manger For Handling all Dependencies in Morpheus #1389

Closed
12 of 13 tasks
mdemoret-nv opened this issue Nov 27, 2023 · 1 comment
Closed
12 of 13 tasks
Assignees
Labels
dependencies Pull requests that update a dependency file feature request New feature or request

Comments

@mdemoret-nv
Copy link
Contributor

mdemoret-nv commented Nov 27, 2023

Is this a new feature, an improvement, or a change to existing functionality?

New Feature

How would you describe the priority of this feature request

High

Please provide a clear description of problem this feature solves

Currently, to run many of our examples, its required to install the examples dependencies from docker/conda/environments/cuda11.8_examples.yml. Since this file only includes the additional dependencies needed for the examples, its required to first install the dev dependencies. A naive user might do the following:

mamba env update -n morpheus -f docker/conda/environments/cuda11.8_dev.yml
mamba env update -n morpheus -f docker/conda/environments/cuda11.8_examples.yml

Unfortunately, any package restrictions in cuda11.8_dev.yml will not be enforced when updating from cuda11.8_examples.yml. The solution is to first merge the environments and then install the merged environment. This is what happens in CI and looks like:

# Assuming conda-merge has been installed into the base environment
conda-merge docker/conda/environments/cuda11.8_dev.yml docker/conda/environments/cuda11.8_examples.yml > /tmp/merged_env.yml

# Install the merged environment with --prune
mamba env update -n morpheus --prune -f /tmp/merged_env.yml

This is cumbersome, prone to errors and hard to remember.

Describe your ideal solution

Instead, we should use rapids dependency file generator (see here for how to use it) to manage all dependencies in the Morpheus repo combined with some simple scripts.

Using the dependency file generator has several advantages:

  1. Allows using a single file as the source of truth for all dependencies
  2. Allows for chaining dependencies together
    1. i.e. llm_examples -> examples_common -> dev -> runtime
  3. Can generate both conda and pip environment files
  4. More feature rich than using conda-merge

Completion Criteria

  • Update dependencies.yaml in the project root (file exists already but is not used)
    • Add dependency sections for runtime, dev, examples, docs, testing and any other useful dependency groupings
    • Ensure the values contained in the current conda environment files are mirrored in dependencies.yaml
  • Delete the environment files in docker/conda/environments
  • Update CI to use rapids-dependency-file-generator
  • Update documentation to show how to install dependencies with the new tool
  • Reassess the current dependencies
    • Any dependency which is only used by a single stage or single example should be converted to an optional dependency
    • Dependencies which are no longer required or not directly used in the repo should be removed
  • [Optional] Create a utility script to run rapids-dependency-file-generator and update the environment in a single command

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I have searched the open feature requests and have found no duplicates for this feature request
@mdemoret-nv mdemoret-nv added dependencies Pull requests that update a dependency file feature request New feature or request labels Nov 27, 2023
@dagardner-nv dagardner-nv self-assigned this Dec 1, 2023
@dagardner-nv dagardner-nv moved this from Todo to In Progress in Morpheus Boards Dec 1, 2023
@mdemoret-nv mdemoret-nv assigned cwharris and unassigned dagardner-nv Dec 5, 2023
rapids-bot bot pushed a commit that referenced this issue Dec 21, 2023
Adds rapids-dependency-file-generator pre-commit checks for local and CI, and updates scripts to use the generated environment files.

Contributes to #1389 

## 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:
  - Christopher Harris (https://github.com/cwharris)

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

URL: #1441
@cwharris
Copy link
Contributor

cwharris commented Feb 9, 2024

Fixed by #1468

@cwharris cwharris closed this as completed Feb 9, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Morpheus Boards Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file feature request New feature or request
Projects
Status: Done
Development

No branches or pull requests

3 participants