-
Notifications
You must be signed in to change notification settings - Fork 8
Fix Gemini Handling Youtube URLs #444
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
Closed
data-angel
wants to merge
12
commits into
aj-archipelago:main
from
Enntity:jmac_fix_gemini_youtube_url
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7b8790a
feat: add support for GCP service account email and improve authentic…
data-angel 29c1e17
Add production deployment files
data-angel 0a520ef
Not needed
data-angel ef865b4
refactor: replace GCS_BUCKETNAME constant with getGCSBucketName funct…
data-angel ac36ebe
Merge pull request #1 from Enntity/jmac_gcp_various_bugfix
data-angel f0f54fe
chore: update Dockerfile to install production dependencies only and …
data-angel d5f05a7
Fix health check in cortex
data-angel 73eca7d
Update health check in Dockerfile to use /healthcheck endpoint, bypas…
data-angel b336a30
Enhance Docker Compose configuration for production deployment
data-angel 44f9388
Update WHISPER_MEDIA_API_URL in production Docker Compose configuration
data-angel 05b6a92
Update models and enhance translation tool functionality
data-angel 6ac204f
Enhance Gemini15VisionPlugin to support additional URL sources
data-angel 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,183 @@ | ||
| name: Build and Deploy Cortex | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| REGISTRY: ghcr.io | ||
| IMAGE_NAME: ${{ github.repository }} | ||
|
|
||
| jobs: | ||
| build-cortex: | ||
| name: Build Cortex Image | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Extract metadata for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
| tags: | | ||
| type=sha,prefix= | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
|
|
||
| - name: Build and push Cortex image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| build-file-handler: | ||
| name: Build File Handler Image | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Extract metadata for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-file-handler | ||
| tags: | | ||
| type=sha,prefix= | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
|
|
||
| - name: Build and push File Handler image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: ./helper-apps/cortex-file-handler | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| deploy: | ||
| name: Deploy to Hetzner | ||
| runs-on: ubuntu-latest | ||
| needs: [build-cortex, build-file-handler] | ||
| environment: production | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Copy docker-compose to server | ||
| uses: appleboy/scp-action@v0.1.7 | ||
| with: | ||
| host: ${{ secrets.DEPLOY_HOST }} | ||
| username: ${{ secrets.DEPLOY_USER }} | ||
| key: ${{ secrets.DEPLOY_SSH_KEY }} | ||
| source: "docker-compose.prod.yml" | ||
| target: "/opt/cortex" | ||
|
|
||
| - name: Deploy to server | ||
| uses: appleboy/ssh-action@v1.0.3 | ||
| with: | ||
| host: ${{ secrets.DEPLOY_HOST }} | ||
| username: ${{ secrets.DEPLOY_USER }} | ||
| key: ${{ secrets.DEPLOY_SSH_KEY }} | ||
| script: | | ||
| cd /opt/cortex | ||
|
|
||
| # Repository name must be lowercase for Docker | ||
| REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | ||
|
|
||
| # Login to GitHub Container Registry | ||
| echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
|
||
| # Pull the new images | ||
| docker pull ghcr.io/${REPO_NAME}:latest | ||
| docker pull ghcr.io/${REPO_NAME}-file-handler:latest | ||
|
|
||
| # Update the stack | ||
| export IMAGE_TAG=latest | ||
| export GITHUB_REPOSITORY_CORTEX=${REPO_NAME} | ||
|
|
||
| # Load environment variables | ||
| set -a | ||
| source .env | ||
| set +a | ||
|
|
||
| # Deploy with docker-compose | ||
| docker compose -f docker-compose.prod.yml up -d --remove-orphans | ||
|
|
||
| # Clean up old images | ||
| docker image prune -f | ||
|
|
||
| - name: Health check | ||
| uses: appleboy/ssh-action@v1.0.3 | ||
| with: | ||
| host: ${{ secrets.DEPLOY_HOST }} | ||
| username: ${{ secrets.DEPLOY_USER }} | ||
| key: ${{ secrets.DEPLOY_SSH_KEY }} | ||
| script: | | ||
| echo "Waiting for services to start..." | ||
| sleep 15 | ||
|
|
||
| # Check Cortex | ||
| if docker ps | grep -q cortex; then | ||
| echo "✅ Cortex is running" | ||
| else | ||
| echo "❌ Cortex failed to start" | ||
| docker logs cortex --tail 30 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Check File Handler | ||
| if docker ps | grep -q cortex-file-handler; then | ||
| echo "✅ File Handler is running" | ||
| else | ||
| echo "❌ File Handler failed to start" | ||
| docker logs cortex-file-handler --tail 30 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Check Redis | ||
| if docker ps | grep -q redis; then | ||
| echo "✅ Redis is running" | ||
| else | ||
| echo "❌ Redis failed to start" | ||
| exit 1 | ||
| fi | ||
|
|
||
|
|
||
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 |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| .DS_Store | ||
| node_modules/ | ||
| .env | ||
| .env.* | ||
| deploy/env.production | ||
| .vscode/ | ||
| **/__pycache__ | ||
| **/.venv | ||
|
|
||
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,28 @@ | ||
| FROM node:18-alpine | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Install build dependencies | ||
| RUN apk add --no-cache python3 make g++ | ||
|
|
||
| # Copy package files | ||
| COPY package*.json ./ | ||
|
|
||
| # Install production dependencies only | ||
| RUN npm ci --omit=dev | ||
|
|
||
| # Copy application code | ||
| COPY . . | ||
|
|
||
| # Remove devDependencies build tools | ||
| RUN apk del python3 make g++ | ||
|
|
||
| # Expose GraphQL port | ||
| EXPOSE 4000 | ||
|
|
||
| # Health check - uses /healthcheck which bypasses API key auth | ||
| HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ | ||
| CMD wget -qO- http://localhost:4000/healthcheck || exit 1 | ||
|
|
||
| CMD ["npm", "start"] | ||
|
|
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.