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

Add CLI Relative Path Fallback #232

Merged

Conversation

mdemoret-nv
Copy link
Contributor

In PR #130 we moved the data directory into morpheus/data and installed it with the python package. This required changing some of the default CLI arguments from relative paths like data/labels_nlp.txt to absolute paths like morpheus.DATA_DIR/labels_nlp.txt.

To make it easy for the user to see how to change the labels file, we respecified the default argument value in documentation (i.e. --labels_file=data/labels_nlp.txt). Now that this needs to be an absolute path, the command in the documentation does not work. Adding absolute paths in the documentation is not feasible since this would require very long paths that would change from machine to machine.

Instead, if the user specifies a data file with a relative path, we first check to see if a file exists relative to the current working directory. If it doesnt exist, then we check for a relative file to the current morpheus install. This allows commands from the documentation like: morpheus run pipeline-nlp --labels_file=data/labels_nlp.txt to find the correct path. We only choose the fallback value when no other file is found.

Related to PR #200

@mdemoret-nv mdemoret-nv added non-breaking Non-breaking change feature request New feature or request labels Jun 28, 2022
@mdemoret-nv mdemoret-nv requested a review from a team as a code owner June 28, 2022 21:55
@mdemoret-nv
Copy link
Contributor Author

Merging this to test with release packages tomorrow.

@mdemoret-nv
Copy link
Contributor Author

@gpucibot merge

@ghost ghost merged commit 7684908 into nv-morpheus:branch-22.06 Jun 29, 2022
@mdemoret-nv mdemoret-nv deleted the mdd_add-cli-relative-fallback branch June 29, 2022 03:55
pdmack added a commit that referenced this pull request Jul 18, 2022
Similar set of changes found elsewhere to account for data dir relocations.
Relates to #232 and #242
ghost pushed a commit that referenced this pull request Jul 25, 2022
Similar set of changes found elsewhere to account for data dir relocations.
Relates to #232 and #242

Authors:
  - Pete MacKinnon (https://github.com/pdmack)

Approvers:
  - Christopher Harris (https://github.com/cwharris)
  - Michael Demoret (https://github.com/mdemoret-nv)
  - David Gardner (https://github.com/dagardner-nv)

URL: #284
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants