如何使用 MLRun 部署 Nuclio 函数?
How do I deploy a Nuclio function with MLRun?
我需要一个使用 MLRun 部署 Nuclio 函数的示例。
- 我的代码在 .py 文件中
- 如何使用 MLRun 将此功能部署到 Nuclio?
- 如何配置 HTTP 端点? (使用指定端口)
您应该按照以下步骤操作:
- 调用
code_to_function
,如本例所示:
fn = code_to_function(name='data-generator', handler='main', kind='job', filename='functions/code.py')
- 调用
with_http
函数:
fn.with_http(host='URL_path', port=port_number)
- 部署函数:
fn.deploy()
我需要一个使用 MLRun 部署 Nuclio 函数的示例。
- 我的代码在 .py 文件中
- 如何使用 MLRun 将此功能部署到 Nuclio?
- 如何配置 HTTP 端点? (使用指定端口)
您应该按照以下步骤操作:
- 调用
code_to_function
,如本例所示:
fn = code_to_function(name='data-generator', handler='main', kind='job', filename='functions/code.py')
- 调用
with_http
函数:
fn.with_http(host='URL_path', port=port_number)
- 部署函数:
fn.deploy()