-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathcompose.yaml
More file actions
186 lines (177 loc) · 6.58 KB
/
Copy pathcompose.yaml
File metadata and controls
186 lines (177 loc) · 6.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# Whole-infra bring-up for watermarks-remover.
#
# docker compose up --build -d # core HTTP service only
# docker compose --profile harness up --build -d # + markllm / markdiffusion harnesses
# docker compose --profile heavy up --build -d # + ctrlregen / synthid (local builds)
#
# The skill and any web app talk to the wr-core service at http://127.0.0.1:8765
# (loopback-only host mapping). The heavy/harness images are one-shot CLIs:
# `up` starts them with `--help` to confirm the image, and real jobs run via
# `docker compose run`, e.g.:
# docker compose run --rm wr-ctrlregen /data/shot.png -o /data/out.png
#
# ctrlregen and synthid bake in upstream code that is not publicly
# redistributable (all-rights-reserved / non-commercial Research License), so
# they build from source locally and are never pushed to GHCR.
name: watermarks-remover
services:
wr-core:
build:
context: service
dockerfile: Dockerfile
image: ghcr.io/guillaumemeyer/watermarks-remover:latest
ports:
- "127.0.0.1:8765:8765"
environment:
# Empty by default (no auth). Set to require `Authorization: Bearer <key>`.
WATERMARKS_SERVER_API_KEY: ${WATERMARKS_SERVER_API_KEY:-}
# Optional SynthID image scorer sidecar (heavy profile).
WATERMARKS_SYNTHID_SCORER_URL: ${WATERMARKS_SYNTHID_SCORER_URL:-}
WATERMARKS_SYNTHID_SCORER_API_KEY: ${WATERMARKS_SYNTHID_SCORER_API_KEY:-}
# Optional SynthID text watermark generator sidecar (harness profile).
WATERMARKS_SYNTHID_TEXT_URL: ${WATERMARKS_SYNTHID_TEXT_URL:-}
WATERMARKS_SYNTHID_TEXT_API_KEY: ${WATERMARKS_SYNTHID_TEXT_API_KEY:-}
WATERMARKS_SYNTHID_TEXT_TIMEOUT: ${WATERMARKS_SYNTHID_TEXT_TIMEOUT:-120}
read_only: true
tmpfs:
- /tmp
init: true
user: "10001:10001"
restart: unless-stopped
wr-markllm:
profiles: [harness]
build:
context: service
dockerfile: Dockerfile.markllm
image: ghcr.io/guillaumemeyer/watermarks-remover:markllm-latest
# One-shot CLI: `up` just confirms the image; run real jobs with
# `docker compose run --rm wr-markllm detect /data/wm.txt --scheme kgw`.
command: ["--help"]
read_only: true
tmpfs:
- /tmp
init: true
user: "10001:10001"
environment:
HF_TOKEN: ${HF_TOKEN:-}
HF_HOME: /home/markllm/.cache/huggingface
# Layer B rewrite backend (openai-compatible / ollama).
WATERMARKS_REWRITE_BACKEND: ${WATERMARKS_REWRITE_BACKEND:-}
WATERMARKS_REWRITE_MODEL: ${WATERMARKS_REWRITE_MODEL:-}
WATERMARKS_REWRITE_BASE_URL: ${WATERMARKS_REWRITE_BASE_URL:-}
WATERMARKS_REWRITE_API_KEY: ${WATERMARKS_REWRITE_API_KEY:-}
WATERMARKS_REWRITE_ALLOW_REMOTE: ${WATERMARKS_REWRITE_ALLOW_REMOTE:-}
WATERMARKS_REWRITE_REASONING_EFFORT: ${WATERMARKS_REWRITE_REASONING_EFFORT:-}
volumes:
- markllm-cache:/home/markllm/.cache/huggingface
# Writable output for the benchmark + the bundled seed corpus (the
# build context is service/, so the corpus is mounted at runtime):
# docker compose run --rm wr-markllm \
# /app/bench_synthid_text.py --markllm-dir /opt/markllm \
# --corpus /bench-corpus --out-dir /data ...
- bench-out:/data
- ./benchmarks/corpus:/bench-corpus:ro
# HTTP SynthID text watermarking sidecar: lets wr-core generate watermarked
# text for benchmarks without bundling heavy ML dependencies in the published
# core image. Reach it via WATERMARKS_SYNTHID_TEXT_URL on wr-core (see .env.example)
# and require the same bearer key on both sides.
wr-synthid-text:
profiles: [harness]
build:
context: service
dockerfile: Dockerfile.markllm
image: ghcr.io/guillaumemeyer/watermarks-remover:markllm-latest
entrypoint: ["python3"]
command: ["/app/synthid_text_server.py", "--host", "0.0.0.0", "--port", "8767"]
read_only: true
tmpfs:
- /tmp
init: true
user: "10001:10001"
environment:
WATERMARKS_SYNTHID_TEXT_API_KEY: ${WATERMARKS_SYNTHID_TEXT_API_KEY:-}
MARKLLM_DIR: /opt/markllm
HF_TOKEN: ${HF_TOKEN:-}
HF_HOME: /home/markllm/.cache/huggingface
volumes:
- markllm-cache:/home/markllm/.cache/huggingface
wr-markdiffusion:
profiles: [harness]
build:
context: service
dockerfile: Dockerfile.markdiffusion
image: ghcr.io/guillaumemeyer/watermarks-remover:markdiffusion-latest
command: ["--help"]
read_only: true
tmpfs:
- /tmp
init: true
user: "10001:10001"
environment:
HF_TOKEN: ${HF_TOKEN:-}
HF_HOME: /home/markdiffusion/.cache/huggingface
volumes:
- markdiffusion-cache:/home/markdiffusion/.cache/huggingface
wr-ctrlregen:
profiles: [heavy]
build:
context: service
dockerfile: Dockerfile.ctrlregen
# Local-only tag: upstream `noai-watermark` ships no LICENSE (all-rights-
# reserved), so this image is never published.
image: watermarks-remover-ctrlregen:local
command: ["--help"]
read_only: true
tmpfs:
- /tmp
init: true
user: "10001:10001"
environment:
HF_TOKEN: ${HF_TOKEN:-}
NOAI_WATERMARK_DIR: /opt/noai-watermark
volumes:
- ctrlregen-cache:/home/remover/.cache/huggingface
wr-synthid:
profiles: [heavy]
build:
context: service
dockerfile: Dockerfile.synthid
# Local-only tag: upstream `reverse-SynthID` is under a non-commercial
# Research License, so this image is never published.
image: watermarks-remover-synthid-scorer:local
command: ["--help"]
read_only: true
tmpfs:
- /tmp
init: true
user: "10001:10001"
volumes:
- synthid-cache:/home/scorer/.cache/huggingface
# HTTP SynthID scorer sidecar: lets wr-core score images before/after
# cleaning without bundling the non-commercial reverse-SynthID code in the
# published core image. Reach it via WATERMARKS_SYNTHID_SCORER_URL on
# wr-core (see .env.example) and require the same bearer key on both sides.
wr-synthid-score:
profiles: [heavy]
build:
context: service
dockerfile: Dockerfile.synthid
image: watermarks-remover-synthid-scorer:local
entrypoint: ["python3"]
command: ["/app/synthid_score_server.py", "--host", "0.0.0.0", "--port", "8766"]
read_only: true
tmpfs:
- /tmp
init: true
user: "10001:10001"
environment:
WATERMARKS_SYNTHID_SCORER_API_KEY: ${WATERMARKS_SYNTHID_SCORER_API_KEY:-}
REVERSE_SYNTHID_DIR: /opt/reverse-synthid
volumes:
- synthid-cache:/home/scorer/.cache/huggingface
volumes:
markllm-cache:
bench-out:
markdiffusion-cache:
ctrlregen-cache:
synthid-cache: