Add retries to Docker pushes (#18565)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher 2025-01-07 11:20:03 +01:00 committed by GitHub
parent 88c5699a54
commit 4775901224
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 21 deletions

View file

@ -158,27 +158,37 @@ jobs:
- name: Push Docker Image with Ultralytics version tag - name: Push Docker Image with Ultralytics version tag
if: (github.event_name == 'push' || (github.event.inputs[matrix.dockerfile] == 'true' && github.event.inputs.push == 'true')) && steps.check_tag.outputs.new_release == 'true' && matrix.dockerfile != 'Dockerfile-conda' if: (github.event_name == 'push' || (github.event.inputs[matrix.dockerfile] == 'true' && github.event.inputs.push == 'true')) && steps.check_tag.outputs.new_release == 'true' && matrix.dockerfile != 'Dockerfile-conda'
run: | uses: ultralytics/actions/retry@main
docker push ultralytics/ultralytics:${{ steps.get_version.outputs.version_tag }} with:
timeout_minutes: 15
retry_delay_seconds: 300
retries: 2
run: |
docker push ultralytics/ultralytics:${{ steps.get_version.outputs.version_tag }}
- name: Push Docker Image with latest tag - name: Push Docker Image with latest tag
if: github.event_name == 'push' || (github.event.inputs[matrix.dockerfile] == 'true' && github.event.inputs.push == 'true') if: github.event_name == 'push' || (github.event.inputs[matrix.dockerfile] == 'true' && github.event.inputs.push == 'true')
run: | uses: ultralytics/actions/retry@main
docker push ultralytics/ultralytics:${{ matrix.tags }} with:
if [[ "${{ matrix.tags }}" == "latest" ]]; then timeout_minutes: 15
t=ultralytics/ultralytics:latest-runner retry_delay_seconds: 300
docker build -f docker/Dockerfile-runner -t $t . retries: 2
docker push $t run: |
fi docker push ultralytics/ultralytics:${{ matrix.tags }}
if [[ "${{ matrix.tags }}" == "latest-python" ]]; then if [[ "${{ matrix.tags }}" == "latest" ]]; then
t=ultralytics/ultralytics:latest-jupyter t=ultralytics/ultralytics:latest-runner
v=ultralytics/ultralytics:${{ steps.get_version.outputs.version }}-jupyter docker build -f docker/Dockerfile-runner -t $t .
docker build -f docker/Dockerfile-jupyter -t $t -t $v . docker push $t
docker push $t fi
if [[ "${{ steps.check_tag.outputs.new_release }}" == "true" ]]; then if [[ "${{ matrix.tags }}" == "latest-python" ]]; then
docker push $v t=ultralytics/ultralytics:latest-jupyter
v=ultralytics/ultralytics:${{ steps.get_version.outputs.version }}-jupyter
docker build -f docker/Dockerfile-jupyter -t $t -t $v .
docker push $t
if [[ "${{ steps.check_tag.outputs.new_release }}" == "true" ]]; then
docker push $v
fi
fi fi
fi
trigger-actions: trigger-actions:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -11,10 +11,9 @@ RUN uv pip install --system jupyterlab
# Create persistent data directory structure # Create persistent data directory structure
RUN mkdir /data RUN mkdir /data
# Configure YOLO directory paths # Configure YOLO directories
RUN mkdir /data/datasets && yolo settings datasets_dir="/data/datasets" RUN mkdir /data/{datasets,weights,runs} && \
RUN mkdir /data/weights && yolo settings weights_dir="/data/weights" yolo settings datasets_dir="/data/datasets" weights_dir="/data/weights" runs_dir="/data/runs"
RUN mkdir /data/runs && yolo settings runs_dir="/data/runs"
# Start JupyterLab with tutorial notebook # Start JupyterLab with tutorial notebook
ENTRYPOINT ["/usr/local/bin/jupyter", "lab", "--allow-root", "--ip=*", "/ultralytics/examples/tutorial.ipynb"] ENTRYPOINT ["/usr/local/bin/jupyter", "lab", "--allow-root", "--ip=*", "/ultralytics/examples/tutorial.ipynb"]