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

Improve envoy charm integration tests #106

Open
orfeas-k opened this issue Jun 7, 2024 · 2 comments
Open

Improve envoy charm integration tests #106

orfeas-k opened this issue Jun 7, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@orfeas-k
Copy link
Contributor

orfeas-k commented Jun 7, 2024

Context

After bumping envoy version 1.12 -> 1.27 in #102, curling the application with header -H 'Content-Type: application/grpc-web-text' started responding with 503. The same is true for upstream envoy deployment (I applied upstream manifests and tried curling the application). That being said however, the envoy application is functional and kfp pipeline steps have no issue getting artifacts.

╰─$ curl 10.152.183.229:9090 -H 'Content-Type: application/grpc-web-text' -v                                       
*   Trying 10.152.183.229:9090...
* Connected to 10.152.183.229 (10.152.183.229) port 9090
> GET / HTTP/1.1
> Host: 10.152.183.229:9090
> User-Agent: curl/8.5.0
> Accept: */*
> Content-Type: application/grpc-web-text
> 
< HTTP/1.1 503 Service Unavailable
< content-length: 0
< content-type: application/grpc-web+proto
< grpc-message: upstream connect error or disconnect/reset before headers. reset reason: remote reset
< grpc-status: 14
< date: Fri, 07 Jun 2024 08:30:52 GMT
< server: envoy
< 
* Connection #0 to host 10.152.183.229 left intact

Thus, we need to find a new way of testing the application.
My guess is that we may have to use grpcurl tool or find out the proper headers that kfp-ui is using in order to get the artifacts, so we can simulate its behaviour.

Exploration I did

POST request

I noticed that most of kfp-ui requests are POST so I tried to imitate their behavior which results in 200 OK responses. However, I 'm not sure if that's close enough to what kfp-ui is doing.

# copying from browser console
# Response raw headers
HTTP/1.1 200 OK
content-type: application/grpc-web+proto
grpc-accept-encoding: identity, deflate, gzip
x-envoy-upstream-service-time: 4
date: Fri, 07 Jun 2024 08:34:24 GMT
server: istio-envoy
transfer-encoding: chunked
# Request raw headers
POST /ml_metadata.MetadataStoreService/GetArtifactsByContext HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Content-Length: 7
Content-Type: application/grpc-web+proto
Cookie: authservice_session=MTcxNzY2NDIxOXxOd3dBTkVGTldFdEJNMUUyVWtoVVRFSlhRVlZITmt0SVExQXpTMFpHUnpjMFRFaEVXVU5CVEVJMVdrNUVOa1ZFUTFNMFZVWldXVUU9fOzCgsyQHgeS7_mhIYhrTP6NV5j741_Sj46QS42e9VDo
Host: 10.64.140.43.nip.io
Origin: http://10.64.140.43.nip.io
Referer: http://10.64.140.43.nip.io/pipeline/
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
X-Grpc-Web: 1
X-User-Agent: grpc-web-javascript/0.1

Combining that information and information I found in random issues upstream, I tried testing with the following

╰─$ curl 10.152.183.229:9090 -H 'X-User-Agent: grpc-web-javascript/0.1' -H 'Accept-Encoding: gzip, deflate' -H 'Content-Type: application/grpc-web+proto' --data-binary 'AAAAAAA=' --compressed -v             
*   Trying 10.152.183.229:9090...
* Connected to 10.152.183.229 (10.152.183.229) port 9090
> POST / HTTP/1.1
> Host: 10.152.183.229:9090
> User-Agent: curl/8.5.0
> Accept: */*
> X-User-Agent: grpc-web-javascript/0.1
> Accept-Encoding: gzip, deflate
> Content-Type: application/grpc-web+proto
> Content-Length: 8
> 
< HTTP/1.1 200 OK
< content-type: application/grpc-web+proto
< grpc-status: 12
< x-envoy-upstream-service-time: 0
< date: Fri, 07 Jun 2024 08:45:57 GMT
< server: envoy
< content-length: 0
< 
* Connection #0 to host 10.152.183.229 left intact

Get request with grpc content type

╰─$ curl 10.152.183.229:9090 -H 'Content-Type: application/grpc' -H 'Accept: application/grpc-web-text' -v          
*   Trying 10.152.183.229:9090...
* Connected to 10.152.183.229 (10.152.183.229) port 9090
> GET / HTTP/1.1
> Host: 10.152.183.229:9090
> User-Agent: curl/8.5.0
> Content-Type: application/grpc
> Accept: application/grpc-web-text
> 
< HTTP/1.1 200 OK
< content-type: application/grpc
< grpc-status: 14
< grpc-message: upstream connect error or disconnect/reset before headers. reset reason: remote reset
< date: Fri, 07 Jun 2024 08:46:25 GMT
< server: envoy
< content-length: 0
< 
* Connection #0 to host 10.152.183.229 left intact

What needs to get done

  1. Understand more how envoy works and how kfp-ui uses it
  2. Add integration tests that imitate the requests between the two

Definition of Done

Integration tests ensure envoy is functional

@orfeas-k orfeas-k added the enhancement New feature or request label Jun 7, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/KF-5820.

This message was autogenerated

orfeas-k added a commit that referenced this issue Jun 10, 2024
* Update manifests and envoy configuration
* Add CONTRIBUTING.md file with instructions for updating manifests
* Comment integration test due to #106 

Closes #95
@orfeas-k
Copy link
Contributor Author

Note that we could add the new check as a health check to the charm, similarly to what we did for the charm in track/2.0 during #124.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant