api/server/swagger_server/code_templates/serve_kubernetes.TEMPLATE.py
def model_pipeline(model_id='${model_identifier}'):
    """A pipeline for ML/DL model deployment."""

    from kfp import dsl
    from ai_pipeline_params import use_ai_pipeline_params

    secret_name = 'e2e-creds'

    model_config = dsl.ContainerOp(
        name='model_config',
        image='tomcli/model-config',
        command=['python'],
        arguments=[
            '-u', 'model-config.py',
            '--secret_name', secret_name,
            '--model_id', model_id
        ],
        file_outputs={
            'model-serving-image': '/tmp/model_serving_image',
            'deployment-name': '/tmp/deployment_name'
        }
    )

    model_deployment = dsl.ContainerOp(
        name='k8s_model_deployment',
        image='aipipeline/deployment-k8s-remote',
        command=['python'],
        arguments=[
            '-u', 'kube_deployment.py',
            '--model_serving_image', model_config.outputs['model-serving-image'],
            '--deployment_name', model_config.outputs['deployment-name']
        ],
        file_outputs={
            'output': '/tmp/log.txt'
        }
    )

    model_deployment.apply(use_ai_pipeline_params(secret_name))
A pipeline for ML/DL model deployment.
A pipeline for ML/DL model deployment.
A pipeline for ML / DL model deployment .
def model_pipeline(model_id='${model_identifier}'):
    from kfp import dsl
    from ai_pipeline_params import use_ai_pipeline_params
    secret_name = 'e2e-creds'
    model_config = dsl.ContainerOp(
        name='model_config',
        image='tomcli/model-config',
        command=['python'],
        arguments=[
            '-u', 'model-config.py',
            '--secret_name', secret_name,
            '--model_id', model_id
        ],
        file_outputs={
            'model-serving-image': '/tmp/model_serving_image',
            'deployment-name': '/tmp/deployment_name'
        }
    )
    model_deployment = dsl.ContainerOp(
        name='k8s_model_deployment',
        image='aipipeline/deployment-k8s-remote',
        command=['python'],
        arguments=[
            '-u', 'kube_deployment.py',
            '--model_serving_image', model_config.outputs['model-serving-image'],
            '--deployment_name', model_config.outputs['deployment-name']
        ],
        file_outputs={
            'output': '/tmp/log.txt'
        }
    )
    model_deployment.apply(use_ai_pipeline_params(secret_name))
def model_pipeline ( model_id = '${model_identifier}' ) : from kfp import dsl from ai_pipeline_params import use_ai_pipeline_params secret_name = 'e2e-creds' model_config = dsl . ContainerOp ( name = 'model_config' , image = 'tomcli/model-config' , command = [ 'python' ] , arguments = [ '-u' , 'model-config.py' , '--secret_name' , secret_name , '--model_id' , model_id ] , file_outputs = { 'model-serving-image' : '/tmp/model_serving_image' , 'deployment-name' : '/tmp/deployment_name' } ) model_deployment = dsl . ContainerOp ( name = 'k8s_model_deployment' , image = 'aipipeline/deployment-k8s-remote' , command = [ 'python' ] , arguments = [ '-u' , 'kube_deployment.py' , '--model_serving_image' , model_config . outputs [ 'model-serving-image' ] , '--deployment_name' , model_config . outputs [ 'deployment-name' ] ] , file_outputs = { 'output' : '/tmp/log.txt' } ) model_deployment . apply ( use_ai_pipeline_params ( secret_name ) )
A pipeline for ML/DL model deployment.
A pipeline for ML / DL model deployment .
"""A pipeline for ML/DL model deployment."""
model_id