How do I deploy a Nuclio function with MLRun?

223 Views Asked by At

I need an example of deploying a Nuclio function using MLRun.

  • I have my code in a .py file
  • How do I use MLRun to deploy this function to Nuclio?
  • How do I configure the HTTP endpoint? (using a specified port)
1

There are 1 best solutions below

0
On BEST ANSWER

You should follow these steps:

  1. Call to code_to_function as in this example:
fn = code_to_function(name='data-generator', handler='main', kind='job', filename='functions/code.py')
  1. Invoke with_http on the function:
fn.with_http(host='URL_path', port=port_number)
  1. Deploy the function:
fn.deploy()