-
Notifications
You must be signed in to change notification settings - Fork 0
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
PK-929 Stub edge API #1
Conversation
# Goal: If the request path isn't found in the local edge server, fall back to the API server. | ||
# TODO: This fallback almost works, but not quite. nginx seems to only do the fallback if | ||
# the local server is down (502 status code); it doesn't seem to work with "regular" 404s at | ||
# the application level. I'm not sure how to make it work ... | ||
# https://nginx.org/en/docs/http/ngx_http_core_module.html#error_page | ||
location / { | ||
proxy_pass http://localhost:8080; | ||
error_page 404 = @fallback; | ||
} | ||
|
||
location @fallback { | ||
# TODO: switch to prod | ||
proxy_pass https://api.integ.groundlight.ai; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any ideas on this bug, @robotrapta?
@@ -0,0 +1,97 @@ | |||
# Build args | |||
ARG APP_PORT=8080 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in this case, 8080 is the port the customer would send queries too?
@@ -0,0 +1,97 @@ | |||
# Build args |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate all of the comments on this file. It seems in tune with making this open source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looked at it offline w mike! super exciting!
I think the only thing we definitely should fix before merging is the nginx forwarding issue.
This is a stub edge server (FastAPI + Docker + nginx). If a route is implemented in the edge server, then it tries to use the edge server. Otherwise, proxy the request to the real groundlight API endpoint.
Note: there is no application logic implemented (e.g. near-image deduplication on the edge) - it's just a stub.