MCPcopy Index your code
hub / github.com/mlco2/codecarbon / start

Function start

deploy/deploy.py:265–351  ·  view source on GitHub ↗
(
    traefik: Annotated[bool, typer.Option()] = False,
    fief: Annotated[bool, typer.Option()] = False,
    codecarbon: Annotated[bool, typer.Option()] = False,
)

Source from the content-addressed store, hash-verified

263
264@app.command()
265def start(
266 traefik: Annotated[bool, typer.Option()] = False,
267 fief: Annotated[bool, typer.Option()] = False,
268 codecarbon: Annotated[bool, typer.Option()] = False,
269):
270 try:
271 subprocess.check_output(["docker", "network", "create", "shared"])
272 except Exception:
273 ...
274
275 print("Building images")
276 subprocess.check_output(
277 [
278 "docker-compose",
279 "build",
280 ],
281 cwd="./",
282 )
283
284 if traefik:
285 print("Starting traefik")
286 subprocess.check_output(
287 [
288 "docker-compose",
289 "-p",
290 "traefik",
291 "-f",
292 "traefik-compose.yml",
293 "up",
294 "-d",
295 ],
296 cwd="./deploy",
297 )
298 if fief:
299 print("Starting fief")
300 subprocess.check_output(
301 [
302 "docker-compose",
303 "-p",
304 "fief",
305 "-f",
306 "fief-compose.yml",
307 "up",
308 "-d",
309 ],
310 cwd="./deploy",
311 )
312 print("Configuring fief")
313 configure_fief()
314 if codecarbon:
315 subprocess.check_output(
316 [
317 "docker-compose",
318 "-p",
319 "codecarbon",
320 "-f",
321 "docker-compose.yml",
322 "up",

Callers

nothing calls this directly

Calls 2

configure_fiefFunction · 0.85
check_outputMethod · 0.80

Tested by

no test coverage detected