MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / start

Method start

tools/provenance-eval/run.py:83–101  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

81 self.owner_log = tempfile.TemporaryFile()
82
83 def start(self):
84 self.run("init", str(self.root))
85 canonical = str((self.root / ".atomic").resolve())
86 digest = blake3.blake3(canonical.encode()).hexdigest()[:24]
87 self.endpoint = f"/tmp/atomic-owner-{digest}.sock"
88 self.owner = subprocess.Popen(
89 [self.binary, "agent", "database-owner", "serve", "--repository", str(self.root)],
90 stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=self.owner_log,
91 env=self.env)
92 deadline = time.monotonic() + 15
93 while True:
94 try:
95 self.rpc("Ping")
96 break
97 except (OSError, RuntimeError):
98 if self.owner.poll() is not None or time.monotonic() > deadline:
99 raise RuntimeError("owner failed to start")
100 time.sleep(.025)
101 self.hook("session-start", {"session_id": SESSION})
102
103 def run(self, *args, payload=None, timeout=45):
104 result = subprocess.run([self.binary, *args, "--no-color"], cwd=self.root,

Callers 3

measure_caseFunction · 0.95
measureFunction · 0.45
mainFunction · 0.45

Calls 5

runMethod · 0.95
rpcMethod · 0.95
hookMethod · 0.95
resolveMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected