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

Allow REST error payloads to be returned #1446

Merged
merged 6 commits into from
Mar 13, 2020
Merged

Allow REST error payloads to be returned #1446

merged 6 commits into from
Mar 13, 2020

Conversation

ukclivecox
Copy link
Contributor

Fixes #939

@seldondev
Copy link
Collaborator

Sat Feb 15 10:07:37 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-1446/1.log

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

@seldondev
Copy link
Collaborator

Sat Feb 15 10:07:43 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-1446/2.log

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

@ukclivecox
Copy link
Contributor Author

/test this

@seldondev
Copy link
Collaborator

Sat Feb 15 10:18:45 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-1446/3.log

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

@@ -163,7 +158,13 @@ func (smc *JSONRestClient) doHttp(ctx context.Context, modelName string, method

contentType := response.Header.Get("Content-Type")

return b, contentType, nil
err = nil
Copy link
Contributor

Choose a reason for hiding this comment

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

err should already be nil if code has reached this point, why this nil re-assignment?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can line 161 be removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

I approved right before your comment so I've added a /hold to block the merge. Feel free to remove it once you are happy @glindsell!

w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(errorPredictResponse))
})
host, port, httpClient, teardown := testingHTTPClient(g, h)
Copy link
Contributor

Choose a reason for hiding this comment

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

Gomega has its own package for testing http clients ghttp: https://onsi.github.io/gomega/#ghttp-testing-http-clients

Might be worth looking into seeing as we're using it for assertions.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think ghttp is not compatible with NewGomegaWithT yet (onsi/gomega#321) as it's mainly designed to be used with gingkgo. However, given that we already have some manual teardown(), it could make sense to start using ginkgo (and ghttp).

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 we create an issue for this?

w.Write([]byte(errorPredictResponse))
})
host, port, httpClient, teardown := testingHTTPClient(g, h)
defer teardown()
Copy link
Contributor

Choose a reason for hiding this comment

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

Gomega's BeforeEach and AfterEach are another option for how to manage test setup and teardown

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As its not for all test might leave for now?

@seldondev
Copy link
Collaborator

Tue Mar 3 09:11:04 UTC 2020
The logs for [lint] [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-1446/5.log

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

@seldondev
Copy link
Collaborator

Tue Mar 3 09:11:08 UTC 2020
The logs for [pr-build] [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-1446/4.log

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

@seldondev
Copy link
Collaborator

Tue Mar 3 09:17:07 UTC 2020
The logs for [lint] [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-1446/9.log

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

@seldondev
Copy link
Collaborator

Tue Mar 3 09:18:17 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-1446/8.log

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

@adriangonz
Copy link
Contributor

/approve

@seldondev
Copy link
Collaborator

Fri Mar 6 11:45:25 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-1446/11.log

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

@seldondev
Copy link
Collaborator

Fri Mar 6 11:45:27 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-1446/10.log

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

@adriangonz
Copy link
Contributor

/hold

@ukclivecox
Copy link
Contributor Author

/test integration

@seldondev
Copy link
Collaborator

Wed Mar 11 18:51:16 UTC 2020
The logs for [pr-build] [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-1446/12.log

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

@seldondev
Copy link
Collaborator

Wed Mar 11 18:51:24 UTC 2020
The logs for [lint] [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-1446/13.log

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

@seldondev
Copy link
Collaborator

Wed Mar 11 18:53:06 UTC 2020
The logs for [integration] [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-1446/14.log

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

@seldondev
Copy link
Collaborator

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

Test name Commit Details Rerun command
integration a1c5839 link /test integration

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. I understand the commands that are listed here.

@adriangonz
Copy link
Contributor

There was an error on the pre-packaged servers, I've never seen that one before.

___________________________ TestPrepack.test_mlflow ____________________________
[gw3] linux -- Python 3.6.10 /usr/local/bin/python
self = <test_prepackaged_servers.TestPrepack object at 0x7fadd708f4a8>
namespace = 'test-mlflow'
def test_mlflow(self, namespace):
spec = "../../servers/mlflowserver/samples/elasticnet_wine.yaml"
retry_run(f"kubectl apply -f {spec} -n {namespace}")
wait_for_status("mlflow", namespace)
wait_for_rollout("mlflow", namespace)
time.sleep(1)
r = initial_rest_request(
"mlflow",
namespace,
data=[[6.3, 0.3, 0.34, 1.6, 0.049, 14, 132, 0.994, 3.3, 0.49, 9.5]],
dtype="ndarray",
names=[
"fixed acidity",
"volatile acidity",
"citric acid",
"residual sugar",
"chlorides",
"free sulfur dioxide",
"total sulfur dioxide",
"density",
"pH",
"sulphates",
"alcohol",
],
)
> assert r.status_code == 200
E AttributeError: 'NoneType' object has no attribute 'status_code'
test_prepackaged_servers.py:90: AttributeError

@seldondev
Copy link
Collaborator

Fri Mar 13 07:58:01 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-1446/16.log

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

@seldondev
Copy link
Collaborator

Fri Mar 13 07:59:25 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-1446/15.log

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

@glindsell
Copy link
Contributor

/approve

@seldondev
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adriangonz, glindsell

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:
  • OWNERS [adriangonz,glindsell]

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

@glindsell glindsell merged commit 5bb7622 into SeldonIO:master Mar 13, 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.

Custom errors raised in Python microservice don't make it back to the client
4 participants