Files
iLSP/ilsp.nomad
Henrik Jess Nielsen 5501254b55
All checks were successful
Build and Deploy iLSP / test (push) Successful in 21s
Build and Deploy iLSP / build-and-deploy (push) Successful in 2m49s
feat: YAML LSP (/yaml endpoint) + IAC source catalog enrichment
- Add yaml-language-server (Node.js) to Dockerfile stage 3
- Add YAML_LSP_PORT=2090 env var (Dockerfile + ilsp.nomad)
- Start yaml-language-server in background thread (_serve_yaml_lsp)
- Expose /yaml WebSocket endpoint (same WS→TCP proxy as /python and /bicep)
- Load iac_source_catalog.json alongside bicep_modules_catalog.json
- Enrich param_completion_items() with descriptions + required flag from IAC source
  - Required params sorted first (sortText 0_lru_param_0_...) and marked with *
  - detail field shows * prefix for required params
- Update /health to report iac_source_modules + yaml_lsp fields
- Rewrite EDITOR_SETUP.md: WebSocket URLs, YAML schemas config for all editors
  (Helix, Neovim, PyCharm, VS Code) with azure-pipelines + gitea actions schemas
- All 35 tests pass
2026-05-10 15:40:13 +02:00

132 lines
3.0 KiB
HCL

variable "service_name" {
description = "Service name"
type = string
default = "ilsp"
}
variable "image_tag" {
description = "Docker image tag — override in CI: -var=\"image_tag=$SHA\""
type = string
default = "latest"
}
job "ilsp" {
region = "global"
datacenters = ["dc1"]
type = "service"
meta {
uuid = uuidv4()
deployed_at = "[[ timeNowUTC ]]"
}
update {
stagger = "30s"
max_parallel = 1
auto_revert = true
progress_deadline = "25m"
}
group "ilsp-group" {
count = 1
constraint {
attribute = "${node.unique.name}"
value = "autobox.i80.dk"
}
update {
canary = 1
auto_promote = true
min_healthy_time = "15s"
healthy_deadline = "20m"
progress_deadline = "25m"
auto_revert = true
}
# Single dynamic port — Traefik routes ilsp.i80.dk → this port.
# Editors connect via WebSocket: ws://ilsp.i80.dk/python ws://ilsp.i80.dk/bicep
# LSP servers (pylsp, Bicep LS) run on localhost inside the container only.
network {
port "http" {}
}
reschedule {
attempts = 5
interval = "10m"
delay = "30s"
delay_function = "exponential"
max_delay = "120s"
unlimited = false
}
# Health check only — Traefik not used for LSP TCP traffic
service {
provider = "consul"
name = var.service_name
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.${var.service_name}.rule=Host(`${var.service_name}.i80.dk`)",
"traefik.http.routers.${var.service_name}.tls=true",
]
check {
name = "health_http"
type = "http"
port = "http"
path = "/health"
interval = "15s"
timeout = "5s"
}
}
task "ilsp-task" {
driver = "docker"
config {
image = "registry.i80.dk/gitea/ilsp:${var.image_tag}"
ports = ["http"]
force_pull = true
auth {
username = "robot$gitserver"
password = "${HARBOR_ROBOT_TOKEN}"
}
}
restart {
attempts = 5
interval = "10m"
delay = "30s"
mode = "fail"
}
env {
HTTP_PORT = "${NOMAD_PORT_http}"
PYTHON_LSP_PORT = "2087"
BICEP_LSP_PORT = "2088"
YAML_LSP_PORT = "2090"
DEVOPS_MCP_URL = "https://devops-mcp.i80.dk"
PYTHONUNBUFFERED = "1"
}
# Secrets from Consul KV
template {
data = <<EOH
HARBOR_ROBOT_TOKEN="{{ key "harbor/robot/token" }}"
EOH
destination = "secrets/registry.env"
env = true
}
resources {
# dotnet runtime (Bicep LS) + pylsp both in one container
cpu = 1000 # MHz
memory = 1536 # MB — dotnet needs headroom
memory_max = 2560 # MB burst
}
}
}
}