120 Minute Docker Publish Action (#13205)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
dd819fc420
commit
b95b583237
2 changed files with 8 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue