Â
I am simplifying my query.
How can I upload a Python library that I have modified to support a function I am deploying to CDF?
**********************************************************************************
Â
I am receiving the below error when executing a function I have created in cdf. If I am understanding the error correctly the suod library is attempting to write to a read-only directory. I have not found the suod library to allow for setting an alternate path.  I did locate the dump command in the cost_predictor.py file, in which I placed commands to write in the /tmp directory. However, I could use some guidance on how to get the altered suod library loaded into cdf with my function? I have attached both the original and updated cost_predictor.py files with code to redirect the dump to the system temp directory and would appreciate any guidance on whether I am on the right path here or not. Thanks in advance!
Â
Error text:
2024-05-16 04:15 Function started
2024-05-16 04:15 : The function terminated unexpectedly. Please contact Cognite support if the problem persists.
2024-05-16 04:15 : _point.py", line 459, in run_handle
2024-05-16 04:15 :Â Â Â Â result = handle(*function_argument_values)
2024-05-16 04:15 :Â Â Â Â Â Â Â Â Â Â Â Â Â ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-05-16 04:15 :Â Â File "/home/site/wwwroot/function/handler.py", line 58, in handle
2024-05-16 04:15 :Â Â Â Â suod_pyod.detect_outliers_suod(df)
2024-05-16 04:15 :Â Â File "/home/site/wwwroot/function/suod_pyod.py", line 38, in detect_outliers_suod
2024-05-16 04:15 :Â Â Â Â clf.fit(detect_outliers_df)
2024-05-16 04:15 :Â Â File "/home/site/wwwroot/.python_packages/lib/site-packages/pyod/models/suod.py", line 205, in fit
2024-05-16 04:15 :Â Â Â Â self.model_.fit(X)
2024-05-16 04:15 :Â Â File "/home/site/wwwroot/.python_packages/lib/site-packages/suod/models/base.py", line 249, in fit
2024-05-16 04:15 :Â Â Â Â build_cost_predictor(
2024-05-16 04:15 :Â Â File "/home/site/wwwroot/.python_packages/lib/site-packages/suod/models/cost_predictor.py", line 117, in build_cost_predictor
2024-05-16 04:15 :Â Â Â Â dump(clf, os.path.join("saved_models", output_file))
2024-05-16 04:15 :Â Â File "/home/site/wwwroot/.python_packages/lib/site-packages/joblib/numpy_pickle.py", line 552, in dump
2024-05-16 04:15 :Â Â Â Â with open(filename, 'wb') as f:
2024-05-16 04:15 :Â Â Â Â Â Â Â Â Â ^^^^^^^^^^^^^^^^^^^^
2024-05-16 04:15 : OSError: Errno 30] Read-only file system: '/home/site/wwwroot/.python_packages/lib/site-packages/suod/models/saved_models/bps_train_curr.joblib'
2024-05-16 04:15 Function ended