-
Notifications
You must be signed in to change notification settings - Fork 1
feat: port 4 valuable PRs from YOUTUBE-EXTENSION (pre-archive salvage) #113
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c0b704b
feat: port 4 valuable PRs from YOUTUBE-EXTENSION before archive
378237f
Update src/youtube_extension/services/cloud/cloud_tasks_queue.py
groupthinking 63824d2
Update src/youtube_extension/backend/enhanced_video_processor.py
groupthinking 9092891
Update src/youtube_extension/services/ai/gemini_service.py
groupthinking a7e0ca8
Update tests/test_gemini_vision_integration.py
groupthinking File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Cloud Run Optimized Dockerfile | ||
| # Uses Python 3.11 slim with multi-stage build for smaller image size | ||
|
|
||
| FROM python:3.11-slim as builder | ||
|
|
||
| # Install build dependencies | ||
| RUN apt-get update && apt-get install -y \ | ||
| gcc \ | ||
| g++ \ | ||
| make \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Set working directory | ||
| WORKDIR /app | ||
|
|
||
| # Copy dependency files | ||
| COPY pyproject.toml README.md ./ | ||
| COPY src/ src/ | ||
|
|
||
| # Install dependencies with cloud extras | ||
| RUN pip install --no-cache-dir --user -e .[youtube,ml,cloud,postgres] | ||
|
|
||
| # Production stage | ||
| FROM python:3.11-slim | ||
|
|
||
| # Install runtime dependencies | ||
| RUN apt-get update && apt-get install -y \ | ||
| libgomp1 \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Create non-root user | ||
| RUN useradd -m -u 1000 appuser | ||
|
|
||
| # Set working directory | ||
| WORKDIR /app | ||
|
|
||
| # Copy installed packages from builder | ||
| COPY --from=builder /root/.local /home/appuser/.local | ||
| COPY --from=builder /app /app | ||
|
|
||
| # Set ownership | ||
| RUN chown -R appuser:appuser /app | ||
|
|
||
| # Switch to non-root user | ||
| USER appuser | ||
|
|
||
| # Add local packages to PATH | ||
| ENV PATH=/home/appuser/.local/bin:$PATH | ||
| ENV PYTHONPATH=/app/src:$PYTHONPATH | ||
|
|
||
| # Expose port | ||
| EXPOSE 8000 | ||
|
|
||
| # Health check | ||
| HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ | ||
| CMD python -c "import requests; requests.get('http://localhost:8000/health', timeout=5)" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current healthcheck command doesn't verify the HTTP status code of the response. |
||
|
|
||
| # Run application with uvicorn | ||
| # Cloud Run manages scaling, so we use 1 worker | ||
| CMD ["uvicorn", "youtube_extension.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"] | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
pip install -e .[youtube,ml,cloud,postgres]will fail because thecloudextra is not defined inpyproject.toml(onlydev,docs,deploy,youtube,postgres,ml). Either add acloudoptional-dependency group or remove/replacecloudhere with the correct extras so Cloud Run images build successfully.