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 support for runtime metrics #2442

Merged
merged 8 commits into from
Sep 18, 2020
Merged

add support for runtime metrics #2442

merged 8 commits into from
Sep 18, 2020

Conversation

RafalSkolasinski
Copy link
Contributor

@RafalSkolasinski RafalSkolasinski commented Sep 15, 2020

What this PR does / why we need it:

Adds support for thread/process safe runtime metrics / tags.

Which issue(s) this PR fixes:

Closes #1735

Special notes for your reviewer:

Introduced seldon_core.user_model.SeldonResponse class that can be used as output of predict and other methods on User Models in order to set runtime metrics and tags.
For example

from seldon_core.user_model import SeldonResponse

class Model:
    ...
    def predict(self, features, names=[], meta=[]):
        metrics = [{"type": "COUNTER", "key": "predictions_counter", "value": 1}]
        tags = {"a": 42, "z": 5}
        return SeldonResponse(data=features.tolist(), metrics=metrics, tags=tags)

Does this PR introduce a user-facing change?:

Added support for runtime metrics and tags.

@RafalSkolasinski RafalSkolasinski marked this pull request as draft September 15, 2020 19:28
@seldondev
Copy link
Collaborator

Tue Sep 15 19:30:17 UTC 2020
The logs for [lint] [2] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/2.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=2

@seldondev
Copy link
Collaborator

Tue Sep 15 19:30:29 UTC 2020
The logs for [pr-build] [1] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/1.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=1

@seldondev
Copy link
Collaborator

Tue Sep 15 21:24:57 UTC 2020
The logs for [pr-build] [3] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/3.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=3

@seldondev
Copy link
Collaborator

Tue Sep 15 21:25:00 UTC 2020
The logs for [lint] [4] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/4.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=4

@RafalSkolasinski
Copy link
Contributor Author

/test integration

@seldondev
Copy link
Collaborator

Tue Sep 15 21:28:12 UTC 2020
The logs for [integration] [5] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/5.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=5

@RafalSkolasinski
Copy link
Contributor Author

/retest

@seldondev
Copy link
Collaborator

Tue Sep 15 23:28:55 UTC 2020
The logs for [integration] [6] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/6.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=6

python/seldon_core/seldon_methods.py Outdated Show resolved Hide resolved
python/seldon_core/seldon_methods.py Outdated Show resolved Hide resolved
@@ -123,6 +123,18 @@ def init_metadata(self) -> Dict:
raise SeldonNotImplementedError("init_metadata is not implemented")


class SeldonPrediction:
Copy link
Contributor

Choose a reason for hiding this comment

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

Name should change to something more specific, as this is returned in aggregate, transform_, etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How would you suggest to name 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.

Maybe SeldonResponse or ClientResponse.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Went with ClientResponse, can still adjust easily

python/seldon_core/user_model.py Outdated Show resolved Hide resolved
@RafalSkolasinski
Copy link
Contributor Author

/test integration

@seldondev
Copy link
Collaborator

Wed Sep 16 09:47:15 UTC 2020
The logs for [pr-build] [7] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/7.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=7

@seldondev
Copy link
Collaborator

Wed Sep 16 09:47:16 UTC 2020
The logs for [lint] [8] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/8.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=8

@seldondev
Copy link
Collaborator

Wed Sep 16 09:48:54 UTC 2020
The logs for [integration] [9] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/9.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=9

@seldondev
Copy link
Collaborator

Wed Sep 16 15:52:43 UTC 2020
The logs for [pr-build] [10] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/10.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=10

@seldondev
Copy link
Collaborator

Wed Sep 16 15:52:59 UTC 2020
The logs for [lint] [11] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/11.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=11

@RafalSkolasinski
Copy link
Contributor Author

/test integration

@seldondev
Copy link
Collaborator

Wed Sep 16 15:57:23 UTC 2020
The logs for [integration] [12] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/12.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=12

@seldondev
Copy link
Collaborator

Wed Sep 16 18:30:11 UTC 2020
The logs for [pr-build] [13] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/13.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=13

@seldondev
Copy link
Collaborator

Wed Sep 16 18:30:17 UTC 2020
The logs for [lint] [14] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/14.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=14

Copy link
Contributor

@axsaucedo axsaucedo left a comment

Choose a reason for hiding this comment

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

Looks good, final things as discussed:

  • Update ClientResponse -> SeldonResponse
  • Add nblink to example and list on notebooks.rst
  • Add brief mention on this in the python module docs
  • Add point on the existing issue on updating python documentation to add further insights

@seldondev
Copy link
Collaborator

Thu Sep 17 12:46:09 UTC 2020
The logs for [pr-build] [15] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/15.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=15

@seldondev
Copy link
Collaborator

Thu Sep 17 12:46:17 UTC 2020
The logs for [lint] [16] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/16.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=16

@seldondev
Copy link
Collaborator

Thu Sep 17 17:40:45 UTC 2020
The logs for [pr-build] [17] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/17.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=17

@seldondev
Copy link
Collaborator

Thu Sep 17 17:41:16 UTC 2020
The logs for [notebooks] [19] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/19.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=19

@seldondev
Copy link
Collaborator

Thu Sep 17 17:43:18 UTC 2020
The logs for [integration] [20] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/20.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=20

@seldondev seldondev added the lgtm label Sep 17, 2020
@axsaucedo
Copy link
Contributor

/approve

@axsaucedo
Copy link
Contributor

@RafalSkolasinski it seems the lint job failed, may need rebase

@seldondev seldondev removed the lgtm label Sep 18, 2020
@seldondev
Copy link
Collaborator

New changes are detected. LGTM label has been removed.

@RafalSkolasinski
Copy link
Contributor Author

/test integration

@seldondev
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: axsaucedo

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

@seldondev
Copy link
Collaborator

Fri Sep 18 09:35:19 UTC 2020
The logs for [pr-build] [21] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/21.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=21

@seldondev
Copy link
Collaborator

Fri Sep 18 09:35:29 UTC 2020
The logs for [lint] [22] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/22.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=22

@seldondev
Copy link
Collaborator

Fri Sep 18 09:35:42 UTC 2020
The logs for [integration] [23] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/23.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=23

@RafalSkolasinski
Copy link
Contributor Author

Just so we can track failed tests.

Integration: test_label_update[1.0.2]
Note: most likely just old good flakiness

Notebooks: TestNotebooks.test_grpc_metadat and TestNotebooks.test_explainer_examples

@seldondev
Copy link
Collaborator

seldondev commented Sep 18, 2020

@RafalSkolasinski: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
notebooks b7b33ea link /test notebooks

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 jenkins-x/lighthouse repository. I understand the commands that are listed here.

@RafalSkolasinski
Copy link
Contributor Author

/test integration

@seldondev
Copy link
Collaborator

Fri Sep 18 09:45:48 UTC 2020
The logs for [pr-build] [24] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/24.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=24

@seldondev
Copy link
Collaborator

Fri Sep 18 09:45:58 UTC 2020
The logs for [lint] [25] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/25.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=25

@seldondev
Copy link
Collaborator

Fri Sep 18 09:46:06 UTC 2020
The logs for [integration] [26] will show after the pipeline context has finished.
https://github.com/SeldonIO/seldon-core/blob/gh-pages/jenkins-x/logs/SeldonIO/seldon-core/PR-2442/26.log

impatient try
jx get build logs SeldonIO/seldon-core/PR-2442 --build=26

@seldondev seldondev merged commit 8eb6dcb into SeldonIO:master Sep 18, 2020
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.

support runtime request tags / metrics in thread/process safe way
3 participants