MCPcopy Create free account
hub / github.com/dagger/dagger / provision

Method provision

sdk/python/src/dagger/provisioning/_engine.py:50–79  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

48 self.has_provisioned = False
49
50 async def provision(self) -> Self:
51 connect_params = ConnectParams.from_env()
52
53 if connect_params and self.cfg.workdir:
54 msg = (
55 "Cannot configure workdir for existing session "
56 "(please use --workdir or host.directory "
57 "with absolute paths instead)."
58 )
59 raise ProvisionError(msg)
60
61 if not connect_params:
62 self.has_provisioned = True
63 # Only start progress if we are provisioning, not on active sessions
64 # like `dagger run`.
65 await self.progress.start("Provisioning engine")
66 cli_bin = await self.get_cli()
67
68 await self.progress.update("Creating new Engine session")
69 connect_params = await self.stack.enter_async_context(
70 start_cli_session(self.cfg, cli_bin)
71 )
72
73 self.connect_params = connect_params
74 self.connect_config = ConnectConfig(
75 timeout=self.cfg.timeout,
76 retry=self.cfg.retry,
77 )
78
79 return self
80
81 async def get_cli(self) -> str:
82 """Get path to CLI."""

Callers 6

TestImageDriverMethod · 0.80
TestImageDriverConfigMethod · 0.80
provision_engineFunction · 0.80
__aenter__Method · 0.80

Calls 7

get_cliMethod · 0.95
ProvisionErrorClass · 0.85
start_cli_sessionFunction · 0.85
ConnectConfigClass · 0.85
from_envMethod · 0.80
updateMethod · 0.65
startMethod · 0.45

Tested by 4

TestImageDriverMethod · 0.64
TestImageDriverConfigMethod · 0.64