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
2
.github/workflows/docker.yaml
vendored
2
.github/workflows/docker.yaml
vendored
|
|
@ -114,7 +114,7 @@ jobs:
|
||||||
if: github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true'
|
if: github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true'
|
||||||
uses: nick-invision/retry@v3
|
uses: nick-invision/retry@v3
|
||||||
with:
|
with:
|
||||||
timeout_minutes: 60
|
timeout_minutes: 120
|
||||||
retry_wait_seconds: 30
|
retry_wait_seconds: 30
|
||||||
max_attempts: 2 # retry once
|
max_attempts: 2 # retry once
|
||||||
command: |
|
command: |
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ from ultralytics.utils import (
|
||||||
ROOT,
|
ROOT,
|
||||||
TORCHVISION_VERSION,
|
TORCHVISION_VERSION,
|
||||||
USER_CONFIG_DIR,
|
USER_CONFIG_DIR,
|
||||||
|
Retry,
|
||||||
SimpleNamespace,
|
SimpleNamespace,
|
||||||
ThreadingLocked,
|
ThreadingLocked,
|
||||||
TryExcept,
|
TryExcept,
|
||||||
|
|
@ -381,6 +382,11 @@ def check_requirements(requirements=ROOT.parent / "requirements.txt", exclude=()
|
||||||
except (AssertionError, metadata.PackageNotFoundError):
|
except (AssertionError, metadata.PackageNotFoundError):
|
||||||
pkgs.append(r)
|
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
|
s = " ".join(f'"{x}"' for x in pkgs) # console string
|
||||||
if s:
|
if s:
|
||||||
if install and AUTOINSTALL: # check environment variable
|
if install and AUTOINSTALL: # check environment variable
|
||||||
|
|
@ -389,7 +395,7 @@ def check_requirements(requirements=ROOT.parent / "requirements.txt", exclude=()
|
||||||
try:
|
try:
|
||||||
t = time.time()
|
t = time.time()
|
||||||
assert ONLINE, "AutoUpdate skipped (offline)"
|
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
|
dt = time.time() - t
|
||||||
LOGGER.info(
|
LOGGER.info(
|
||||||
f"{prefix} AutoUpdate success ✅ {dt:.1f}s, installed {n} package{'s' * (n > 1)}: {pkgs}\n"
|
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