Skip to content

Commit e1ac1f9

Browse files
committed
fix ci builds and sandbox workflows
1 parent 3387a0e commit e1ac1f9

47 files changed

Lines changed: 3240 additions & 355 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/container-pin-waivers.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"_comment": "Temporary waivers for FROM refs that cannot be represented as a single static digest because the build arg selects multiple upstream variants. Each waiver must expire and must be reviewed before renewal.",
33
"dynamic_from": [
44
{
5-
"path": "services/inference-worker/Containerfile",
5+
"path": "services/inference-worker/Dockerfile",
66
"image_ref": "ghcr.io/ggml-org/llama.cpp:${IMAGE_TAG}",
77
"reason": "IMAGE_TAG selects CPU/CUDA/ROCm/Vulkan/Intel llama.cpp variants. Production builds must pass the resolved digest through release metadata until this is split into per-variant pinned stages.",
88
"reviewer": "sec_ai",

deploy/sandbox/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ SECAI_CONTEXT_SIZE=8192
1717
SECAI_GPU_LAYERS=0
1818

1919
SECAI_DIFFUSION_COMPUTE=cpu
20+
SECAI_DIFFUSION_DEVICE_PREFERENCE=auto
21+
SECAI_DIFFUSION_CPU_OFFLOAD=0
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
services:
2+
diffusion:
3+
build:
4+
args:
5+
COMPUTE: cuda
6+
environment:
7+
DIFFUSION_DEVICE_PREFERENCE: ${SECAI_DIFFUSION_DEVICE_PREFERENCE:-auto}
8+
DIFFUSION_CPU_OFFLOAD: ${SECAI_DIFFUSION_CPU_OFFLOAD:-0}
9+
NVIDIA_VISIBLE_DEVICES: ${NVIDIA_VISIBLE_DEVICES:-all}
10+
NVIDIA_DRIVER_CAPABILITIES: ${NVIDIA_DRIVER_CAPABILITIES:-compute,utility}
11+
deploy:
12+
resources:
13+
reservations:
14+
devices:
15+
- driver: nvidia
16+
count: all
17+
capabilities: ["gpu"]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
diffusion:
3+
build:
4+
args:
5+
COMPUTE: rocm
6+
environment:
7+
DIFFUSION_DEVICE_PREFERENCE: ${SECAI_DIFFUSION_DEVICE_PREFERENCE:-auto}
8+
DIFFUSION_CPU_OFFLOAD: ${SECAI_DIFFUSION_CPU_OFFLOAD:-0}
9+
devices:
10+
- /dev/kfd:/dev/kfd
11+
- /dev/dri:/dev/dri
12+
group_add:
13+
- video
14+
- render

deploy/sandbox/compose.yaml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ x-secai-runtime-defaults: &secai_runtime_defaults
1515
max-size: "10m"
1616
max-file: "3"
1717
tmpfs:
18-
- /tmp:rw,noexec,nosuid,nodev,size=64m
18+
- /tmp:rw,noexec,nosuid,nodev,size=64m,mode=1777
1919

2020
services:
2121
registry:
2222
<<: *secai_runtime_defaults
2323
build:
2424
context: ../../services/registry
25-
dockerfile: Containerfile
25+
dockerfile: Dockerfile
2626
environment:
2727
BIND_ADDR: 0.0.0.0:8470
2828
REGISTRY_DIR: /var/lib/secure-ai/registry
@@ -45,7 +45,7 @@ services:
4545
<<: *secai_runtime_defaults
4646
build:
4747
context: ../../services/policy-engine
48-
dockerfile: Containerfile
48+
dockerfile: Dockerfile
4949
environment:
5050
BIND_ADDR: 0.0.0.0:8500
5151
POLICY_PATH: /etc/secure-ai/policy/policy.yaml
@@ -69,7 +69,7 @@ services:
6969
<<: *secai_runtime_defaults
7070
build:
7171
context: ../../services/tool-firewall
72-
dockerfile: Containerfile
72+
dockerfile: Dockerfile
7373
environment:
7474
BIND_ADDR: 0.0.0.0:8475
7575
POLICY_PATH: /etc/secure-ai/policy/policy.yaml
@@ -92,7 +92,7 @@ services:
9292
<<: *secai_runtime_defaults
9393
build:
9494
context: ../../services/airlock
95-
dockerfile: Containerfile
95+
dockerfile: Dockerfile
9696
environment:
9797
BIND_ADDR: 0.0.0.0:8490
9898
POLICY_PATH: /etc/secure-ai/policy/policy.yaml
@@ -115,7 +115,7 @@ services:
115115
<<: *secai_runtime_defaults
116116
build:
117117
context: ../..
118-
dockerfile: services/quarantine/Containerfile.sandbox
118+
dockerfile: services/quarantine/Dockerfile.sandbox
119119
depends_on:
120120
registry:
121121
condition: service_healthy
@@ -144,7 +144,7 @@ services:
144144
<<: *secai_runtime_defaults
145145
build:
146146
context: ../..
147-
dockerfile: services/search-mediator/Containerfile
147+
dockerfile: services/search-mediator/Dockerfile
148148
environment:
149149
BIND_ADDR: 0.0.0.0:8485
150150
SEARXNG_URL: http://searxng:8888
@@ -185,7 +185,7 @@ services:
185185
<<: *secai_runtime_defaults
186186
build:
187187
context: ./tor
188-
dockerfile: Containerfile
188+
dockerfile: Dockerfile
189189
volumes:
190190
- ./search/torrc:/etc/tor/torrc:ro
191191
networks:
@@ -209,7 +209,7 @@ services:
209209
<<: *secai_runtime_defaults
210210
build:
211211
context: ./searxng
212-
dockerfile: Containerfile
212+
dockerfile: Dockerfile
213213
depends_on:
214214
tor:
215215
condition: service_healthy
@@ -238,7 +238,7 @@ services:
238238
<<: *secai_runtime_defaults
239239
build:
240240
context: ../..
241-
dockerfile: services/agent/Containerfile.sandbox
241+
dockerfile: services/agent/Dockerfile.sandbox
242242
depends_on:
243243
registry:
244244
condition: service_healthy
@@ -279,7 +279,7 @@ services:
279279
<<: *secai_runtime_defaults
280280
build:
281281
context: ../..
282-
dockerfile: services/ui/Containerfile.sandbox
282+
dockerfile: services/ui/Dockerfile.sandbox
283283
depends_on:
284284
registry:
285285
condition: service_healthy
@@ -347,7 +347,7 @@ services:
347347
<<: *secai_runtime_defaults
348348
build:
349349
context: ../../services/inference-worker
350-
dockerfile: Containerfile
350+
dockerfile: Dockerfile
351351
args:
352352
IMAGE_TAG: ${SECAI_INFERENCE_IMAGE_TAG:-server}
353353
user: "65534:65534"
@@ -367,7 +367,7 @@ services:
367367
<<: *secai_runtime_defaults
368368
build:
369369
context: ../..
370-
dockerfile: services/diffusion-worker/Containerfile.sandbox
370+
dockerfile: services/diffusion-worker/Dockerfile.sandbox
371371
args:
372372
COMPUTE: ${SECAI_DIFFUSION_COMPUTE:-cpu}
373373
environment:
@@ -381,6 +381,8 @@ services:
381381
GUNICORN_THREADS: 2
382382
GUNICORN_TIMEOUT: 1800
383383
GUNICORN_GRACEFUL_TIMEOUT: 30
384+
DIFFUSION_DEVICE_PREFERENCE: ${SECAI_DIFFUSION_DEVICE_PREFERENCE:-auto}
385+
DIFFUSION_CPU_OFFLOAD: ${SECAI_DIFFUSION_CPU_OFFLOAD:-0}
384386
tmpfs:
385387
- /tmp:rw,noexec,nosuid,nodev,size=256m
386388
volumes:

docs/install/sandbox.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,24 @@ bash scripts/sandbox/start.sh --with-diffusion
103103
powershell -ExecutionPolicy Bypass -File scripts/sandbox/start.ps1 -WithDiffusion
104104
```
105105

106+
For capable NVIDIA or ROCm hosts, add GPU acceleration:
107+
108+
```bash
109+
bash scripts/sandbox/start.sh --with-diffusion --with-gpu
110+
```
111+
112+
```powershell
113+
.\secai-sandbox.cmd start --with-diffusion --with-gpu
114+
```
115+
116+
`--with-gpu` builds the diffusion worker with a GPU PyTorch backend and adds a
117+
GPU-specific compose override. By default it keeps diffusion pipelines resident
118+
on the GPU and leaves CPU offload disabled (`SECAI_DIFFUSION_CPU_OFFLOAD=0`).
119+
Set `SECAI_DIFFUSION_COMPUTE=rocm` for AMD ROCm, or leave it unset for NVIDIA
120+
CUDA auto-detection. GPU passthrough gives the diffusion container access to the
121+
host GPU device, so keep it disabled for sessions that do not need generation
122+
acceleration.
123+
106124
**Enable Tor-routed web search**
107125

108126
This starts the Tor and SearXNG sidecars and flips the sandbox runtime policy
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
repo_dir="/etc/yum.repos.d"
5+
disabled_count=0
6+
7+
if [[ ! -d "$repo_dir" ]]; then
8+
echo "No yum repository directory present; skipping stale repo preflight."
9+
exit 0
10+
fi
11+
12+
shopt -s nullglob
13+
for repo_file in "$repo_dir"/*.repo; do
14+
if ! grep -Eiq '(^[[:space:]]*\[fedora-multimedia\]|negativo17\.org/.*/multimedia|fedora-multimedia)' "$repo_file"; then
15+
continue
16+
fi
17+
18+
if grep -Eq '^[[:space:]]*enabled[[:space:]]*=' "$repo_file"; then
19+
sed -ri 's/^[[:space:]]*enabled[[:space:]]*=.*/enabled=0/' "$repo_file"
20+
else
21+
printf '\nenabled=0\n' >> "$repo_file"
22+
fi
23+
24+
disabled_count=$((disabled_count + 1))
25+
echo "Disabled stale Fedora multimedia repository in ${repo_file}."
26+
done
27+
28+
if [[ "$disabled_count" -eq 0 ]]; then
29+
echo "No stale Fedora multimedia repository found."
30+
fi

0 commit comments

Comments
 (0)