120 Minute Docker Publish Action (#13205)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
pull/12645/head
Glenn Jocher 9 months ago committed by GitHub
parent dd819fc420
commit b95b583237
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      .github/workflows/docker.yaml
  2. 8
      ultralytics/utils/checks.py

@ -114,7 +114,7 @@ jobs:
if: github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true'
uses: nick-invision/retry@v3
with:
timeout_minutes: 60
timeout_minutes: 120
retry_wait_seconds: 30
max_attempts: 2 # retry once
command: |

@ -33,6 +33,7 @@ from ultralytics.utils import (
ROOT,
TORCHVISION_VERSION,
USER_CONFIG_DIR,
Retry,
SimpleNamespace,
ThreadingLocked,
TryExcept,
@ -381,6 +382,11 @@ def check_requirements(requirements=ROOT.parent / "requirements.txt", exclude=()
except (AssertionError, metadata.PackageNotFoundError):
pkgs.append(r)
@Retry(times=2, delay=1)
def attempt_install(packages, commands):
"""Attempt pip install command with retries on failure."""
return subprocess.check_output(f"pip install --no-cache-dir {packages} {commands}", shell=True).decode()
s = " ".join(f'"{x}"' for x in pkgs) # console string
if s:
if install and AUTOINSTALL: # check environment variable
@ -389,7 +395,7 @@ def check_requirements(requirements=ROOT.parent / "requirements.txt", exclude=()
try:
t = time.time()
assert ONLINE, "AutoUpdate skipped (offline)"
LOGGER.info(subprocess.check_output(f"pip install --no-cache-dir {s} {cmds}", shell=True).decode())
LOGGER.info(attempt_install(s, cmds))
dt = time.time() - t
LOGGER.info(
f"{prefix} AutoUpdate success ✅ {dt:.1f}s, installed {n} package{'s' * (n > 1)}: {pkgs}\n"

Loading…
Cancel
Save