nimblebox logo
Docs
v3.3.1b

nbox.network

Network functions are gateway between NBX-Services.

If you find yourself using this reach out to NimbleBox support.

But for the curious mind, many of our services work on gRPC and Protobufs. This network.py manages the quirkyness of our backend and packs multiple steps as one function.

Functions

iconfunctiondeploy_serving
[source]
(init_folder:str,serving_name:str,model_name:str,serving_id:str,workspace_id:str,resource:Resource,wait_for_deployment:bool,model_metadata:dict,exe_jinja_kwargs:dict)
Parameters
  • init_folder -

    Path to the code

  • serving_name -

    Name of the serving

  • model_name -

    Name of the model

  • serving_id -

    Serving ID. Defaults to None.

  • workspace_id -

    Workspace ID. Defaults to None.

  • resource -

    Resource. Defaults to None.

  • wait_for_deployment -

    Wait for deployment. Defaults to False.

  • model_metadata -

    Model metadata. Defaults to {}.

  • exe_jinja_kwargs -

    Jinja kwargs. Defaults to {}.

Use the NBX-Deploy Infrastructure

iconfunction_upload_serving_zip
[source]
iconfunctiondeploy_job
[source]
(init_folder:str,job_id_or_name:Union[str, int],dag:DAG,workspace_id:str,schedule:Schedule,cache_dir:str)
Parameters
  • init_folder -

    Name the folder to zip

  • job_id_or_name -

    Name or ID of the job

  • dag -

    DAG to upload

  • workspace_id -

    Workspace ID to deploy to, if not specified, will use the personal workspace

  • schedule -

    If None will run only once, else will schedule the job

  • cache_dir -

    Folder where to put the zipped file, if None will be tempdir

Upload code for a NBX-Job.

Returns:

  • Job: Job object
iconfunction_upload_job_zip
[source]
iconfunctionzip_to_nbox_folder
[source]
(init_folder:str,id:str,workspace_id:str,type:OT_TYPE,files_to_copy:Dict[str, str],**jinja_kwargs:None)
Parameters
  • init_folder -

    The folder that contains the files to be zipped

  • id -

    The id of the job or serving

  • workspace_id -

    The workspace id of the job or serving

  • type -

    The type of the job or serving, comes from nbxlib.operator_spec.OT_TYPE

  • files_to_copy -

    A dictionary of source to target filepaths to copy to the zip file. Defaults to {}.

  • **jinja_kwargs -

    Any additional arguments to be passed to the jinja template

This function creates the zip file that is ulitimately uploaded to NBX-Serving or NBX-Jobs.

nbox SDKnbox provides built in access to all the APIs and packages them in the most user friendly manner.Star 0