Processing Server Como Serviço No Windows
Instalação de um servidor de processamento permanente no Windows.
Para Quem É
Use este caminho quando quiser usar uma máquina Windows como servidor remoto de processamento para o Toposync.
O script cria um serviço Windows chamado ToposyncProcessingServer.
Para suporte por arquitetura e GPU no Windows, consulte Compatibilidade.
Pré-requisitos
- Windows 10/11.
- PowerShell.
- Permissão de administrador.
- Acesso à internet para GitHub, PyPI e instalador do
uv. - Rede liberada entre o origin e o Windows.
O script instala uv e Python 3.12 se necessário.
Instalação
Abra PowerShell como Administrador.
Instalação rápida sem clonar o repositório:
$script = Join-Path $env:TEMP 'install-toposync-processing.ps1'; Invoke-WebRequest 'https://raw.githubusercontent.com/toposync/toposync/main/scripts/install_windows_processing_server.ps1' -OutFile $script; powershell -NoProfile -ExecutionPolicy Bypass -File $script -Bundle auto -Version latest -PreferLocalPackages:$false
O comando baixa o instalador em %TEMP% antes de executar. Isso permite que o
instalador reabra a si mesmo como Administrador se necessário.
O modo auto escolhe:
cuda, se encontrarnvidia-smi;directml, caso contrário.
Para forçar CPU, DirectML, CUDA ou um IP anunciado específico, mude os argumentos finais do instalador:
-Bundle cpu
-Bundle directml
-Bundle cuda
-AdvertiseHost 192.168.1.50
Para desenvolvimento a partir de checkout do repositório, rode o script local na raiz do repositório:
powershell -ExecutionPolicy Bypass -File .\scripts\install_windows_processing_server.ps1 -Bundle auto -Version latest -PreferLocalPackages:$false -AdvertiseHost 192.168.1.50
Como Rodar
O script cria e inicia o serviço automaticamente.
Ver status:
Get-Service ToposyncProcessingServer
Reiniciar:
Restart-Service ToposyncProcessingServer
Parar:
Stop-Service ToposyncProcessingServer
Como Acessar
Por padrão, o serviço escuta em:
http://<ip-do-windows>:49321
O script salva os dados em:
%ProgramData%\Toposync\ProcessingServer
O payload de registro fica em:
%ProgramData%\Toposync\ProcessingServer\processing-server-registration.json
Como Verificar
Veja o JSON de registro:
Get-Content "$env:ProgramData\Toposync\ProcessingServer\processing-server-registration.json"
Se instalou com -NoAuth, teste o status local:
Invoke-RestMethod -Uri http://127.0.0.1:49321/api/processing/status
Por padrão, o script gera Basic Auth. Use o usuário e senha salvos no JSON:
$pair = "toposync:<senha-do-json>"
$token = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($pair))
Invoke-RestMethod -Uri http://127.0.0.1:49321/api/processing/status -Headers @{ Authorization = "Basic $token" }
Registrar No Origin
Use o payload salvo em:
%ProgramData%\Toposync\ProcessingServer\processing-server-registration.json
O script também imprime um exemplo de Invoke-RestMethod para registrar o servidor no origin.
Depois valide no origin:
Invoke-RestMethod http://ORIGIN_HOST:8000/api/processing-servers/<server-id>/status
Nos pipelines, use processing_server_id igual ao id registrado.
Como Atualizar
Rode o instalador novamente:
$script = Join-Path $env:TEMP 'install-toposync-processing.ps1'; Invoke-WebRequest 'https://raw.githubusercontent.com/toposync/toposync/main/scripts/install_windows_processing_server.ps1' -OutFile $script; powershell -NoProfile -ExecutionPolicy Bypass -File $script -Bundle auto -Version latest -PreferLocalPackages:$false
Para recriar o ambiente virtual:
$script = Join-Path $env:TEMP 'install-toposync-processing.ps1'; Invoke-WebRequest 'https://raw.githubusercontent.com/toposync/toposync/main/scripts/install_windows_processing_server.ps1' -OutFile $script; powershell -NoProfile -ExecutionPolicy Bypass -File $script -Bundle auto -Version latest -PreferLocalPackages:$false -RecreateVenv
Como Desinstalar
Remover serviço e arquivos de runtime, preservando dados e logs:
$script = Join-Path $env:TEMP 'uninstall-toposync-processing.ps1'; Invoke-WebRequest 'https://raw.githubusercontent.com/toposync/toposync/main/scripts/uninstall_windows_processing_server.ps1' -OutFile $script; powershell -NoProfile -ExecutionPolicy Bypass -File $script
Remover também dados e logs:
$script = Join-Path $env:TEMP 'uninstall-toposync-processing.ps1'; Invoke-WebRequest 'https://raw.githubusercontent.com/toposync/toposync/main/scripts/uninstall_windows_processing_server.ps1' -OutFile $script; powershell -NoProfile -ExecutionPolicy Bypass -File $script -RemoveData
Se o serviço estiver preso:
$script = Join-Path $env:TEMP 'uninstall-toposync-processing.ps1'; Invoke-WebRequest 'https://raw.githubusercontent.com/toposync/toposync/main/scripts/uninstall_windows_processing_server.ps1' -OutFile $script; powershell -NoProfile -ExecutionPolicy Bypass -File $script -Force
Remova também o processing server registrado no origin.
Troubleshooting
O serviço não inicia
Veja os logs em:
%ProgramData%\Toposync\ProcessingServer\logs
Também confira:
Get-Service ToposyncProcessingServer
Porta ocupada
O instalador tenta escolher a próxima porta livre quando -AutoSelectPort está ativo. Confira a porta final no arquivo processing-server-registration.json.
O origin não consegue conectar
Confirme o IP em url dentro do JSON de registro, a porta escolhida e a regra de firewall criada pelo instalador.
Escolheu bundle errado
Rode o instalador novamente com -Bundle cpu, -Bundle directml ou -Bundle cuda.