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

Email notification support #366

Closed
fenglixa opened this issue Nov 17, 2020 · 11 comments · Fixed by #436
Closed

Email notification support #366

fenglixa opened this issue Nov 17, 2020 · 11 comments · Fixed by #436

Comments

@fenglixa
Copy link
Member

/kind feature

Description:
[A clear and concise description of what your proposal. What problem does it solve?]
Tekton community already has sendmail catalog: https://github.com/tektoncd/catalog/tree/master/task/sendmail, kfp-tekton community can enhance dsl to support it accordingly.

Details of the the notification requirement:

User can specify a parameter whose value you indicate at run time for the SMTP Mail server name field, Senders email address field, Recipients email address field, and Email subject field.

The Notification stage includes the following fields.

  • SMTP Mail server name

The name of the server or its IP address. You can specify a parameter whose value you indicate at run time.
Senders email address
The email address that the notification is sent from.
Recipients email address
The email address that the notification is sent to. You can specify multiple email addresses, separated by a space.

  • Email subject

The text that is included in the subject line of the notification.

  • Attachments

Files to be sent with the notification. Specify a path name or a comma-separated list of pathnames, which must be enclosed in single-quotes or double-quotes. You can also specify an expression that resolves to a pathname or comma-separated pathnames.

  • Email body

The text that is included in the body of the notification.

  • Include job status in email

specifies whether you want to include available job status information in the message.

Additional information:
[Miscellaneous information that will assist in solving the issue.]

@fenglixa
Copy link
Member Author

fenglixa commented Nov 18, 2020

Potaintail Solution/Findings:

  1. Catalog: https://github.com/tektoncd/catalog/tree/master/task/sendmail, kfp-tekton community can enhance dsl to support it accordingly.

  2. Support notification after a pipeline run done pipelines#3516

  3. looks like it was being implemented upstream by using CloudEvents Optionally emit events during execution tektoncd/pipeline#2082

@Tomcli
Copy link
Member

Tomcli commented Nov 18, 2020

We can make the sendmail catalog task as an kubeflow component.yaml. This way it can be used as exit handler or as a regular containerOp.

@Tomcli
Copy link
Member

Tomcli commented Nov 19, 2020

@fenglixa can you give me an example for this? Can this run at the end of the pipeline or any time when a task is finished?

@fenglixa
Copy link
Member Author

Sure, the notification could be an task inside of the pipeline, as below a typical example:

image

I get the information that CPD platform already has notification API, so this feature should be not tricky to us currently.

@jinchihe
Copy link
Member

I saw @Tomcli implements, that's great.

One question, user need to set env from secret when compiling as below

def env_from_secret(env_name, secret_name, secret_key):
return k8s_client.V1EnvVar(
name=env_name,
value_from=k8s_client.V1EnvVarSource(
secret_key_ref=k8s_client.V1SecretKeySelector(
name=secret_name,
key=secret_key
)
)
)

that's a little complicated to use/load the component, since user may just want to focus on inputs of components.

Shall we wrap this in DSL, or we build a image with k8s python SDK? user just need to input secret name and we get the value in the container, no need end user to set this while compiling? I tried, seems we cannot set the env (value from secret) in component definition.

Comments? @Tomcli

@fenglixa
Copy link
Member Author

/close via PR #386

@k8s-ci-robot
Copy link

@fenglixa: Closing this issue.

In response to this:

/close

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.

@fenglixa
Copy link
Member Author

/reopen since still question/issue on #366 (comment)

@fenglixa
Copy link
Member Author

/reopen

@k8s-ci-robot
Copy link

@fenglixa: Reopened this issue.

In response to this:

/reopen

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.

@k8s-ci-robot k8s-ci-robot reopened this Jan 25, 2021
@Tomcli
Copy link
Member

Tomcli commented Jan 26, 2021

I saw @Tomcli implements, that's great.

One question, user need to set env from secret when compiling as below

def env_from_secret(env_name, secret_name, secret_key):
return k8s_client.V1EnvVar(
name=env_name,
value_from=k8s_client.V1EnvVarSource(
secret_key_ref=k8s_client.V1SecretKeySelector(
name=secret_name,
key=secret_key
)
)
)

that's a little complicated to use/load the component, since user may just want to focus on inputs of components.

Shall we wrap this in DSL, or we build a image with k8s python SDK? user just need to input secret name and we get the value in the container, no need end user to set this while compiling? I tried, seems we cannot set the env (value from secret) in component definition.

Comments? @Tomcli

I can put this helper function as part of the kfp-tekton package, but users will still need to run something like containerOp().apply(kfp_tekton.k8s_helper.env_from_secret()). Is it fine for your?

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

Successfully merging a pull request may close this issue.

4 participants