Add isolated Stimmatelier Qwen speech studio and restore recipe

This commit is contained in:
Mikei386 committed 2026-10-19 12:35:32 +02:00
1 parent 182c8a1e8f
commit 2664ea8bd8
21 files changed
+397 -14

No files matched your search

+9 -7
View File
@@ -53,16 +53,16 @@ def export(manager):
try:relative=str(Path(source).relative_to(deck))
except ValueError:pass
mounts.append(dict(index=i,target=m['Destination'],read_only=not m['RW'],deck_path=relative,files=config_files(source,m['Destination']),was_file=Path(source).is_file()))
result.append(dict(name=row['name'],image=c['Image'],registry=registry,application=c.get('Labels',{}).get(APP,''),labels={k:v for k,v in (c.get('Labels') or {}).items() if k.startswith('io.athena-deck.')},env=c.get('Env') or [],entrypoint=c.get('Entrypoint'),cmd=c.get('Cmd'),uid=app_uid(row['id'],c.get('User') or ''),user=c.get('User') or '',workdir=c.get('WorkingDir') or '',network=h['NetworkMode'],ports=h.get('PortBindings') or {},restart=h.get('RestartPolicy',{}).get('Name') or 'no',memory=h.get('Memory') or 0,nanocpus=h.get('NanoCpus') or 0,running=x['State']['Running'],mounts=mounts,build_recipe='swarm-ui' if row['name']=='athena-swarm-ui' else 'ladypoly' if row['name']=='athena-ladypoly' else 'separator-web' if row['name']=='athena-separator-web' else 'soulx-singer-web' if row['name']=='athena-soulx-singer-web' else 'xvc-web' if row['name']=='athena-xvc-web' else 'applio-web' if row['name']=='athena-applio-web' else 'acestep-web' if row['name']=='athena-acestep-web' else 'voice-web' if row['name'] in ('athena-voxcpm2-web','athena-omnivoice-web') else None,unsupported=bool(h.get('Privileged') or h.get('DeviceRequests') or h.get('Devices') or h.get('CapAdd'))))
result.append(dict(name=row['name'],image=c['Image'],registry=registry,application=c.get('Labels',{}).get(APP,''),labels={k:v for k,v in (c.get('Labels') or {}).items() if k.startswith('io.athena-deck.')},env=c.get('Env') or [],entrypoint=c.get('Entrypoint'),cmd=c.get('Cmd'),uid=app_uid(row['id'],c.get('User') or ''),user=c.get('User') or '',workdir=c.get('WorkingDir') or '',network=h['NetworkMode'],ports=h.get('PortBindings') or {},restart=h.get('RestartPolicy',{}).get('Name') or 'no',memory=h.get('Memory') or 0,nanocpus=h.get('NanoCpus') or 0,running=x['State']['Running'],mounts=mounts,build_recipe='swarm-ui' if row['name']=='athena-swarm-ui' else 'ladypoly' if row['name']=='athena-ladypoly' else 'separator-web' if row['name']=='athena-separator-web' else 'soulx-singer-web' if row['name']=='athena-soulx-singer-web' else 'xvc-web' if row['name']=='athena-xvc-web' else 'applio-web' if row['name']=='athena-applio-web' else 'acestep-web' if row['name']=='athena-acestep-web' else 'stimmatelier' if row['name']=='athena-stimmatelier' else 'voice-web' if row['name'] in ('athena-voxcpm2-web','athena-omnivoice-web') else None,unsupported=bool(h.get('Privileged') or h.get('DeviceRequests') or h.get('Devices') or h.get('CapAdd'))))
return {'services':result,'configured':bool(deck)}
def validate(c):
if not isinstance(c,dict) or not re.fullmatch(r'[a-zA-Z0-9][a-zA-Z0-9_.-]{0,63}',c.get('name','')):raise ValueError('Ungültiger Containername.')
if any(c.get('labels',{}).get(k)!=v for k,v in LABELS.items()):raise ValueError('Nur ausdrücklich Deck zugeordnete Anwendungscontainer erlaubt.')
if c.get('unsupported'):raise ValueError('GPU-/privilegierter Container benötigt manuelle Einrichtung.')
if c.get('network') not in ('bridge','default','host'):raise ValueError('Benutzerdefiniertes Docker-Netzwerk benötigt manuelle Einrichtung.')
if c.get('network') not in ('bridge','default','host','none'):raise ValueError('Benutzerdefiniertes Docker-Netzwerk benötigt manuelle Einrichtung.')
if c.get('network')=='host' and c['name'] not in ('athena-swarm-ui','ltx-deskweb','athena-ladypoly','athena-separator-web','athena-voxcpm2-web','athena-omnivoice-web','athena-acestep-web','athena-applio-web','athena-xvc-web','athena-soulx-singer-web'):raise ValueError('Host-Netzwerk nur für bekannte Deck-Oberflächen erlaubt.')
recipes={'soulx-singer-web':('athena-soulx-singer-web','athena-soulx-singer-web:0.1.0'),'xvc-web':('athena-xvc-web','athena-xvc-web:0.1.0-deck1'),'applio-web':('athena-applio-web','athena-applio-web:3.6.5-deck1'),'acestep-web':('athena-acestep-web','athena-acestep-web:1.0.0'),'separator-web':('athena-separator-web','athena-separator-web:0.1.0'),'swarm-ui':('athena-swarm-ui','athena-swarm-ui:de7b834'),'ladypoly':('athena-ladypoly','athena-ladypoly:3960afc-deck1')}
recipes={'stimmatelier':('athena-stimmatelier','athena-stimmatelier:0.1.0'),'soulx-singer-web':('athena-soulx-singer-web','athena-soulx-singer-web:0.1.0'),'xvc-web':('athena-xvc-web','athena-xvc-web:0.1.0-deck1'),'applio-web':('athena-applio-web','athena-applio-web:3.6.5-deck1'),'acestep-web':('athena-acestep-web','athena-acestep-web:1.0.0'),'separator-web':('athena-separator-web','athena-separator-web:0.1.0'),'swarm-ui':('athena-swarm-ui','athena-swarm-ui:de7b834'),'ladypoly':('athena-ladypoly','athena-ladypoly:3960afc-deck1')}
if c.get('build_recipe')=='voice-web' and c['name'] in ('athena-voxcpm2-web','athena-omnivoice-web') and c.get('image') in ('athena-voice-web:0.2.1-deck1','athena-voice-web:0.2.1-deck2'):pass
elif c.get('build_recipe') is not None and recipes.get(c['build_recipe'])!=(c['name'],c.get('image')):raise ValueError('Unbekanntes Build-Rezept.')
ref=c.get('registry') or c.get('image','')
@@ -97,8 +97,9 @@ def validate(c):
native_soulx_singer=rel=='soulx_singer-data/bridge-key' and c['name']=='athena-soulx-singer-web' and target=='/run/secrets/soulx-singer-bridge' and m['read_only'] and m['was_file']
native_xvc=rel=='xvc-data/bridge-key' and c['name']=='athena-xvc-web' and target=='/run/secrets/xvc-bridge' and m['read_only'] and m['was_file']
native_applio=rel=='applio-data/bridge-key' and c['name']=='athena-applio-web' and target=='/run/secrets/applio-bridge' and m['read_only'] and m['was_file']
native_studio=rel=='stimmatelier-ui' and c['name']=='athena-stimmatelier' and target=='/data' and not m['read_only'] and not m['was_file']
native_media=rel in media and c['name']=='ltx-deskweb' and (target,m['read_only'])==media[rel] and not m['was_file']
if rel is not None and not native_media and not native_applio and not native_xvc and not native_soulx_singer and (rel not in ('models','video/comfy-work/models','video/comfy-client-token') or not m['read_only']):raise ValueError('Deck-Volume nicht freigegeben; nur bekannte Modell-/Tokenpfade und LTX-Medienordner erlaubt.')
if rel is not None and not native_media and not native_applio and not native_xvc and not native_soulx_singer and not native_studio and (rel not in ('models','video/comfy-work/models','video/comfy-client-token') or not m['read_only']):raise ValueError('Deck-Volume nicht freigegeben; nur bekannte Modell-/Tokenpfade und LTX-Medienordner erlaubt.')
for name,data in m.get('files',{}).items():
allowed=('file','Settings.fds','Backends.fds')
if c['name'] in ('athena-ladypoly','athena-separator-web','athena-voxcpm2-web','athena-omnivoice-web','athena-acestep-web','athena-applio-web','athena-xvc-web','athena-soulx-singer-web') and m['target']=='/data':allowed+=('settings.json','deck-connection.json')
@@ -121,7 +122,7 @@ def restore(manager,c):
return {'state':'reused','message':'Vorhandener markierter Container unverändert übernommen.'}
if c['name'] in ('athena-ladypoly','athena-separator-web','athena-voxcpm2-web','athena-omnivoice-web','athena-acestep-web','athena-applio-web','athena-xvc-web','athena-soulx-singer-web'):
with socket.socket() as probe:probe.bind(('127.0.0.1',{'athena-ladypoly':8127,'athena-separator-web':8128,'athena-voxcpm2-web':8129,'athena-omnivoice-web':8130,'athena-acestep-web':8131,'athena-applio-web':8132,'athena-xvc-web':8133,'athena-soulx-singer-web':8138}[c['name']]))
if c.get('build_recipe') in ('swarm-ui','ladypoly','separator-web','voice-web','acestep-web','applio-web','xvc-web','soulx-singer-web'):
if c.get('build_recipe') in ('swarm-ui','ladypoly','separator-web','voice-web','acestep-web','applio-web','xvc-web','soulx-singer-web','stimmatelier'):
source=Path(__file__).parent/c['build_recipe']
if not (source/'Dockerfile').is_file():raise ValueError('Gepinntes Swarm-Build-Rezept fehlt im Systemhelfer.')
if c['build_recipe']=='voice-web':
@@ -149,7 +150,7 @@ def restore(manager,c):
if base.is_symlink():raise ValueError('Unsicheres Dienstverzeichnis.')
base.mkdir(parents=True,exist_ok=True,mode=0o700)
args=['create','--name',name,'--network',c['network'],'--restart',c['restart'],'--cap-drop','ALL','--security-opt','no-new-privileges:true','--pids-limit','256']
if c['name'] in ('athena-ladypoly','athena-separator-web','athena-voxcpm2-web','athena-omnivoice-web','athena-acestep-web','athena-applio-web','athena-xvc-web','athena-soulx-singer-web'):
if c['name'] in ('athena-stimmatelier','athena-ladypoly','athena-separator-web','athena-voxcpm2-web','athena-omnivoice-web','athena-acestep-web','athena-applio-web','athena-xvc-web','athena-soulx-singer-web'):
args+=['--read-only','--tmpfs','/tmp:rw,noexec,nosuid,size='+('1g' if c['name']=='athena-separator-web' else '128m')+',uid=65534,gid=65534']
if c['memory']:args+=['--memory',str(c['memory'])]
if c['nanocpus']:args+=['--cpus',str(c['nanocpus']/1e9)]
@@ -181,8 +182,9 @@ def restore(manager,c):
target=source/filename;target.write_bytes(base64.b64decode(data));target.chmod(0o600)
# Application UIDs commonly used by these rootless interfaces.
uid=c.get('uid',int(c['user'].split(':')[0]) if c['user'].split(':')[0].isdigit() else 0)
if m['deck_path'] is None:
if m['deck_path'] is None or c['name']=='athena-stimmatelier' and m['deck_path']=='stimmatelier-ui':
os.chown(source,uid,uid)
if c['name']=='athena-stimmatelier':source.chmod(0o700)
if source.is_dir():
for p in source.iterdir():os.chown(p,uid,uid)
args+=['--mount',f'type=bind,src={source},dst={m["target"]}'+(',readonly' if m['read_only'] else '')]