Skip to content

Conversation

@pablonyx
Copy link
Contributor

Description

[Provide a brief description of the changes in this PR]

How Has This Been Tested?

[Describe the tests you ran to verify your changes]

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

pablonyx and others added 2 commits June 12, 2025 10:04
- Add railway.json for Railway deployment config
- Add docker-compose.railway.yml with non-privileged Vespa
- Add GitHub workflow for automatic PR deployments
- Add nginx config for preview environments
- Add setup documentation

This enables automatic preview environments for each PR with full Onyx stack
- Add render.yaml for Render Blueprint configuration
- Configure compose-based deployment with docker-compose.railway.yml
- Set up standard-16 plan (16GB/4vCPU) for preview environments
- Add GitHub workflow to deploy preview environments on PR events
- Expose port 80 publicly for nginx proxy

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@pablonyx pablonyx requested a review from a team as a code owner June 12, 2025 22:30
@vercel
Copy link

vercel bot commented Jun 12, 2025

@pablonyx is attempting to deploy a commit to the Danswer Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Added comprehensive preview environment infrastructure across multiple platforms (Railway and Render) with associated configuration and workflow files for automated PR deployments.

  • New .github/workflows/preview-deploy.yml and .github/workflows/render-preview.yml automate preview environment creation, but should address security considerations around API key usage
  • Added deployment/docker_compose/docker-compose.railway.yml with reduced resource limits and simplified configurations, though requiring security hardening
  • Introduced deployment/docker_compose/nginx-preview.conf with streamlined configurations (100M body size vs 5G in production)
  • Added platform-specific configs (render.yaml, railway.json) for containerized preview deployments with auto-generated credentials
  • New deployment/railway-setup.md provides detailed documentation for setting up PR-specific preview deployments

7 files reviewed, 7 comments
Edit PR Review Bot Settings | Greptile

Comment on lines +51 to +52
# Increase client body size for file uploads
client_max_body_size 100M;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: client_max_body_size is set to 100M while production uses 5G. This significant difference could cause file upload issues in preview environments.

Comment on lines 8 to 10
deploy-preview:
runs-on: ubuntu-latest
steps:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Missing checkout step before deployment. Need 'actions/checkout@v4' to access repository files.

Comment on lines +47 to +51
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
interval: 30s
timeout: 10s
retries: 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: API healthcheck is using port 8080 which may conflict with Vespa using the same port (line 101). Consider using different ports or configuring a proxy.

Comment on lines 1 to 5
name: Deploy Preview Environment

on:
pull_request:
types: [opened, synchronize, reopened]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Missing 'closed' event type in pull_request triggers, but cleanup-preview job depends on it.

Suggested change
name: Deploy Preview Environment
on:
pull_request:
types: [opened, synchronize, reopened]
name: Deploy Preview Environment
on:
pull_request:
types: [opened, synchronize, reopened, closed]

render.yaml Outdated
Comment on lines 33 to 37
- key: RAILWAY_PUBLIC_DOMAIN
fromService:
type: compose
name: onyx-preview
property: hostport
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: RAILWAY_PUBLIC_DOMAIN is using a circular reference - the service is referencing itself for the hostport property

"dockerfilePath": "deployment/docker_compose/docker-compose.railway.yml"
},
"deploy": {
"startCommand": "docker-compose -f deployment/docker_compose/docker-compose.railway.yml up",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: docker-compose up without -d will run in foreground and may cause Railway to think the deployment failed when output stops. Use docker-compose -f deployment/docker_compose/docker-compose.railway.yml up -d

Comment on lines +4 to +5
"builder": "DOCKERFILE",
"dockerfilePath": "deployment/docker_compose/docker-compose.railway.yml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: dockerfilePath points to a docker-compose.yml file but builder is set to DOCKERFILE. Should use NIXPACKS or specify the correct Dockerfile path

pablonyx and others added 4 commits June 12, 2025 15:33
- Simplify render.yaml to minimal configuration
- Add previews.generation: automatic
- Fix GitHub action name to preview-environment-action (singular)
- Add checkout step to workflow
- Remove unnecessary configuration options
- Delete .github/workflows/render-preview.yml
- Render will automatically create preview environments with just render.yaml
- No GitHub Action needed when previews.generation: automatic is set
- Remove substring() function call which is not supported in GitHub Actions expressions
- Display full commit SHA instead of shortened version
- Updated render.yaml to use docker-compose.prod-cloud.yml
- Added GitHub workflow for automatic preview environment creation
- Configured all services with appropriate environment variables
- Set up compose service with standard-16 plan (4 vCPU / 16 GB)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@pablonyx
Copy link
Contributor Author

🚀 Updated Render Preview Configuration

I've updated the configuration to properly support Render Preview Environments:

Changes Made:

  1. ✅ Fixed render.yaml to use the correct docker-compose file (docker-compose.prod-cloud.yml)
  2. ✅ Added comprehensive environment variables for all services
  3. ✅ Created the GitHub workflow file at .github/workflows/render-preview.yml

⚠️ Required Setup:

To enable preview environments, you need to add the RENDER_API_KEY secret:

  1. Get your Render API key:

  2. Add to GitHub repository:

    • Go to repository Settings → Secrets and variables → Actions
    • Click "New repository secret"
    • Name: RENDER_API_KEY
    • Value: Your Render API key

How It Works:

  • Every PR will automatically create an isolated preview environment
  • The environment includes all services: API, web server, PostgreSQL, Redis, Vespa, etc.
  • Preview URLs will be posted as PR comments
  • Environments are automatically destroyed when PRs are closed/merged

Resources:

Once the RENDER_API_KEY is added, new PRs will automatically get preview environments! 🎉

pablonyx and others added 2 commits June 12, 2025 16:48
The preview-deploy.yml workflow was using Railway commands
but we need Render preview environments instead.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Render automatically creates preview environments when:
1. A render.yaml exists with previewEnv: true
2. The repository is connected to Render

No GitHub workflow is needed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@wenxi-onyx wenxi-onyx closed this Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants