How to use the hydrosdk.sdk.Application function in hydrosdk

To help you get started, we’ve selected a few hydrosdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Hydrospheredata / kubeflow-workshop / steps / deploy / deploy.py View on Github external
def main(model_name, model_version, application_name, hydrosphere_uri, *args, **kwargs):
    logger.info(f"Referencing existing model `{model_name}:{model_version}`")
    model = sdk.Model.from_existing(model_name, model_version)
    logger.info(f"Creating singular application `{application_name}`")
    application = sdk.Application.singular(application_name, model)
    logger.info(f"Applying application to the cluster `{hydrosphere_uri}`")
    result = application.apply(hydrosphere_uri)
    logger.info(pprint.pformat(result))
github Hydrospheredata / kubeflow-workshop / 06_deploy-to-prod / deploy.py View on Github external
import argparse
import os
from hydrosdk import sdk

if __name__ == '__main__': 
    parser = argparse.ArgumentParser()
    
    parser.add_argument('--model-version', required=True)
    parser.add_argument('--model-name', required=True)
    parser.add_argument('--hydrosphere-address', required=True)
    
    args = parser.parse_args()

    app_name = f'{args.model_name}-app'
    model = sdk.Model.from_existing(args.model_name, args.model_version)
    application = sdk.Application.singular(app_name, model)
    
    result = application.apply(args.hydrosphere_address)
    print(result, flush=True)
github Hydrospheredata / kubeflow-workshop / 04_deploy / deploy.py View on Github external
from hydrosdk import sdk


if __name__ == '__main__': 
    parser = argparse.ArgumentParser()
    parser.add_argument('--model-version', required=True)
    parser.add_argument('--model-name', required=True)
    parser.add_argument('--application-name-postfix', required=True)
    parser.add_argument('--hydrosphere-address', required=True)
    parser.add_argument('--dev', help='Flag for development purposes', action="store_true")
    
    args = parser.parse_args()

    application_name = f"{args.model_name}{args.application_name_postfix}"
    model = sdk.Model.from_existing(args.model_name, args.model_version)
    application = sdk.Application.singular(application_name, model)
    result = application.apply(args.hydrosphere_address)
    print(result, flush=True)

    with open("./application_name.txt" if args.dev else "/application_name.txt", "w+") as file:
        file.write(application_name)

    with open("./application_link.txt" if args.dev else "/application_link.txt", "w+") as file:
        file.write(urllib.parse.urljoin(args.hydrosphere_address, f"applications/{application_name}"))

hydrosdk

This package's purpose is to provide a simple and convenient way of integrating user's workflow scripts with Serving API.

Apache-2.0
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis