Move development runtime to isolated Athena Debian instance

This commit is contained in:
Mikei386
2026-09-28 15:42:53 +02:00
parent 2ad844ed20
commit 6d5671f75b
12 changed files with 95 additions and 65 deletions
+8 -3
View File
@@ -98,6 +98,10 @@ def launch(config):
'-p','127.0.0.1:'+str(config['port'])+':8108',
'--health-cmd', 'python3 -c "import urllib.request,json; assert json.load(urllib.request.urlopen(\'http://127.0.0.1:8108/api/v1/auth/status\',timeout=3))[\'initialized\']"',
'--health-interval','30s','--health-timeout','5s','--health-retries','3']
if config.get('development_setup'):
args[args.index('--health-cmd')+1] = 'python3 -c "import urllib.request; urllib.request.urlopen(\'http://127.0.0.1:8108/api/v1/auth/status\',timeout=3)"'
# Explicit isolated development bootstrap, reachable only through host loopback/SSH.
args += ['-e','DECK_REQUIRE_SETUP=0']
if config['gpu_telemetry']:
args += ['--gpus','all','-e','NVIDIA_DRIVER_CAPABILITIES=utility']
args.append(config['image'])
@@ -111,7 +115,7 @@ def ready(config):
if item and item['State']['Running']:
try:
with urllib.request.urlopen('http://127.0.0.1:'+str(config['port'])+'/api/v1/auth/status',timeout=2) as r:
if json.load(r).get('initialized') is True:
if json.load(r).get('initialized') is True or config.get('development_setup'):
return
except (OSError, ValueError):
pass
@@ -226,9 +230,10 @@ def main():
elif args.stop:
if item:run('docker','stop','--time','15',config['name'])
elif args.start:
if not (args.directory/'state/auth.json').exists():
if not (args.directory/'state/auth.json').exists() and not config.get('development_setup'):
raise RuntimeError('Zugangseinrichtung unvollständig. Siehe INSTALL.md zur Wiederaufnahme.')
os.chown(args.directory/'state/auth.json',65534,65534)
if (args.directory/'state/auth.json').exists():
os.chown(args.directory/'state/auth.json',65534,65534)
if item:run('docker','start',config['name'])
else:launch(config)
ready(config);print('Deck bereit.')