这里,我附加实际错误显示。我使用mlrun与docker。特别是mlrun 1.2.0。
--------------------------------------------------------------------------
RunError Traceback (most recent call last)
<ipython-input-20-aab97e08b914> in <module>
1 serving_fn.with_code(body=" ") # adds the serving wrapper, not required with MLRun >= 1.0.3
----> 2 project.deploy_function(serving_fn)
/opt/conda/lib/python3.8/site-packages/mlrun/projects/project.py in deploy_function(self, function, dashboard, models, env, tag, verbose, builder_env, mock)
2307 :param mock: deploy mock server vs a real Nuclio function (for local simulations)
2308 """
-> 2309 return deploy_function(
2310 function,
2311 dashboard=dashboard,
/opt/conda/lib/python3.8/site-packages/mlrun/projects/operations.py in deploy_function(function, dashboard, models, env, tag, verbose, builder_env, project_object, mock)
344 )
345
--> 346 address = function.deploy(
347 dashboard=dashboard, tag=tag, verbose=verbose, builder_env=builder_env
348 )
/opt/conda/lib/python3.8/site-packages/mlrun/runtimes/serving.py in deploy(self, dashboard, project, tag, verbose, auth_info, builder_env)
621 logger.info(f"deploy root function {self.metadata.name} ...")
622
--> 623 return super().deploy(
624 dashboard, project, tag, verbose, auth_info, builder_env=builder_env
625 )
/opt/conda/lib/python3.8/site-packages/mlrun/runtimes/function.py in deploy(self, dashboard, project, tag, verbose, auth_info, builder_env)
550 self.status = data["data"].get("status")
551 self._update_credentials_from_remote_build(data["data"])
--> 552 self._wait_for_function_deployment(db, verbose=verbose)
553
554 # NOTE: on older mlrun versions & nuclio versions, function are exposed via NodePort
/opt/conda/lib/python3.8/site-packages/mlrun/runtimes/function.py in _wait_for_function_deployment(self, db, verbose)
620 if state != "ready":
621 logger.error("Nuclio function failed to deploy", function_state=state)
--> 622 raise RunError(f"function {self.metadata.name} deployment failed")
623
624 @min_nuclio_versions("1.5.20", "1.6.10")
RunError: function serving deployment failed
我不知道这个错误背后的原因是什么。因为我是新来的。所以有人请帮助我解决这个错误。
我看到两个步骤,如何解决这个问题:
1。有关安装
桌面docker中的MLRun Community Edition必须安装在相关的HOST_IP(不是localhost或127.0.0.1,而是稳定的IP地址,参见ipconfig)和相关的SHARED_DIR下。参见相关命令行(从OS窗口):
set HOST_IP=192.168.0.150
set SHARED_DIR=c:Appsmlrun-data
set TAG=1.2.0
mkdir %SHARED_DIR%
docker-compose -f "c:AppsDesktop Docker Toolscompose.with-jupyter.yaml" up
BTW: YAML文件见https://docs.mlrun.org/en/latest/install/local-docker.html
2。访问端口
在呼叫serving_fn.invoke
的情况下,您必须在您的IP地址(基于HOST_IP的设置,参见第一点)上打开相关端口(从deploy_function
)。
通常可以根据您的防火墙策略或本地防病毒来阻止此端口。这意味着,您必须在调用调用之前打开对该端口的访问。
顺便说一句:你可以看到焦点问题https://github.com/mlrun/mlrun/issues/2102