1

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 Answers1

1

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()
Edmond
  • 46
  • 3