Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nuclio components (to build/deploy, delete, invoke functions) #1295

Merged
merged 3 commits into from
May 8, 2019

Conversation

yaronha
Copy link
Contributor

@yaronha yaronha commented May 7, 2019

add component to deploy & customize nuclio functions from code/notebook/zip/git, delete functions, and invoke running functions.
see: README.md and https://github.com/nuclio/nuclio-jupyter and https://github.com/nuclio/nuclio


This change is Reviewable

@k8s-ci-robot
Copy link
Contributor

Hi @yaronha. Thanks for your PR.

I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

1 similar comment
@k8s-ci-robot
Copy link
Contributor

Hi @yaronha. Thanks for your PR.

I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@yaronha yaronha changed the title add nuclio components (to build/deploy, delete, invoke) add nuclio components (to build/deploy, delete, invoke functions) May 7, 2019
@yaronha
Copy link
Contributor Author

yaronha commented May 7, 2019

@Ark-kun @jlewi i looked at the CI logs, seems that the errors are not related to the code i pushed, suggestions ?

@yaronha
Copy link
Contributor Author

yaronha commented May 7, 2019

/assign @Ark-kun

description: delete a nuclio function.
inputs:
- {name: Name, type: String, description: 'function name'}
- {name: Namespace, type: String, description: 'Kubernetes namespace', default: ''}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see the Namespace being passed to the program.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ark-kun i will add

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ark-kun BTW is there a way to pass options w/o values ? e.g. we have -v option for verbose, it doesn't accept a value, just will turn on verbose if the flag exists. if i add it now it will always add -v to the call and i rather not change the executable to accept -v=true

- {name: Env, type: String, description: 'override function env var, Json {key: value, ..}', default: ''}
- {name: Mount, type: String, description: 'volume mount, [vol-type:]<vol-url>:<dst-path>', default: ''}
outputs:
- {name: address, type: String, description: 'function endpoint url'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename address to Endpoint (in two places)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does a function 'deployment' mean? i believe this is more like 'execute' a function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ark-kun renamed

@animeshsingh deploy takes code + extra files + spec (from code, notebook, zip, git, ..), builds a container, and creates the CRD/deployment for it. a function may be invoked independently e.g. when its doing model serving or ETL from a Kafka/pubsub topic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see more details/examples on how deploy works in: https://github.com/nuclio/nuclio-jupyter

@Ark-kun
Copy link
Contributor

Ark-kun commented May 8, 2019

the errors are not related to the code i pushed

I've restarted the tests. It should be fine.

--mount, {inputValue: Mount},
]
fileOutputs:
address: /tmp/output
Copy link
Contributor

@Ark-kun Ark-kun May 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI: For future, it's better to have this path passed to the program and not hardcoded in the code.

In
https://github.com/nuclio/nuclio-jupyter/blob/66825220ac659f59d1555ca77568aeecce850e49/nuclio/deploy.py#L69
you should use something like

parser.add_argument('--endpoint-output-file', ...)
...
from pathlib import Path
Path(args.endpoint_output_file).parent.mkdir(parents=True, exist_ok=True)
Path(args.endpoint_output_file).write_text(addr)

and then in component.yaml in the implementation.container.command array you just add --endpoint-output-file, {outputPath: address} and remove the fileOutputs section which should only be used as a workaround for programs with hard-coded paths.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ark-kun the address is just an endpoint string (<addr>:<port>), not a file, and it is only written once in the life of that container (container will exit when its done), so instead of writing to arbitrary path or loading to external object, i thought its simpler to hardcode and not burden the user.

i can make it an option

@Ark-kun
Copy link
Contributor

Ark-kun commented May 8, 2019

/ok-to-test

Copy link
Contributor

@animeshsingh animeshsingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also is there an end to end sample file showing the usage?


To install Nuclio over Kubernetes follow the [instruction in Github](https://github.com/nuclio/nuclio),
or this [interactive tutorial](https://www.katacoda.com/javajon/courses/kubernetes-serverless/nuclio).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we supposed to install Nuclio on Kube before using these components?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@animeshsingh it can be installed on the same cluster or a different one (defined by the dashboard address)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i plan on adding a page under kubeflow with more detailed install/usage using helm

- {name: Env, type: String, description: 'override function env var, Json {key: value, ..}', default: ''}
- {name: Mount, type: String, description: 'volume mount, [vol-type:]<vol-url>:<dst-path>', default: ''}
outputs:
- {name: address, type: String, description: 'function endpoint url'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does a function 'deployment' mean? i believe this is more like 'execute' a function?

-l, {inputValue: Log level},
]
fileOutputs:
output: /tmp/output
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we deploy a 'microservice' , and invoke it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@animeshsingh see above re deploy, invoke is calling the function (e.g. assume i have a function which does ETL or query data, i invoke it with the query and it process the data), the functions are auto-scaling (from zero or N) and will dynamically allocate resources. e.g. see this function example which reads stock trading data.

note that you dont have to use both, e.g. the pipeline may just deploy an inference function and the invoke will be done directly by an app client via HTTP or stream, e.g. see this function notebook example of TF serving, it can be deployed automatically after the model was generated and serve new requests, the Tag can be used for ingress policies (e.g. A/B testing)

@Ark-kun
Copy link
Contributor

Ark-kun commented May 8, 2019

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ark-kun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ark-kun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 442c804 into kubeflow:master May 8, 2019
magdalenakuhn17 pushed a commit to magdalenakuhn17/pipelines that referenced this pull request Oct 22, 2023
* Fix up batcher docs

* Move pmml and lightgbm to v1beta1

* Add v1beta1 transformer example

* Update feature matrix

* Move rollouts

* Move custom and transformer examples

* Update link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants