forked from mlflow/mlflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stronger projects CLI test verifying that conda environment is us…
…ed to run projects (mlflow#300)
- Loading branch information
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Import a dependency in MLflow's setup.py that's in our conda.yaml but not included with MLflow | ||
# by default, verify that we can use it. | ||
|
||
import os | ||
import sys | ||
|
||
import psutil | ||
|
||
import mlflow | ||
|
||
|
||
def main(expected_env_name): | ||
actual_conda_env = os.environ.get("CONDA_DEFAULT_ENV", None) | ||
assert actual_conda_env == expected_env_name,\ | ||
"Script expected to be run from conda env %s but was actually run from env" \ | ||
" %s" % (expected_env_name, actual_conda_env) | ||
mlflow.log_metric("CPU usage", psutil.cpu_percent()) | ||
|
||
|
||
if __name__ == "__main__": | ||
main(sys.argv[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters