-
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
Feature/cele 119 #79
Feature/cele 119 #79
Conversation
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.
@afonsobspinto I wonder if perhaps the issue you observed about buffering couldn't be partially impacted by the fact that the endpoint is not async (really not sure).
I think the niquests problem was somehow related with the 'Content-Encoding' header being set to 'gzip'. Using no compression seems to make the streaming go as expected: 2025-01-09.21-55-53.mp4 |
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.
All looks good to me :) thanks a lot @afonsobspinto ! 🙏
closes https://metacell.atlassian.net/browse/CELE-119
Adds new populate_db endpoint, secured by a custom authenticator that uses django authenticate to login the user with username and password and verifies if the user exists and is a superuser
Adds @with_stdout_streaming decorator that:
. Runs the decorated function in a separate thread
. Captures anything it prints to stdout,
. Streams that output asynchronously line-by-line as it's produced.
Updates ingestion script to trigger the database population (when the --populate-db flags is passed, we can also define the url via --populate-db-url") by using the gcp credentials to make a request to the aforementioned endpoint. Sub optimally, the request is made with curl via subprocess to surpass some buffering issues encountered when trying niquests (also happened with requests and httpx)
2024-12-19.11-51-46.mp4