-
Notifications
You must be signed in to change notification settings - Fork 56
feat(docker): rewrite build and deployment pipeline #723
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 19 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4a9288d
feat(docker): rewrite build and deployment pipeline
shivamashtikar 01fd947
feat(deployment): Modified dockerfile and start script for GCP deploy…
oindrila-b 4d87ad7
Merge branch 'main' of https://github.com/xynehq/xyne into XYN-92-san…
oindrila-b 82c3301
Merge branch 'main' into XYN-92-sandbox-gcp
shivamashtikar 1efb980
feat(export): add quick-export script and portable packaging
shivamashtikar aae0d81
chore(docker): add app asset volume, enforce DOCKER_UID/GID, correct …
shivamashtikar c4e2dee
feat(gpu): add GPU‑enabled Vespa support
shivamashtikar 9ea61bf
feat(quick-export): add CLI flags and conditional export logic
shivamashtikar 7d15de6
refactor(compose): consolidate GPU support into production compose
shivamashtikar 821e9d4
Merge branch 'main' into XYN-92-sandbox-gcp
shivamashtikar 1b393ff
Merge branch 'main' into XYN-92-sandbox-gcp
shivamashtikar 8edf443
feat: add portable one-click deployment system with GPU/CPU auto-dete…
shivamashtikar 0384b9c
Merge branch 'main' into XYN-92-sandbox-gcp
shivamashtikar 6a09b11
fix(docker): expose port 3001 and update compose and monitoring
shivamashtikar 2212c39
refactor(docker-compose): Simplify production compose and deployment …
shivamashtikar 879569e
refactor(docker): stop auto‑copying .env files, adjust Anthropic clie…
shivamashtikar adc20b8
feat(deployment): add GCP credentials ignore rule and CPU‑only image …
shivamashtikar 22a9401
feat(deployment/portable): add script to reuse existing xyne‑data dir…
shivamashtikar 2b87807
fix(vertex-ai-provider): tighten error handling in Vertex AI provider
shivamashtikar 845ba0a
refactor(deploy): broaden build context and improve startup scripts
shivamashtikar 56e9551
refactor(startup-scripts): make startup scripts configurable and port…
shivamashtikar d6f5c49
Merge branch 'main' into XYN-92-sandbox-gcp
shivamashtikar a4a37ec
refactor(scripts): clean up portable deployment messages and improve …
shivamashtikar b47a56a
refactor(docker): remove unused shared/ directory from image
shivamashtikar 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 |
---|---|---|
@@ -1,10 +1,61 @@ | ||
# Node modules (will be installed in container) | ||
node_modules | ||
**/node_modules | ||
|
||
# Environment files | ||
**/.env | ||
!frontend/.env | ||
.env.development | ||
.env.local | ||
.env.test | ||
.env.production | ||
|
||
# Development files | ||
.git | ||
.github/ | ||
docs | ||
.env.development | ||
server/vespa-data | ||
server/xyne-data | ||
server/data | ||
docs/ | ||
|
||
# Large data directories (excluded from image, will be restored from sample-data.tar.gz) | ||
deployment/data/ | ||
deployment/xyne-data* | ||
deployment/xyne-portable* | ||
deployment/grafana/grafana-storage/ | ||
deployment/loki/ | ||
server/vespa-data/ | ||
server/xyne-data/ | ||
server/data/ | ||
xyne-data/ | ||
|
||
# Build artifacts | ||
dist/ | ||
build/ | ||
**/dist/ | ||
**/build/ | ||
|
||
# Logs and temporary files | ||
*.log | ||
logs/ | ||
**/logs/ | ||
tmp/ | ||
temp/ | ||
**/tmp/ | ||
**/temp/ | ||
|
||
# OS files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# Editor files | ||
.vscode/ | ||
.idea/ | ||
*.swp | ||
*.swo | ||
|
||
# Test artifacts | ||
test-results/ | ||
playwright-report/ | ||
coverage/ | ||
|
||
# Development-specific | ||
eval-data/ | ||
observability/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
DATABASE_HOST=xyne-db | ||
VESPA_HOST=vespa | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
HOST=http://localhost:3000 | ||
EMBEDDING_MODEL="bge-small-en-v1.5" | ||
DATABASE_URL=postgresql://xyne:xyne@localhost:5432/xyne | ||
POSTGRES_PASSWORD= | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
REASONING="true" | ||
GOOGLE_REDIRECT_URI=http://localhost:3000/v1/auth/callback | ||
GOOGLE_CLIENT_ID= | ||
GOOGLE_CLIENT_SECRET= | ||
ENCRYPTION_KEY= | ||
JWT_SECRET= | ||
SERVICE_ACCOUNT_ENCRYPTION_KEY= | ||
AWS_ACCESS_KEY= | ||
AWS_SECRET_KEY= | ||
AWS_REGION= | ||
NODE_ENV= | ||
USER_SECRET= |
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,9 @@ | ||
FROM vespaengine/vespa | ||
|
||
USER root | ||
|
||
RUN dnf -y install 'dnf-command(config-manager)' | ||
RUN dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo | ||
RUN dnf -y install $(rpm -q --queryformat '%{NAME}-cuda-%{VERSION}' vespa-onnxruntime) | ||
|
||
zereraz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
USER vespa |
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,154 @@ | ||
# Xyne Portable Deployment | ||
|
||
One-click deployment system for Xyne with separated infrastructure and application management. | ||
|
||
## Quick Start | ||
|
||
```bash | ||
# Start all services | ||
./deploy.sh start | ||
|
||
# Access Xyne at http://localhost:3000 | ||
``` | ||
|
||
## Key Features | ||
|
||
- **🚀 One-click deployment** - Complete setup with single command | ||
- **⚡ Fast app updates** - Update application without touching database/search (~30s vs 3+ min) | ||
- **🔧 Modular architecture** - Separate infrastructure and application concerns | ||
- **📊 Built-in monitoring** - Grafana, Prometheus, Loki included | ||
- **🔄 Export/Import** - Easy transfer between machines | ||
- **🎯 Auto GPU/CPU detection** - Automatically uses GPU acceleration when available, falls back to CPU-only mode | ||
|
||
## Directory Structure | ||
|
||
``` | ||
portable/ | ||
├── docker-compose.yml # Base configuration | ||
├── docker-compose.infrastructure.yml # DB, Vespa, monitoring | ||
├── docker-compose.app.yml # Xyne application only | ||
├── deploy.sh # Deployment management | ||
├── quick-export.sh # Export for transfer | ||
├── prometheus-selfhosted.yml # Metrics config | ||
├── loki-config.yaml # Logging config | ||
├── promtail-config.yaml # Log collection config | ||
└── grafana/ # Dashboard configs | ||
``` | ||
|
||
## Common Commands | ||
|
||
### Deployment | ||
```bash | ||
./deploy.sh start # Start all services (auto-detects GPU/CPU) | ||
./deploy.sh start --force-cpu # Force CPU-only mode | ||
./deploy.sh start --force-gpu # Force GPU mode (if available) | ||
./deploy.sh stop # Stop all services | ||
./deploy.sh restart # Restart everything | ||
./deploy.sh status # Show service status and GPU/CPU mode | ||
``` | ||
|
||
### Updates | ||
```bash | ||
./deploy.sh update-app # Quick app update (30s) | ||
./deploy.sh update-infra # Update infrastructure | ||
``` | ||
|
||
### Database Management | ||
```bash | ||
./deploy.sh db-generate # Generate migrations (after schema changes) | ||
./deploy.sh db-migrate # Apply pending migrations | ||
./deploy.sh db-studio # Open Drizzle Studio (localhost:4983) | ||
``` | ||
|
||
### Monitoring | ||
```bash | ||
./deploy.sh logs # All service logs | ||
./deploy.sh logs app # App logs only | ||
./deploy.sh cleanup # Remove old containers | ||
``` | ||
|
||
### Export/Import | ||
```bash | ||
./quick-export.sh # Create portable package | ||
./quick-export.sh --no-export # Build for same machine | ||
``` | ||
|
||
## Access URLs | ||
|
||
- **Xyne Application**: http://localhost:3000 | ||
- **Grafana Dashboard**: http://localhost:3002 | ||
- **Prometheus Metrics**: http://localhost:9090 | ||
- **Loki Logs**: http://localhost:3100 | ||
|
||
## Requirements | ||
|
||
### Essential | ||
- Docker Engine 20.10+ | ||
- Docker Compose 2.0+ | ||
- 8GB+ RAM (16GB+ recommended) | ||
- 50GB+ disk space | ||
|
||
### Optional (for GPU acceleration) | ||
- NVIDIA GPU with CUDA support | ||
- NVIDIA Container Toolkit | ||
- **Note**: System automatically detects GPU availability and falls back to CPU-only mode if needed | ||
|
||
## Configuration | ||
|
||
1. Copy environment template: | ||
```bash | ||
cp .env.example .env | ||
``` | ||
|
||
2. Add your API keys: | ||
```bash | ||
nano .env | ||
``` | ||
zereraz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
3. Deploy: | ||
```bash | ||
./deploy.sh start | ||
``` | ||
|
||
## Documentation | ||
|
||
📖 **Complete Documentation**: See [Portable Deployment Guide](../../docs/deployment/advanced/portable-deployment.mdx) | ||
|
||
## Advantages Over Simple Docker Compose | ||
|
||
| Feature | Simple Compose | Portable Deployment | | ||
|---------|---------------|-------------------| | ||
| App Updates | Full restart (~3+ min) | App-only restart (~30s) | | ||
| Infrastructure Management | Manual | Automated with health checks | | ||
| Monitoring | None | Grafana + Prometheus + Loki | | ||
| Export/Import | Manual | Built-in scripts | | ||
| Production Ready | Basic | Advanced with security | | ||
| Permission Management | Manual | Automated | | ||
|
||
## Migration from Simple Compose | ||
|
||
1. **Backup current data**: | ||
```bash | ||
cp -r ./server/xyne-data ./backup/ | ||
cp -r ./server/vespa-data ./backup/ | ||
``` | ||
|
||
2. **Deploy portable system**: | ||
```bash | ||
cd deployment/portable/ | ||
./deploy.sh start | ||
``` | ||
|
||
3. **Migrate data** (if needed): | ||
```bash | ||
./deploy.sh stop | ||
cp -r ../../backup/* ./data/ | ||
./deploy.sh start | ||
``` | ||
|
||
## Support | ||
|
||
- 📚 [Full Documentation](../../docs/deployment/advanced/portable-deployment.mdx) | ||
- 💬 [Slack Community](https://xynerds.slack.com/) | ||
- 🐛 [GitHub Issues](https://github.com/xynehq/xyne/issues) | ||
- ✉️ [Email Support](mailto:founders@xynehq.com) |
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.