raytrace-cli 0.11.1__py3-none-win_amd64.whl

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 (165) hide show
  1. raytrace/__init__.py +1 -0
  2. raytrace/__main__.py +33 -0
  3. raytrace/app/LICENSE +21 -0
  4. raytrace/app/README.md +599 -0
  5. raytrace/app/bin/raytrace.mjs +297 -0
  6. raytrace/app/dist/dashboard/assets/dm-sans-latin-400-normal-BwCSEQnW.woff +0 -0
  7. raytrace/app/dist/dashboard/assets/dm-sans-latin-400-normal-CW0RaeGs.woff2 +0 -0
  8. raytrace/app/dist/dashboard/assets/dm-sans-latin-500-normal-B9HHJjqV.woff2 +0 -0
  9. raytrace/app/dist/dashboard/assets/dm-sans-latin-500-normal-Dr3UlScf.woff +0 -0
  10. raytrace/app/dist/dashboard/assets/dm-sans-latin-600-normal-Aqo67rzb.woff2 +0 -0
  11. raytrace/app/dist/dashboard/assets/dm-sans-latin-600-normal-BmdmIIQ2.woff +0 -0
  12. raytrace/app/dist/dashboard/assets/dm-sans-latin-700-normal-CUSSCpQX.woff +0 -0
  13. raytrace/app/dist/dashboard/assets/dm-sans-latin-700-normal-DvUfVpUG.woff2 +0 -0
  14. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-400-normal-BjWJ59Pq.woff +0 -0
  15. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-400-normal-BtiwyxMk.woff2 +0 -0
  16. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-500-normal-BJfUCQsA.woff2 +0 -0
  17. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-500-normal-DR84L5F-.woff +0 -0
  18. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-600-normal-4vooXBpG.woff2 +0 -0
  19. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-600-normal-DRtaDpgU.woff +0 -0
  20. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-700-normal-BLI3TTWz.woff +0 -0
  21. raytrace/app/dist/dashboard/assets/dm-sans-latin-ext-700-normal-CJIcxD6K.woff2 +0 -0
  22. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  23. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  24. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
  25. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
  26. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
  27. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
  28. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  29. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  30. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
  31. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
  32. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
  33. raytrace/app/dist/dashboard/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
  34. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  35. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  36. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  37. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  38. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
  39. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
  40. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  41. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  42. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
  43. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
  44. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
  45. raytrace/app/dist/dashboard/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
  46. raytrace/app/dist/dashboard/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  47. raytrace/app/dist/dashboard/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  48. raytrace/app/dist/dashboard/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
  49. raytrace/app/dist/dashboard/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
  50. raytrace/app/dist/dashboard/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
  51. raytrace/app/dist/dashboard/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
  52. raytrace/app/dist/dashboard/assets/index-DepcI8Fi.js +38 -0
  53. raytrace/app/dist/dashboard/assets/index-H97VLD5l.css +1 -0
  54. raytrace/app/dist/dashboard/favicon.svg +6 -0
  55. raytrace/app/dist/dashboard/index.html +15 -0
  56. raytrace/app/package.json +48 -0
  57. raytrace/app/proxy/agent-intent-schema.test.mjs +142 -0
  58. raytrace/app/proxy/call-assessment.mjs +385 -0
  59. raytrace/app/proxy/call-assessment.test.mjs +167 -0
  60. raytrace/app/proxy/call-category.mjs +461 -0
  61. raytrace/app/proxy/capture-health.mjs +30 -0
  62. raytrace/app/proxy/capture-health.test.mjs +44 -0
  63. raytrace/app/proxy/capture.mjs +38 -0
  64. raytrace/app/proxy/capture.test.mjs +49 -0
  65. raytrace/app/proxy/claude-code-adapter.mjs +301 -0
  66. raytrace/app/proxy/claude-code-hook.mjs +22 -0
  67. raytrace/app/proxy/codex-config.mjs +36 -0
  68. raytrace/app/proxy/codex.mjs +14 -0
  69. raytrace/app/proxy/evidence-schema.test.mjs +240 -0
  70. raytrace/app/proxy/evidence-store.mjs +993 -0
  71. raytrace/app/proxy/evidence-store.test.mjs +301 -0
  72. raytrace/app/proxy/exec-narrative.mjs +625 -0
  73. raytrace/app/proxy/exec-narrative.test.mjs +262 -0
  74. raytrace/app/proxy/execution-correlation.mjs +185 -0
  75. raytrace/app/proxy/execution-correlation.test.mjs +146 -0
  76. raytrace/app/proxy/execution-runner.mjs +89 -0
  77. raytrace/app/proxy/execution-runner.test.mjs +38 -0
  78. raytrace/app/proxy/experiment-engine.mjs +195 -0
  79. raytrace/app/proxy/experiment-engine.test.mjs +93 -0
  80. raytrace/app/proxy/explanations.mjs +36 -0
  81. raytrace/app/proxy/explanations.test.mjs +20 -0
  82. raytrace/app/proxy/failure-signature.mjs +56 -0
  83. raytrace/app/proxy/gvisor-forwarder.mjs +493 -0
  84. raytrace/app/proxy/gvisor-forwarder.test.mjs +433 -0
  85. raytrace/app/proxy/init-evidence-db.mjs +227 -0
  86. raytrace/app/proxy/local-sandboxes.mjs +94 -0
  87. raytrace/app/proxy/local-token.mjs +30 -0
  88. raytrace/app/proxy/playground-recovery.test.mjs +130 -0
  89. raytrace/app/proxy/playground.mjs +439 -0
  90. raytrace/app/proxy/prompt-context.mjs +278 -0
  91. raytrace/app/proxy/prompt-traces.mjs +40 -0
  92. raytrace/app/proxy/prompt-traces.test.mjs +32 -0
  93. raytrace/app/proxy/providers.mjs +65 -0
  94. raytrace/app/proxy/providers.test.mjs +76 -0
  95. raytrace/app/proxy/proxy.integration.test.mjs +135 -0
  96. raytrace/app/proxy/raytace-proxy.mjs +941 -0
  97. raytrace/app/proxy/request-metrics.mjs +13 -0
  98. raytrace/app/proxy/request-metrics.test.mjs +19 -0
  99. raytrace/app/proxy/request-policy.mjs +45 -0
  100. raytrace/app/proxy/request-policy.test.mjs +47 -0
  101. raytrace/app/proxy/run-recap.mjs +139 -0
  102. raytrace/app/proxy/runtime-attribution.mjs +110 -0
  103. raytrace/app/proxy/sandbox-bridge.mjs +49 -0
  104. raytrace/app/proxy/schema/EVIDENCE_DATABASE.md +276 -0
  105. raytrace/app/proxy/schema/agent_intent.sql +101 -0
  106. raytrace/app/proxy/schema/auxiliary.sql +90 -0
  107. raytrace/app/proxy/schema/capture_health.sql +14 -0
  108. raytrace/app/proxy/schema/classification.sql +89 -0
  109. raytrace/app/proxy/schema/file_context.sql +53 -0
  110. raytrace/app/proxy/schema/runtime_evidence.sql +201 -0
  111. raytrace/app/proxy/schema/search.sql +66 -0
  112. raytrace/app/proxy/schema/shared_storage.sql +21 -0
  113. raytrace/app/proxy/search.mjs +418 -0
  114. raytrace/app/proxy/search.test.mjs +161 -0
  115. raytrace/app/proxy/smoke.test.mjs +93 -0
  116. raytrace/app/proxy/step-attribution.mjs +380 -0
  117. raytrace/app/proxy/step-lab.mjs +78 -0
  118. raytrace/app/proxy/step-lab.test.mjs +38 -0
  119. raytrace/app/proxy/summaries.mjs +151 -0
  120. raytrace/app/proxy/summaries.test.mjs +69 -0
  121. raytrace/app/proxy/tool-metadata.mjs +111 -0
  122. raytrace/app/proxy/tool-metadata.test.mjs +38 -0
  123. raytrace/app/proxy/trace-view.mjs +324 -0
  124. raytrace/app/proxy/trace-view.test.mjs +92 -0
  125. raytrace/app/proxy/typesafe.mjs +63 -0
  126. raytrace/app/proxy/typesafe.test.mjs +39 -0
  127. raytrace/app/src/agents.mjs +7 -0
  128. raytrace/app/src/api.mjs +57 -0
  129. raytrace/app/src/auth.mjs +205 -0
  130. raytrace/app/src/beta.mjs +96 -0
  131. raytrace/app/src/claude-code.mjs +93 -0
  132. raytrace/app/src/commands.mjs +285 -0
  133. raytrace/app/src/config.mjs +49 -0
  134. raytrace/app/src/export.mjs +200 -0
  135. raytrace/app/src/lima.mjs +176 -0
  136. raytrace/app/src/local-sandbox.mjs +358 -0
  137. raytrace/app/src/mcp.mjs +688 -0
  138. raytrace/app/src/paths.mjs +33 -0
  139. raytrace/app/src/prompt.mjs +42 -0
  140. raytrace/app/src/proxy-process.mjs +143 -0
  141. raytrace/app/src/sandbox.mjs +306 -0
  142. raytrace/app/src/share.mjs +86 -0
  143. raytrace/app/src/terminal.mjs +68 -0
  144. raytrace/app/src/upload.mjs +198 -0
  145. raytrace/app/worker/sandbox/Dockerfile +8 -0
  146. raytrace/app/worker/sandbox/SYSCALL_CATALOG.md +197 -0
  147. raytrace/app/worker/sandbox/claude-hook.mjs +364 -0
  148. raytrace/app/worker/sandbox/collector.py +405 -0
  149. raytrace/app/worker/sandbox/dns_forwarder.py +255 -0
  150. raytrace/app/worker/sandbox/engine.py +940 -0
  151. raytrace/app/worker/sandbox/file_scan.py +491 -0
  152. raytrace/app/worker/sandbox/lima.yaml +29 -0
  153. raytrace/app/worker/sandbox/network.py +90 -0
  154. raytrace/app/worker/sandbox/projects.py +702 -0
  155. raytrace/app/worker/sandbox/setup.py +159 -0
  156. raytrace/app/worker/sandbox/syscall_catalog.sql +985 -0
  157. raytrace/app/worker/sandbox/transcript-delivery.test.mjs +153 -0
  158. raytrace/app/worker/sandbox/viewer.py +195 -0
  159. raytrace/node/LICENSE +2946 -0
  160. raytrace/node/node.exe +4 -0
  161. raytrace_cli-0.11.1.dist-info/LICENSE +21 -0
  162. raytrace_cli-0.11.1.dist-info/METADATA +42 -0
  163. raytrace_cli-0.11.1.dist-info/RECORD +165 -0
  164. raytrace_cli-0.11.1.dist-info/WHEEL +4 -0
  165. raytrace_cli-0.11.1.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,159 @@
1
+ """Run with sudo INSIDE the dedicated Lima VM, never on the Mac.
2
+
3
+ Which calls gVisor reports is not written here: trace_config() reads it from
4
+ the catalog (syscall_catalog.sql, the `capture` column), so what a host
5
+ subscribes to is what the catalog says, for the architecture it runs on.
6
+ """
7
+ import hashlib
8
+ import json
9
+ import os
10
+ from pathlib import Path
11
+ import platform
12
+ import shutil
13
+ import sqlite3
14
+ import subprocess
15
+ import urllib.request
16
+
17
+ # The runsc release installed. The catalog's numbers and coverage are generated
18
+ # for one release (catalog_numbers.py): change both together.
19
+ RELEASE = '20260817.0'
20
+ CONTEXT = ['time', 'thread_id', 'group_id', 'thread_group_start_time',
21
+ 'container_id', 'cwd', 'process_name', 'parent_thread_group_id']
22
+
23
+
24
+ def run(*args):
25
+ subprocess.run(args, check=True)
26
+
27
+
28
+ def trace_config(arch, catalog_sql, endpoint, calls=True):
29
+ """gVisor's trace session for this host: its own process points (clone,
30
+ exec, exit), which are fixed, and with `calls` the file, network and
31
+ identity calls the catalog captures. A captured call with a typed point
32
+ is subscribed on that point's exit, with the optional fields its row asks
33
+ for; one gVisor reports by number only (`watcher` rows: delete, rename...)
34
+ on its raw exit point, for who made it, when, and whether it was refused."""
35
+ catalog = sqlite3.connect(':memory:')
36
+ try:
37
+ catalog.executescript(catalog_sql)
38
+ if not catalog.execute('SELECT count(*) FROM syscall_coverage WHERE gvisor_release = ?', (RELEASE,)).fetchone()[0]:
39
+ raise SystemExit(f'The catalog has no coverage for gVisor {RELEASE}: run catalog_numbers.py for this release.')
40
+ number = dict(catalog.execute('SELECT syscall_name, sysno FROM syscall_numbers WHERE arch = ?', (arch,)).fetchall())
41
+ captured = catalog.execute(
42
+ """SELECT c.syscall_name, c.capture, c.capture_fields, c.group_id, v.point, v.optional_fields
43
+ FROM syscall_catalog AS c JOIN syscall_numbers AS n ON n.syscall_name = c.syscall_name AND n.arch = ?
44
+ LEFT JOIN syscall_coverage AS v ON v.syscall_name = c.syscall_name AND v.gvisor_release = ?
45
+ WHERE c.capture IN ('yes', 'watcher') ORDER BY n.sysno""", (arch, RELEASE)).fetchall() if calls else []
46
+ finally:
47
+ catalog.close()
48
+ points = ['sentry/clone', 'sentry/execve', 'sentry/exit_notify_parent',
49
+ 'sentry/task_exit', 'syscall/execve/enter', 'syscall/execve/exit',
50
+ 'syscall/execveat/enter', 'syscall/execveat/exit']
51
+ points += [f'syscall/sysno/{number[name]}/exit' for name in ('execve', 'execveat')]
52
+ # `envv` is an optional field on the execve points. It is requested ONLY so
53
+ # the collector can read the two RAYTRACE_* markers back off a process and
54
+ # turn correlation from a text guess into an exact join; collector.py drops
55
+ # every other variable (and the raw packet) before anything is written. A
56
+ # real environment block carries every secret a process was started with,
57
+ # so this must never be widened to other points or stored verbatim.
58
+ marker_points = {'syscall/execve/enter', 'syscall/execveat/enter'}
59
+ def point_config(point):
60
+ entry = {'name': point, 'context_fields': [f for f in CONTEXT if not
61
+ (point == 'sentry/exit_notify_parent' and f == 'cwd')]}
62
+ if point in marker_points:
63
+ entry['optional_fields'] = ['envv']
64
+ return entry
65
+ configured = [point_config(point) for point in points]
66
+ for name, capture, wanted, group, point, offered in captured:
67
+ if capture == 'yes' and not point:
68
+ raise SystemExit(f'The catalog captures {name}, but gVisor {RELEASE} has no typed trace point for it.')
69
+ # A file call needs the working directory, to read a relative path; a
70
+ # connection does not, and gVisor works it out for every event asked.
71
+ entry = {'name': f'{point}/exit' if capture == 'yes' else f'syscall/sysno/{number[name]}/exit',
72
+ 'context_fields': [f for f in CONTEXT if group == 'files' or f != 'cwd']}
73
+ fields = [field for field in json.loads(wanted) if field in json.loads(offered or '[]')] if capture == 'yes' else []
74
+ if fields:
75
+ entry['optional_fields'] = fields
76
+ configured.append(entry)
77
+ # gVisor never waits long for the collector: when its socket is full it
78
+ # tries again a few times, each wait twice the last (25 microseconds at
79
+ # first), then drops the event and counts it. Three tries were under a
80
+ # fifth of a millisecond, and a burst of opens (an `npm uninstall`) lost
81
+ # events on a busy host. Eight is about six milliseconds at the very most,
82
+ # paid only while the collector is behind.
83
+ return {'trace_session': {'name': 'Default', 'points': configured,
84
+ 'sinks': [{'name': 'remote', 'ignore_setup_error': False,
85
+ 'config': {'endpoint': endpoint, 'retries': 8}}]}}
86
+
87
+
88
+ if __name__ == '__main__':
89
+ if platform.system() != 'Linux' or os.geteuid() != 0:
90
+ raise SystemExit('Run this setup with sudo inside the RayTrace Linux VM.')
91
+ arch = {'aarch64': 'aarch64', 'x86_64': 'x86_64'}[platform.machine()]
92
+ base = f'https://storage.googleapis.com/gvisor/releases/release/{RELEASE}/{arch}/'
93
+ binary = urllib.request.urlopen(base + 'runsc', timeout=120).read()
94
+ checksum = urllib.request.urlopen(base + 'runsc.sha512', timeout=30).read().decode().split()[0]
95
+ if hashlib.sha512(binary).hexdigest() != checksum:
96
+ raise SystemExit('runsc checksum mismatch')
97
+ # Written beside it and moved over: a host with sandboxes running is
98
+ # running this file, and Linux refuses to write to a program in use.
99
+ staged = Path('/usr/local/bin/runsc.new')
100
+ staged.write_bytes(binary)
101
+ staged.chmod(0o755)
102
+ staged.replace('/usr/local/bin/runsc')
103
+ for directory in ['/opt/raytace', '/etc/raytace', '/var/lib/raytace', '/run/raytace']:
104
+ Path(directory).mkdir(exist_ok=True, mode=0o700)
105
+ source = Path(__file__).parent
106
+ # The collector's own modules: the fact engine, the catalog it and this
107
+ # setup read, the path rules it shares with the initial scan, the resolver.
108
+ for name in ['collector.py', 'viewer.py', 'network.py', 'projects.py',
109
+ 'engine.py', 'dns_forwarder.py', 'file_scan.py', 'syscall_catalog.sql']:
110
+ shutil.copyfile(source / name, Path('/opt/raytace') / name)
111
+ config = trace_config(arch, (source / 'syscall_catalog.sql').read_text(), '/run/raytace/events.sock')
112
+ Path('/etc/raytace/gvisor.json').write_text(json.dumps(config, indent=2))
113
+ # The engine watches the folder of every file an owner restricted or watches.
114
+ # And room for events on their way to the collector, so a burst waits in
115
+ # the kernel and is not dropped: how many may queue on its socket, and how
116
+ # many bytes a sandbox may have in flight. Both are read when a socket is
117
+ # made, so they are set before the collector and any sandbox start.
118
+ Path('/etc/sysctl.d/60-raytace.conf').write_text(
119
+ 'fs.inotify.max_user_watches = 1048576\nfs.inotify.max_user_instances = 1024\n'
120
+ 'net.unix.max_dgram_qlen = 8192\nnet.core.wmem_default = 8388608\nnet.core.wmem_max = 8388608\n')
121
+ run('sysctl', '-q', '-p', '/etc/sysctl.d/60-raytace.conf')
122
+ run('/usr/local/bin/runsc', 'install', '--runtime=raytace-gvisor', '--',
123
+ '--pod-init-config=/etc/raytace/gvisor.json')
124
+ for name, command in [('collector', 'collector.py --socket /run/raytace/events.sock --database /var/lib/raytace/runtime.db'),
125
+ ('viewer', 'viewer.py'), ('dns', 'dns_forwarder.py')]:
126
+ # The resolver is what sandboxes resolve names with: it comes back whatever ended it.
127
+ unit = f'''[Unit]
128
+ Description=RayTrace {name}
129
+ After=network.target{' docker.service' if name == 'dns' else ''}
130
+ [Service]
131
+ ExecStart=/usr/bin/python3 /opt/raytace/{command}
132
+ Restart={'always' if name == 'dns' else 'on-failure'}
133
+ RestartSec=2
134
+ UMask=0077
135
+ RuntimeDirectory=raytace
136
+ RuntimeDirectoryPreserve=yes
137
+ [Install]
138
+ WantedBy=multi-user.target
139
+ '''
140
+ if name == 'collector':
141
+ unit = unit.replace('ExecStart=', 'ExecStartPre=/usr/bin/rm -f /run/raytace/events.sock\nExecStart=')
142
+ Path(f'/etc/systemd/system/raytace-{name}.service').write_text(unit)
143
+ # Ubuntu's automatic updates restart services whose libraries changed. A
144
+ # collector restart silently ends every running sandbox's evidence stream
145
+ # (gVisor does not reconnect), so it is never restarted that way; projects.py
146
+ # restarts sandboxes that predate the collector instead.
147
+ if Path('/etc/needrestart/conf.d').is_dir():
148
+ Path('/etc/needrestart/conf.d/raytace.conf').write_text(
149
+ "$nrconf{override_rc}{qr(^raytace-)} = 0;\n")
150
+ run('systemctl', 'daemon-reload')
151
+ run('systemctl', 'restart', 'docker')
152
+ run('systemctl', 'enable', '--now', 'raytace-collector', 'raytace-viewer')
153
+ run('systemctl', 'restart', 'raytace-collector', 'raytace-viewer')
154
+ run('python3', '/opt/raytace/network.py')
155
+ # After the sandbox network exists: the resolver listens on its gateway.
156
+ run('systemctl', 'enable', 'raytace-dns')
157
+ run('systemctl', 'restart', 'raytace-dns')
158
+ run('docker', 'build', '-t', 'raytace-gvisor-agent', '-f', str(source / 'Dockerfile'), str(source))
159
+ print('Ready.')