Spaces:
Paused
Paused
Download scripts/setup.ps1 from 3SCError404/nexus: direct link, hf CLI and curl.
- Browser
- Download file 2.32 kB
-
https://huggingface.co/spaces/3SCError404/nexus/resolve/main/scripts/setup.ps1
- Command line
-
hf download hf://spaces/3SCError404/nexus/scripts/setup.ps1
-
curl -L -o setup.ps1 https://huggingface.co/spaces/3SCError404/nexus/resolve/main/scripts/setup.ps1
2.32 kB
| # Nexus AI Platform Setup Script (Windows PowerShell) | |
| # This script initializes the environment, installs dependencies, and seeds the database. | |
| Write-Host "--- Nexus AI Platform Setup ---" -ForegroundColor Cyan | |
| # 1. Dependency Checks | |
| Write-Host "`n[1/4] Checking Dependencies..." -ForegroundColor Yellow | |
| if (!(Get-Command python -ErrorAction SilentlyContinue)) { | |
| Write-Host "β Python is not installed or not in PATH." -ForegroundColor Red | |
| exit 1 | |
| } | |
| if (!(Get-Command docker -ErrorAction SilentlyContinue)) { | |
| Write-Host "β Docker is not installed or not in PATH." -ForegroundColor Red | |
| exit 1 | |
| } | |
| Write-Host "β Dependencies OK." -ForegroundColor Green | |
| # 2. Python Environment & Requirements | |
| Write-Host "`n[2/4] Installing Python Requirements..." -ForegroundColor Yellow | |
| python -m pip install --upgrade pip | |
| python -m pip install -r requirements.txt | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Host "β Failed to install requirements." -ForegroundColor Red | |
| exit 1 | |
| } | |
| Write-Host "β Requirements installed." -ForegroundColor Green | |
| # 3. Infrastructure (Docker) | |
| Write-Host "`n[3/4] Starting Infrastructure (Postgres, Redis)..." -ForegroundColor Yellow | |
| docker-compose up -d | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Host "β Failed to start docker-compose services." -ForegroundColor Red | |
| exit 1 | |
| } | |
| Write-Host "β³ Waiting 10 seconds for services to initialize..." -ForegroundColor Cyan | |
| Start-Sleep -Seconds 10 | |
| Write-Host "β Infrastructure ready." -ForegroundColor Green | |
| # 4. Database Seeding | |
| Write-Host "`n[4/4] Seeding Database..." -ForegroundColor Yellow | |
| $env:PYTHONPATH = "." | |
| python seeds/seed_data.py | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Host "β Database seeding failed." -ForegroundColor Red | |
| exit 1 | |
| } | |
| Write-Host "β Database initialized with seed data." -ForegroundColor Green | |
| # π Final Instructions | |
| Write-Host "`n--- Setup Complete! ---" -ForegroundColor Cyan | |
| Write-Host "To run the system, open two terminals and run the following:" -ForegroundColor White | |
| Write-Host "`n1. Start the Task Worker:" -ForegroundColor Green | |
| Write-Host " arq worker.WorkerSettings" | |
| Write-Host "`n2. Start the API Server:" -ForegroundColor Green | |
| Write-Host " uvicorn main:app --reload" | |
| Write-Host "`nWait for the worker to show 'Worker starting' before using automated features." -ForegroundColor Gray | |