MCPcopy Create free account
hub / github.com/FastLED/FastLED / _start_docker_macos

Function _start_docker_macos

ci/util/docker_helper.py:334–366  ·  view source on GitHub ↗

Attempt to start Docker Desktop on macOS. Returns: Tuple of (success, message)

()

Source from the content-addressed store, hash-verified

332
333
334def _start_docker_macos() -> tuple[bool, str]:
335 """Attempt to start Docker Desktop on macOS.
336
337 Returns:
338 Tuple of (success, message)
339 """
340 try:
341 # Use `open -a` to launch Docker Desktop
342 subprocess.run(
343 ["open", "-a", "Docker"],
344 capture_output=True,
345 timeout=10,
346 check=False,
347 )
348 # Wait for Docker to start - up to 60 seconds
349 print(" Waiting for Docker Desktop to initialize...", flush=True)
350 for attempt in range(60):
351 time.sleep(1)
352 if is_docker_available():
353 return True, "Docker Desktop started successfully"
354 if (attempt + 1) % 10 == 0:
355 print(f" Still waiting ({attempt + 1}s)...", flush=True)
356 return False, "Docker Desktop did not start within 60 seconds"
357 except FileNotFoundError:
358 return (
359 False,
360 "Docker Desktop not found. Please install it from https://www.docker.com/products/docker-desktop",
361 )
362 except KeyboardInterrupt as ki:
363 handle_keyboard_interrupt(ki)
364 raise
365 except Exception as e:
366 return False, f"Failed to start Docker Desktop on macOS: {e}"
367
368
369def _start_docker_linux() -> tuple[bool, str]:

Callers 1

attempt_start_dockerFunction · 0.85

Calls 4

is_docker_availableFunction · 0.90
printFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected