nuclio-jupyter icon indicating copy to clipboard operation
nuclio-jupyter copied to clipboard

Feature Request: Build+Deploy from a local directory containing source code and config yaml

Open safurrier opened this issue 4 years ago • 1 comments

Requested feature

As a user ideally I would be able use the python integration to build+deploy a Nuclio function by pointing toward a local directory with source code and a config yaml file (or a zip file containing those)

Currently there is similar functionality available for git or a remote zip archive:

Git python example

addr = nuclio.deploy_file('git://github.com/nuclio/nuclio#master:/hack/examples/python/helloworld',name='hw', project='myproj')

Remote Zip Jupyter example

%nuclio deploy https://myurl.com/projects/myfunc-v1.zip -n myfunc -p myproj

Current Functionality

I can build source code from a local file (e.g. .py file) like so:

my_code, _, _ = build_file('path/to/python_function.py')

I can build the config using the ConfigSpec object like so:

build_commands = ["pip install requests"]
spec = nuclio.ConfigSpec(cmd=build_commands).set_env('foo', 'bar')

And combining these two can deploy like so:

addr = deploy_code(my_code, spec=my_ConfigSpec)

Desired Functionality

It would be great to be able to eliminate the need to use ConfigSpec to build a configuration and instead point to a local directory with a yaml file similar to the functionality for git or remote zip files.

# Build and deploy in one step
addr = deploy_code('path/to/code_and_config/', name='hw', project='myproj')

safurrier avatar Jun 11 '20 22:06 safurrier

I agree, sometimes we have to have multiple *.py files. For instance, most of CVAT models have multiple .py files that can be deploy with nuctl cli tool.

Rusteam avatar Aug 16 '22 10:08 Rusteam