gitarsenal-cli 1.9.72 → 1.9.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/.venv_status.json +1 -1
  2. package/bin/gitarsenal.js +8 -31
  3. package/kill_claude/claude_code_agent.py +58 -37
  4. package/kill_claude/nanoGPT/.gitattributes +3 -0
  5. package/kill_claude/nanoGPT/LICENSE +21 -0
  6. package/kill_claude/nanoGPT/README.md +227 -0
  7. package/kill_claude/nanoGPT/assets/gpt2_124M_loss.png +0 -0
  8. package/kill_claude/nanoGPT/assets/nanogpt.jpg +0 -0
  9. package/kill_claude/nanoGPT/bench.py +117 -0
  10. package/kill_claude/nanoGPT/config/eval_gpt2.py +8 -0
  11. package/kill_claude/nanoGPT/config/eval_gpt2_large.py +8 -0
  12. package/kill_claude/nanoGPT/config/eval_gpt2_medium.py +8 -0
  13. package/kill_claude/nanoGPT/config/eval_gpt2_xl.py +8 -0
  14. package/kill_claude/nanoGPT/config/finetune_shakespeare.py +25 -0
  15. package/kill_claude/nanoGPT/config/train_gpt2.py +25 -0
  16. package/kill_claude/nanoGPT/config/train_shakespeare_char.py +37 -0
  17. package/kill_claude/nanoGPT/configurator.py +47 -0
  18. package/kill_claude/nanoGPT/data/openwebtext/prepare.py +81 -0
  19. package/kill_claude/nanoGPT/data/openwebtext/readme.md +15 -0
  20. package/kill_claude/nanoGPT/data/shakespeare/prepare.py +33 -0
  21. package/kill_claude/nanoGPT/data/shakespeare/readme.md +9 -0
  22. package/kill_claude/nanoGPT/data/shakespeare_char/prepare.py +68 -0
  23. package/kill_claude/nanoGPT/data/shakespeare_char/readme.md +9 -0
  24. package/kill_claude/nanoGPT/model.py +330 -0
  25. package/kill_claude/nanoGPT/sample.py +89 -0
  26. package/kill_claude/nanoGPT/scaling_laws.ipynb +792 -0
  27. package/kill_claude/nanoGPT/train.py +336 -0
  28. package/kill_claude/nanoGPT/transformer_sizing.ipynb +402 -0
  29. package/kill_claude/prompts/claude-code-tool-prompts.md +1 -0
  30. package/kill_claude/tools/__pycache__/bash_tool.cpython-313.pyc +0 -0
  31. package/kill_claude/tools/__pycache__/task_tool.cpython-313.pyc +0 -0
  32. package/kill_claude/tools/bash_tool.py +1 -0
  33. package/lib/sandbox.js +1 -8
  34. package/package.json +1 -1
  35. package/python/debug_modal_minimal.py +212 -0
  36. package/python/test_container.py +108 -17
  37. package/python/test_modalSandboxScript.py +65 -1097
@@ -3,15 +3,20 @@ import time
3
3
  import secrets
4
4
  import string
5
5
  import modal
6
+ import sys
6
7
 
7
8
  def generate_random_password(length=16):
8
9
  """Generate a random password for SSH access"""
10
+ print(f"[DEBUG] Generating random password of length {length}")
9
11
  alphabet = string.ascii_letters + string.digits + "!@#$%^&*"
10
12
  password = ''.join(secrets.choice(alphabet) for i in range(length))
13
+ print(f"[DEBUG] Password generated successfully (length: {len(password)})")
11
14
  return password
12
15
 
16
+ print("[DEBUG] Starting container setup...")
17
+
13
18
  image = (
14
- modal.Image.from_registry("nvidia/cuda:12.4.0-devel-ubuntu22.04", add_python="3.11")
19
+ modal.Image.from_registry("nvidia/cuda:12.2.0-devel-ubuntu22.04", add_python="3.11")
15
20
  .apt_install("openssh-server", "sudo", "curl", "wget", "git", "vim", "htop", "tmux", "nvtop")
16
21
  .pip_install("cupy-cuda12x", "torch", "transformers")
17
22
  .run_commands(
@@ -23,32 +28,118 @@ image = (
23
28
  )
24
29
  )
25
30
 
31
+ print("[DEBUG] Image configuration completed")
32
+
26
33
  app = modal.App("cuda-ssh-container", image=image)
34
+ print("[DEBUG] Modal app created")
27
35
 
28
36
  @app.function(gpu="A10G", timeout=3600)
29
37
  def start_ssh():
38
+ print("[DEBUG] Starting SSH function...")
39
+
30
40
  # Generate SSH password
31
- password = generate_random_password()
32
- subprocess.run(["bash", "-c", f"echo 'root:{password}' | chpasswd"], check=True)
41
+ print("[DEBUG] Step 1: Generating SSH password")
42
+ try:
43
+ password = generate_random_password()
44
+ print(f"[DEBUG] Password generation successful")
45
+ except Exception as e:
46
+ print(f"[ERROR] Failed to generate password: {e}")
47
+ return
48
+
49
+ # Set root password
50
+ print("[DEBUG] Step 2: Setting root password")
51
+ try:
52
+ result = subprocess.run(["bash", "-c", f"echo 'root:{password}' | chpasswd"],
53
+ check=True, capture_output=True, text=True)
54
+ print(f"[DEBUG] Password set successfully. Return code: {result.returncode}")
55
+ except subprocess.CalledProcessError as e:
56
+ print(f"[ERROR] Failed to set password: {e}")
57
+ print(f"[ERROR] stdout: {e.stdout}")
58
+ print(f"[ERROR] stderr: {e.stderr}")
59
+ return
60
+ except Exception as e:
61
+ print(f"[ERROR] Unexpected error setting password: {e}")
62
+ return
33
63
 
34
64
  # Start SSH server
35
- subprocess.Popen(["/usr/sbin/sshd", "-D"])
36
- time.sleep(2)
65
+ print("[DEBUG] Step 3: Starting SSH server")
66
+ try:
67
+ ssh_process = subprocess.Popen(["/usr/sbin/sshd", "-D"])
68
+ print(f"[DEBUG] SSH server started with PID: {ssh_process.pid}")
69
+ time.sleep(2)
70
+ print("[DEBUG] Waited 2 seconds for SSH server to initialize")
71
+ except Exception as e:
72
+ print(f"[ERROR] Failed to start SSH server: {e}")
73
+ return
37
74
 
38
75
  # Test CUDA
39
- subprocess.run(["nvidia-smi"])
40
- subprocess.run(["nvcc", "--version"])
76
+ print("[DEBUG] Step 4: Testing CUDA availability")
77
+ try:
78
+ print("[DEBUG] Running nvidia-smi...")
79
+ nvidia_result = subprocess.run(["nvidia-smi"], capture_output=True, text=True, timeout=30)
80
+ print(f"[DEBUG] nvidia-smi return code: {nvidia_result.returncode}")
81
+ if nvidia_result.stdout:
82
+ print(f"[DEBUG] nvidia-smi output:\n{nvidia_result.stdout}")
83
+ if nvidia_result.stderr:
84
+ print(f"[DEBUG] nvidia-smi stderr:\n{nvidia_result.stderr}")
85
+ except subprocess.TimeoutExpired:
86
+ print("[ERROR] nvidia-smi timed out")
87
+ except Exception as e:
88
+ print(f"[ERROR] nvidia-smi failed: {e}")
89
+
90
+ try:
91
+ print("[DEBUG] Running nvcc --version...")
92
+ nvcc_result = subprocess.run(["nvcc", "--version"], capture_output=True, text=True, timeout=30)
93
+ print(f"[DEBUG] nvcc return code: {nvcc_result.returncode}")
94
+ if nvcc_result.stdout:
95
+ print(f"[DEBUG] nvcc output:\n{nvcc_result.stdout}")
96
+ if nvcc_result.stderr:
97
+ print(f"[DEBUG] nvcc stderr:\n{nvcc_result.stderr}")
98
+ except subprocess.TimeoutExpired:
99
+ print("[ERROR] nvcc timed out")
100
+ except Exception as e:
101
+ print(f"[ERROR] nvcc failed: {e}")
41
102
 
42
103
  # Forward SSH port
43
- with modal.forward(port=22, unencrypted=True) as tunnel:
44
- hostname, port = tunnel.tcp_socket
45
- print(f"SSH: ssh -p {port} root@{hostname}")
46
- print(f"Password: {password}")
47
-
48
- # Keep alive
49
- while True:
50
- time.sleep(60)
104
+ print("[DEBUG] Step 5: Setting up SSH port forwarding")
105
+ try:
106
+ with modal.forward(port=22, unencrypted=True) as tunnel:
107
+ hostname, port = tunnel.tcp_socket
108
+ print(f"[DEBUG] Tunnel established successfully")
109
+ print(f"[DEBUG] Hostname: {hostname}, Port: {port}")
110
+ print(f"\n" + "="*50)
111
+ print(f"SSH CONNECTION INFO:")
112
+ print(f"SSH: ssh -p {port} root@{hostname}")
113
+ print(f"Password: {password}")
114
+ print(f"="*50 + "\n")
115
+
116
+ # Keep alive with periodic status updates
117
+ print("[DEBUG] Starting keep-alive loop...")
118
+ counter = 0
119
+ while True:
120
+ counter += 1
121
+ print(f"[DEBUG] Keep-alive cycle {counter} - Container still running")
122
+ time.sleep(60)
123
+
124
+ except Exception as e:
125
+ print(f"[ERROR] Failed to set up port forwarding: {e}")
126
+ import traceback
127
+ traceback.print_exc()
128
+ return
51
129
 
52
130
  if __name__ == "__main__":
53
- with app.run():
54
- start_ssh.remote()
131
+ print("[DEBUG] Script starting from main...")
132
+ print(f"[DEBUG] Python version: {sys.version}")
133
+ print(f"[DEBUG] Modal version: {modal.__version__}")
134
+
135
+ try:
136
+ print("[DEBUG] Starting modal app...")
137
+ with app.run():
138
+ print("[DEBUG] Modal app context established")
139
+ start_ssh.remote()
140
+ except Exception as e:
141
+ print(f"[ERROR] Failed to run modal app: {e}")
142
+ import traceback
143
+ traceback.print_exc()
144
+
145
+ print("[DEBUG] Script completed")