Add idempotent offline Articulino profile registration and activation checks

This commit is contained in:
Mikei386 committed 2026-10-27 11:24:40 +01:00
1 parent 14c210e4a3
commit c564c6f21e
5 files changed
+50 -2

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ DIRECTORY --destination NEW_RUNTIME/model`; that validates all hashes rather
than trusting the experiment cache. The normal bootstrap can also redownload
all assets from their pinned public source. Test folders are not dependencies.
Create an audio profile using the imported `fp32/dit_step.onnx`, speed=1,
Create an audio profile using the authenticated Deck UI, or, only with Deck stopped at confirmed idle, run `python3 deploy/articulino/register_profile.py --state STATE --deck-is-stopped` as its service user. This operator helper is idempotent and does not change endpoint publication. The profile uses the imported `fp32/dit_step.onnx`, speed=1,
API ID `articulino-anna-cpu`. The complete remaining graph bundle belongs to
this runtime. Keep this profile disabled initially. Stored default voice comes
from `STATE/speech-voices/default.json`, resolving to e.g.
+21
View File
@@ -0,0 +1,21 @@
"""Offline operator registration, only while Deck is stopped; never publishes TTS."""
import argparse,json,sys
from pathlib import Path
sys.path.insert(0,str(Path(__file__).resolve().parents[2]))
from catalog import Catalog
from profiles import Profiles
from articulino_runtime import ArticulinoRuntime,supported
def register(state):
state=Path(state);runtime=ArticulinoRuntime(state/'articulino-runtime');ident=runtime.ensure_library()
catalog=Catalog(state/'models');profiles=Profiles(state/'profiles.json',catalog)
existing=next((p for p in profiles.rows if p.get('api_id')=='articulino-anna-cpu'),None)
if existing:
if existing['model_id']!=ident:raise ValueError('Vorhandenes Articulino-Profil zeigt auf ein anderes Modell; nicht überschrieben.')
return {k:existing[k] for k in ('id','name','api_id','model_id')}
row=profiles.save(dict(id=None,revision=0,name='Articulino Anna CPU',api_id='articulino-anna-cpu',kind='audio',model_id=ident,parameters={'speed':1}))
return {k:row[k] for k in ('id','name','api_id','model_id')}
if __name__=='__main__':
p=argparse.ArgumentParser();p.add_argument('--state',required=True,type=Path);p.add_argument('--deck-is-stopped',action='store_true');a=p.parse_args()
if not a.deck_is_stopped:p.error('Stop Deck at confirmed idle before offline profile registration; otherwise use the authenticated profile UI.')
print(json.dumps(register(a.state)))
+1 -1
View File
@@ -15,7 +15,7 @@ import urllib.request
ROOT = Path(__file__).resolve().parent.parent
LABEL = 'de.casaderoll.athena-deck.standalone'
FILES = ['deploy/scheduled_backup.py','deploy/articulino/bootstrap.py','articulino.py','articulino_runtime.py','articulino_worker.py','deploy/articulino/assets.json','deploy/articulino/requirements.lock','deploy/articulino/download.py','deploy/seedvc/bootstrap.py','deploy/seedvc/download.py','deploy/seedvc/requirements.lock','deploy/seedvc/assets.json','deploy/seedvc/versions.json','deploy/seedvc/README.md','seedvc.py','seedvc_runtime.py','seedvc_worker.py','humaneness_pitch.py','humaneness.py','humaneness_runtime.py','deploy/humaneness/bootstrap.py','deploy/humaneness/assets.json','deploy/humaneness/upstream-requirements.txt','deploy/humaneness/requirements.lock','deploy/humaneness/component-assets.json','deploy/humaneness/README.md','stimmatelier_proxy.py','qwen_native.py','qwen_native_worker.py','qwen_native_runtime.py','deploy/qwen-native-requirements.lock','deploy/import_qwen_native.py','deploy/install_strata_vision.py','assets/tts-presets/bundle.safetensors','assets/tts-presets/bundle.json','deploy/applio-requirements.lock','deploy/activate_applio.py','deploy/import_applio.py','deploy/backup_applio_data.py','applio.py','applio_runtime.py','applio_worker.py','applio-ui.js','deploy/activate_acestep.py','acestep_models.py','deploy/import_acestep.py','deploy/acestep-web/Dockerfile','deploy/acestep-web/app.py','deploy/acestep-web/index.html','acestep.py','acestep_worker.py','acestep_runtime.py','acestep-ui.js','deploy/acestep-requirements.lock','deploy/omnivoice-requirements.lock','omnivoice_runtime.py','omnivoice_worker.py','deploy/voice-web/Dockerfile','deploy/voice-web/base.Dockerfile','deploy/voice-web/bridge.py','deploy/patch_yue2_residency.py','embeddings.py','voxcpm_test.py','voxcpm_worker.py','qwen_clone_worker.py','voice-ui.js','voxcpm_runtime.py','voxcpm-ui.js','deploy/voxcpm-requirements.lock','network/native.py','deploy/setup_network_helper.py','separator_sources.json','deploy/separator-web/Dockerfile','deploy/separator-web/app.py','deploy/separator-web/index.html','separator.py','separator_runtime.py','separator_worker.py','separator-ui.js','deploy/ladypoly/Dockerfile','deploy/ladypoly/bridge.py','music.py','music-ui.js','audio_cpp_runtime.py','audio-cpp-ui.js','ltx_original_runtime.py','ltx_original_entry.py','video_original.py','ltx-original-ui.js','deploy/ltx-original-requirements.lock','backup.py','backup_codec.py','backup-ui.js','deploy/docker_backup.py','deploy/swarm-ui/Dockerfile','deploy/swarm-ui/patch-source.py','deploy/swarm-ui/proxy.py','deploy/swarm-ui/entrypoint.py','deploy/Dockerfile.app-update','video_comfy.py','video_comfy_node.py','video_comfy_proxy.py','prompt_enhancer.py','prompt_enhancer_worker.py','image_upload.py','audio_policy.py','deploy/tts-requirements.lock','stt.py','parakeet_runtime.py','stt-ui.js','api_compat.py','responses_compat.py','execution_setup.py','pocket.py','pocket_worker.py','pocket_runtime.py','deploy/pocket-requirements.lock','deploy/import_pocket.py','tts_runtime.py','tts_test.py','tts_worker.py','tts-ui.js','auto_test.py','auto-test-ui.js','chat_test.py','chat-test-ui.js','endpoint.py','inference.py','endpoint-ui.js','docker_support.py','docker-ui.js','deploy/docker_helper.py','deploy/setup_docker_helper.py','image_encoder_node.py','image_runtime.py','image_test.py','image-test-ui.js','profiles.py','profiles-ui.js','capacity.py','runtime.py','runtime-ui.js','video.py','video_proxy.py','video-ui.js','catalog.py','hub_auth.py','catalog-ui.js','server.py','auth.py','collect_hardware.py','dashboard_data.py','dashboard_history.py','dashboard-ui.js','dashboard.css','themes.css','deploy/import_dashboard_history.py','index.html','app.js','studio.js','style.css','login.html','login.js','access-ui.js','network-ui.js','network/__init__.py','network/client.py','network/config.py','network/hosts.py','network/policy.py','network/rpc.py','deploy/Dockerfile','deploy/image-requirements.lock']
FILES = ['deploy/articulino/register_profile.py','deploy/scheduled_backup.py','deploy/articulino/bootstrap.py','articulino.py','articulino_runtime.py','articulino_worker.py','deploy/articulino/assets.json','deploy/articulino/requirements.lock','deploy/articulino/download.py','deploy/seedvc/bootstrap.py','deploy/seedvc/download.py','deploy/seedvc/requirements.lock','deploy/seedvc/assets.json','deploy/seedvc/versions.json','deploy/seedvc/README.md','seedvc.py','seedvc_runtime.py','seedvc_worker.py','humaneness_pitch.py','humaneness.py','humaneness_runtime.py','deploy/humaneness/bootstrap.py','deploy/humaneness/assets.json','deploy/humaneness/upstream-requirements.txt','deploy/humaneness/requirements.lock','deploy/humaneness/component-assets.json','deploy/humaneness/README.md','stimmatelier_proxy.py','qwen_native.py','qwen_native_worker.py','qwen_native_runtime.py','deploy/qwen-native-requirements.lock','deploy/import_qwen_native.py','deploy/install_strata_vision.py','assets/tts-presets/bundle.safetensors','assets/tts-presets/bundle.json','deploy/applio-requirements.lock','deploy/activate_applio.py','deploy/import_applio.py','deploy/backup_applio_data.py','applio.py','applio_runtime.py','applio_worker.py','applio-ui.js','deploy/activate_acestep.py','acestep_models.py','deploy/import_acestep.py','deploy/acestep-web/Dockerfile','deploy/acestep-web/app.py','deploy/acestep-web/index.html','acestep.py','acestep_worker.py','acestep_runtime.py','acestep-ui.js','deploy/acestep-requirements.lock','deploy/omnivoice-requirements.lock','omnivoice_runtime.py','omnivoice_worker.py','deploy/voice-web/Dockerfile','deploy/voice-web/base.Dockerfile','deploy/voice-web/bridge.py','deploy/patch_yue2_residency.py','embeddings.py','voxcpm_test.py','voxcpm_worker.py','qwen_clone_worker.py','voice-ui.js','voxcpm_runtime.py','voxcpm-ui.js','deploy/voxcpm-requirements.lock','network/native.py','deploy/setup_network_helper.py','separator_sources.json','deploy/separator-web/Dockerfile','deploy/separator-web/app.py','deploy/separator-web/index.html','separator.py','separator_runtime.py','separator_worker.py','separator-ui.js','deploy/ladypoly/Dockerfile','deploy/ladypoly/bridge.py','music.py','music-ui.js','audio_cpp_runtime.py','audio-cpp-ui.js','ltx_original_runtime.py','ltx_original_entry.py','video_original.py','ltx-original-ui.js','deploy/ltx-original-requirements.lock','backup.py','backup_codec.py','backup-ui.js','deploy/docker_backup.py','deploy/swarm-ui/Dockerfile','deploy/swarm-ui/patch-source.py','deploy/swarm-ui/proxy.py','deploy/swarm-ui/entrypoint.py','deploy/Dockerfile.app-update','video_comfy.py','video_comfy_node.py','video_comfy_proxy.py','prompt_enhancer.py','prompt_enhancer_worker.py','image_upload.py','audio_policy.py','deploy/tts-requirements.lock','stt.py','parakeet_runtime.py','stt-ui.js','api_compat.py','responses_compat.py','execution_setup.py','pocket.py','pocket_worker.py','pocket_runtime.py','deploy/pocket-requirements.lock','deploy/import_pocket.py','tts_runtime.py','tts_test.py','tts_worker.py','tts-ui.js','auto_test.py','auto-test-ui.js','chat_test.py','chat-test-ui.js','endpoint.py','inference.py','endpoint-ui.js','docker_support.py','docker-ui.js','deploy/docker_helper.py','deploy/setup_docker_helper.py','image_encoder_node.py','image_runtime.py','image_test.py','image-test-ui.js','profiles.py','profiles-ui.js','capacity.py','runtime.py','runtime-ui.js','video.py','video_proxy.py','video-ui.js','catalog.py','hub_auth.py','catalog-ui.js','server.py','auth.py','collect_hardware.py','dashboard_data.py','dashboard_history.py','dashboard-ui.js','dashboard.css','themes.css','deploy/import_dashboard_history.py','index.html','app.js','studio.js','style.css','login.html','login.js','access-ui.js','network-ui.js','network/__init__.py','network/client.py','network/config.py','network/hosts.py','network/policy.py','network/rpc.py','deploy/Dockerfile','deploy/image-requirements.lock']
FILES += ['soulx_singer.py','soulx_singer_runtime.py','soulx-singer-ui.js','deploy/prepare_soulx_singer.py']
@@ -37,3 +37,20 @@ consolidating the large base. Runtime preparation did not restart Deck.
User login and explicit idle Deck restart approval have been requested.
Production app activation/profile creation and native client verification
remain pending; the candidate is not yet visible as an active Deck profile.
First idle activation attempt: authenticated drain reached zero active/queued
requests; CPU speech and backup jobs were idle. The offline registrar could not
traverse the host's private source parent as nobody. It failed before profile
creation and the previous verified Deck image was restored automatically and
confirmed healthy. Production clients could reload Qwen normally. No
authentication protection or host-directory permissions were loosened.
Corrected provisioning uses the new image's readable `/app` path and the normal
Deck UID, with no network or GPU and automatic removal of the one-shot
provisioning process. It creates no additional permanent service/container.
A separate synthetic registration check validates idempotency and unchanged
endpoint publication. The native registrar remains usable from a service-user-
readable native checkout while Deck is stopped. Seven focused unit tests pass.
The user has authorized the idle restart; a renewed regular login is pending
after the recovered restart invalidated the old browser session.
+10
View File
@@ -18,6 +18,16 @@ class ArticulinoTests(unittest.TestCase):
self.assertFalse(file_role('fp32/voice.onnx')['profile_eligible'])
result=assess(MODEL,{'articulino':True},{'runnable':True,'blockers':[]})
self.assertEqual(result['state'],'ready');self.assertEqual(result['candidates'][0]['id'],'articulino')
def test_offline_registration_is_idempotent_and_never_publishes(self):
from deploy.articulino.register_profile import register
with tempfile.TemporaryDirectory() as d,patch('deploy.articulino.register_profile.ArticulinoRuntime') as runtime:
root=Path(d);ident=hashlib.sha256((REPO+MODEL_REVISION+MODEL_FILE).encode()).hexdigest();model=root/'models'/ident;model.mkdir(parents=True)
(model/'model.onnx').write_bytes(b'test');(model/'entry.json').write_text(json.dumps(dict(MODEL,size=4,sha256=hashlib.sha256(b'test').hexdigest())))
ep=root/'endpoint.json';ep.write_text('{"enabled_profiles":["qwen"]}');before=ep.read_bytes()
runtime.return_value.ensure_library.return_value=ident
first=register(root);saved=(root/'profiles.json').read_bytes();second=register(root)
self.assertEqual(first,second);self.assertEqual(first['api_id'],'articulino-anna-cpu')
self.assertEqual(saved,(root/'profiles.json').read_bytes());self.assertEqual(before,ep.read_bytes())
def test_private_voice_guard_and_cpu_warm(self):
with tempfile.TemporaryDirectory() as d:
root=Path(d);voice=root/'speech-voices/Anna';voice.mkdir(parents=True);(voice/'reference.wav').touch()