allegroai / clearml

ClearML - Auto-Magical CI/CD to streamline your AI workload. Experiment Management, Data Management, Pipeline, Orchestration, Scheduling & Serving in one MLOps/LLMOps solution
https://clear.ml/docs
Apache License 2.0
5.61k stars 651 forks source link

Trying to load models from behind a proxy is not possible #1068

Open robinvd opened 1 year ago

robinvd commented 1 year ago

Describe the bug

Trying to load models from behind a proxy is not possible

To reproduce

We self host clearml, and its not generally available. Because of a little weird proxy setup its not always available at the same url. But with settings the correct env variables it all works fine. Except when trying to load files. The metadata is loaded from the api but then it will just blindly download the url specified in the artifact/model.

example model:

ID: fa09d469325c4281845381db82ddbac0
CREATED AT: Jun 7 2023 11:32
UPDATED AT: Jun 7 2023 11:32
FRAMEWORK: ONNX
STATUS: Draft
MODEL URL: https://files.main-clearml-url/trainings/train.f18fd5ac4d3b48cfb1bb1ccfeb937506/models/model.onnx
# run.py
InputModel("fa09d469325c4281845381db82ddbac0").get_local_copy()
export CLEARML_WEB_HOST=https://web.proxy-to-clearml
export CLEARML_API_HOST=https://api.proxy-to-clearml
export CLEARML_FILES_HOST=https://files.proxy-to-clearml
./run.py

output (from clearml-serving)

2023-07-04 11:40:28,479 - clearml.storage - ERROR - Could not download https://files.main-clearml-url/trainings/train.f18fd5ac4d3b48cfb1bb1ccfeb937506/models/model.onnx , err: Failed getting object https://files.main-clearml-url/trainings/train.f18fd5ac4d3b48cfb1bb1ccfeb937506/models/model.onnx (403): Forbidden
Error retrieving model ID fa09d469325c4281845381db82ddbac0 []

Expected behaviour

The model is loaded correctly

Environment