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 Seldon PUID Header to gRPC context + tests #1790

Merged
merged 6 commits into from
May 19, 2020

Conversation

glindsell
Copy link
Contributor

@glindsell glindsell commented May 4, 2020

Clean branch of #1782

Fixes #1763

@seldondev
Copy link
Collaborator

Mon May 4 13:06:32 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-1790/2.log

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

@seldondev
Copy link
Collaborator

Mon May 4 13:08:07 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-1790/1.log

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

g := NewGomegaWithT(t)
modelName := "foo"
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
//g.Expect(r.Header.Get(logger.CloudEventsIdHeader)).Should(Equal(testEventId))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

g.Expect(err.Error()).Should(Equal("context value Seldon PUID Header is nil: interface to string conversion failed"))
}

func TestModelWithLogResponsesNilPUIDError(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

seems to be almost a duplicate of above test - can't they be combined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@seldondev
Copy link
Collaborator

Tue May 5 10:59:21 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-1790/4.log

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

@seldondev
Copy link
Collaborator

Tue May 5 10:59:26 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-1790/3.log

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

@seldondev
Copy link
Collaborator

Wed May 6 14:54:41 UTC 2020
The logs for [lint] [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-1790/6.log

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

@seldondev
Copy link
Collaborator

Wed May 6 14:54:51 UTC 2020
The logs for [pr-build] [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-1790/5.log

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

@glindsell
Copy link
Contributor Author

/retest

@seldondev
Copy link
Collaborator

Wed May 6 16:12:49 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-1790/7.log

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

@glindsell
Copy link
Contributor Author

/retest

@seldondev
Copy link
Collaborator

Wed May 6 16:38:10 UTC 2020
The logs for [pr-build] [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-1790/8.log

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

g.Expect(meta[strings.ToLower(payload.SeldonPUIDHeader)]).NotTo(BeNil())
g.Expect(meta[strings.ToLower(payload.SeldonPUIDHeader)][0]).To(Equal(guid))
g.Expect(meta.Get(payload.SeldonPUIDHeader)).NotTo(BeNil())
g.Expect(meta.Get(payload.SeldonPUIDHeader)[0]).To(Equal(guid))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can we fix the typo guid -> puid

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

})
return nil
}

func (p *PredictorProcess) getPUIDHeader() (string, error) {
// Check request ID is not nil
if puid, ok := p.Ctx.Value(payload.SeldonPUIDHeader).(string); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this not still panic if Value return nil? Should we not change for its existence before returning the string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interestingly not...

There's a similar question on this here.

Using the "comma-ok" form:
The value of ok is true if the assertion holds. Otherwise it is false and the value of n is the zero value for type T. No run-time panic occurs in this case.

graph := &v1.PredictiveUnit{}
_, err := createPredictorProcessWithoutPUIDInContext(t).Predict(graph, createPredictPayload(g))
g.Expect(err).NotTo(BeNil())
g.Expect(err.Error()).Should(Equal("context value Seldon PUID Header is nil: interface to string conversion failed"))
Copy link
Contributor

Choose a reason for hiding this comment

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

The message should be turned into a const if we are going to use it in multiple places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. See #1841 for follow up changes

@seldondev
Copy link
Collaborator

Mon May 18 13:48:39 UTC 2020
The logs for [lint] [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-1790/10.log

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

@seldondev
Copy link
Collaborator

Mon May 18 13:48:39 UTC 2020
The logs for [pr-build] [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-1790/9.log

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

@ukclivecox
Copy link
Contributor

/test integration

@ukclivecox
Copy link
Contributor

/approve

@seldondev
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cliveseldon

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

Mon May 18 13:59:01 UTC 2020
The logs for [integration] [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-1790/11.log

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

@glindsell
Copy link
Contributor Author

/test integration

@seldondev
Copy link
Collaborator

Tue May 19 12:45:38 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-1790/12.log

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

@glindsell
Copy link
Contributor Author

/retest

@seldondev
Copy link
Collaborator

Tue May 19 13:18:40 UTC 2020
The logs for [integration] [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-1790/13.log

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

@seldondev
Copy link
Collaborator

Tue May 19 15:02:51 UTC 2020
The logs for [lint] [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-1790/15.log

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

@seldondev
Copy link
Collaborator

Tue May 19 15:03:03 UTC 2020
The logs for [pr-build] [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-1790/14.log

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

@seldondev seldondev merged commit 3dabe7e into SeldonIO:master May 19, 2020
@seldondev
Copy link
Collaborator

failed to trigger Pull Request pipeline

  • failed to create agent
  • failed to calculate in repo config
  • failed to load trigger config for repository SeldonIO/seldon-core for ref 1d3ca47
  • failed to find any lighthouse configuration files in repo SeldonIO/seldon-core at sha 1d3ca47
  • failed to process repo SeldonIO/seldon-core refref 1d3ca47
  • failed to list files in directory /var/tmp/gitrepo660600678/.lighthouse
  • open /var/tmp/gitrepo660600678/.lighthouse
  • no such file or directory

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.

Executor sample gRPC local loggger fails
3 participants