Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#20059 Fix YOLOv8-ONNXRuntime example links

Merged
Ghost merged 1 commits into Ultralytics:main from ultralytics:fix-example-links
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
  1. # Ultralytics ๐Ÿš€ AGPL-3.0 License - https://ultralytics.com/license
  2. # Builds ultralytics/ultralytics:latest images on DockerHub https://hub.docker.com/r/ultralytics
  3. name: Publish Docker Images
  4. on:
  5. push:
  6. branches: [main]
  7. paths-ignore:
  8. - "docs/**"
  9. - "mkdocs.yml"
  10. workflow_dispatch:
  11. inputs:
  12. Dockerfile:
  13. type: boolean
  14. description: Use Dockerfile
  15. default: true
  16. Dockerfile-cpu:
  17. type: boolean
  18. description: Use Dockerfile-cpu
  19. default: true
  20. Dockerfile-arm64:
  21. type: boolean
  22. description: Use Dockerfile-arm64
  23. default: true
  24. Dockerfile-jetson-jetpack6:
  25. type: boolean
  26. description: Use Dockerfile-jetson-jetpack6
  27. default: true
  28. Dockerfile-jetson-jetpack5:
  29. type: boolean
  30. description: Use Dockerfile-jetson-jetpack5
  31. default: true
  32. Dockerfile-jetson-jetpack4:
  33. type: boolean
  34. description: Use Dockerfile-jetson-jetpack4
  35. default: true
  36. Dockerfile-python:
  37. type: boolean
  38. description: Use Dockerfile-python
  39. default: true
  40. Dockerfile-conda:
  41. type: boolean
  42. description: Use Dockerfile-conda
  43. default: true
  44. push:
  45. type: boolean
  46. description: Publish to DockerHub and ghcr.io
  47. jobs:
  48. docker:
  49. if: github.repository == 'ultralytics/ultralytics'
  50. name: Push
  51. strategy:
  52. fail-fast: false
  53. max-parallel: 10
  54. matrix:
  55. include:
  56. - dockerfile: "Dockerfile"
  57. tags: "latest"
  58. platforms: "linux/amd64"
  59. runs_on: "ubuntu-latest"
  60. - dockerfile: "Dockerfile-cpu"
  61. tags: "latest-cpu"
  62. platforms: "linux/amd64"
  63. runs_on: "ubuntu-latest"
  64. - dockerfile: "Dockerfile-arm64"
  65. tags: "latest-arm64"
  66. platforms: "linux/arm64"
  67. runs_on: "ubuntu-24.04-arm"
  68. - dockerfile: "Dockerfile-jetson-jetpack6"
  69. tags: "latest-jetson-jetpack6"
  70. platforms: "linux/arm64"
  71. runs_on: "ubuntu-24.04-arm"
  72. - dockerfile: "Dockerfile-jetson-jetpack5"
  73. tags: "latest-jetson-jetpack5"
  74. platforms: "linux/arm64"
  75. runs_on: "ubuntu-24.04-arm"
  76. - dockerfile: "Dockerfile-jetson-jetpack4"
  77. tags: "latest-jetson-jetpack4"
  78. platforms: "linux/arm64"
  79. runs_on: "ubuntu-24.04-arm"
  80. - dockerfile: "Dockerfile-python"
  81. tags: "latest-python"
  82. platforms: "linux/amd64"
  83. runs_on: "ubuntu-latest"
  84. # - dockerfile: "Dockerfile-conda"
  85. # tags: "latest-conda"
  86. # platforms: "linux/amd64"
  87. runs-on: ${{ matrix.runs_on }}
  88. outputs:
  89. new_release: ${{ steps.check_tag.outputs.new_release }}
  90. steps:
  91. - name: Cleanup disk space
  92. uses: ultralytics/actions/cleanup-disk@main
  93. - name: Checkout repo
  94. uses: actions/checkout@v4
  95. with:
  96. fetch-depth: 0 # copy full .git directory to access full git history in Docker images
  97. - name: Set up Docker Buildx
  98. uses: docker/setup-buildx-action@v3
  99. - name: Login to Docker Hub
  100. uses: docker/login-action@v3
  101. with:
  102. username: ${{ secrets.DOCKERHUB_USERNAME }}
  103. password: ${{ secrets.DOCKERHUB_TOKEN }}
  104. - name: Login to GHCR
  105. uses: docker/login-action@v3
  106. with:
  107. registry: ghcr.io
  108. username: ${{ github.repository_owner }}
  109. password: ${{ secrets._GITHUB_TOKEN }}
  110. - name: Retrieve Ultralytics version
  111. id: get_version
  112. run: |
  113. VERSION=$(grep "^__version__ =" ultralytics/__init__.py | awk -F'"' '{print $2}')
  114. echo "Retrieved Ultralytics version: $VERSION"
  115. echo "version=$VERSION" >> $GITHUB_OUTPUT
  116. VERSION_TAG=$(echo "${{ matrix.tags }}" | sed "s/latest/${VERSION}/")
  117. echo "Intended version tag: $VERSION_TAG"
  118. echo "version_tag=$VERSION_TAG" >> $GITHUB_OUTPUT
  119. - name: Check if version tag exists on DockerHub
  120. id: check_tag
  121. run: |
  122. RESPONSE=$(curl -s https://hub.docker.com/v2/repositories/ultralytics/ultralytics/tags/$VERSION_TAG)
  123. MESSAGE=$(echo $RESPONSE | jq -r '.message')
  124. if [[ "$MESSAGE" == "null" ]]; then
  125. echo "Tag $VERSION_TAG already exists on DockerHub."
  126. echo "new_release=false" >> $GITHUB_OUTPUT
  127. elif [[ "$MESSAGE" == *"404"* ]]; then
  128. echo "Tag $VERSION_TAG does not exist on DockerHub."
  129. echo "new_release=true" >> $GITHUB_OUTPUT
  130. else
  131. echo "Unexpected response from DockerHub. Please check manually."
  132. echo "new_release=false" >> $GITHUB_OUTPUT
  133. fi
  134. env:
  135. VERSION_TAG: ${{ steps.get_version.outputs.version_tag }}
  136. - name: Build Image
  137. if: github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true'
  138. uses: ultralytics/actions/retry@main
  139. with:
  140. timeout_minutes: 120
  141. retry_delay_seconds: 60
  142. retries: 2
  143. run: |
  144. docker build \
  145. --platform ${{ matrix.platforms }} \
  146. --label "org.opencontainers.image.source=https://github.com/ultralytics/ultralytics" \
  147. --label "org.opencontainers.image.description=Ultralytics image" \
  148. --label "org.opencontainers.image.licenses=AGPL-3.0-or-later" \
  149. -f docker/${{ matrix.dockerfile }} \
  150. -t ultralytics/ultralytics:${{ matrix.tags }} \
  151. -t ultralytics/ultralytics:${{ steps.get_version.outputs.version_tag }} \
  152. -t ghcr.io/ultralytics/ultralytics:${{ matrix.tags }} \
  153. -t ghcr.io/ultralytics/ultralytics:${{ steps.get_version.outputs.version_tag }} \
  154. .
  155. - name: Check Environment
  156. if: (github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true') && matrix.platforms == 'linux/amd64' && matrix.dockerfile != 'Dockerfile-conda' # arm64 images not supported on GitHub CI runners
  157. run: docker run ultralytics/ultralytics:${{ matrix.tags }} /bin/bash -c "yolo checks && uv pip list"
  158. - name: Run Tests
  159. if: (github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true') && matrix.platforms == 'linux/amd64' && matrix.dockerfile != 'Dockerfile-conda' # arm64 images not supported on GitHub CI runners
  160. run: docker run ultralytics/ultralytics:${{ matrix.tags }} /bin/bash -c "pip install pytest && pytest tests"
  161. - name: Run Benchmarks
  162. # WARNING: Dockerfile (GPU) error on TF.js export 'module 'numpy' has no attribute 'object'.
  163. if: (github.event_name == 'push' || github.event.inputs[matrix.dockerfile] == 'true') && matrix.platforms == 'linux/amd64' && matrix.dockerfile != 'Dockerfile' && matrix.dockerfile != 'Dockerfile-conda' # arm64 images not supported on GitHub CI runners
  164. run: docker run ultralytics/ultralytics:${{ matrix.tags }} yolo benchmark model=yolo11n.pt imgsz=160 verbose=0.309
  165. - name: Push Docker Image with Ultralytics version tag
  166. 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'
  167. uses: ultralytics/actions/retry@main
  168. with:
  169. timeout_minutes: 15
  170. retry_delay_seconds: 300
  171. retries: 2
  172. run: |
  173. t="ultralytics/ultralytics:${{ steps.get_version.outputs.version_tag }}"
  174. docker push $t
  175. docker push ghcr.io/$t
  176. - name: Build and Push Additional Images (latest-runner and latest-jupyter)
  177. if: github.event_name == 'push' || (github.event.inputs[matrix.dockerfile] == 'true' && github.event.inputs.push == 'true')
  178. uses: ultralytics/actions/retry@main
  179. with:
  180. timeout_minutes: 15
  181. retry_delay_seconds: 300
  182. retries: 2
  183. run: |
  184. t="ultralytics/ultralytics:${{ matrix.tags }}"
  185. docker push $t
  186. docker push ghcr.io/$t
  187. if [[ "${{ matrix.tags }}" == "latest" ]]; then
  188. t="ultralytics/ultralytics:latest-runner"
  189. docker build -f docker/Dockerfile-runner -t $t -t ghcr.io/$t \
  190. --label "org.opencontainers.image.source=https://github.com/ultralytics/ultralytics" \
  191. --label "org.opencontainers.image.description=Ultralytics runner image" \
  192. --label "org.opencontainers.image.licenses=AGPL-3.0-or-later" \
  193. .
  194. docker push $t
  195. docker push ghcr.io/$t
  196. fi
  197. if [[ "${{ matrix.tags }}" == "latest-python" ]]; then
  198. t="ultralytics/ultralytics:latest-jupyter"
  199. v="ultralytics/ultralytics:${{ steps.get_version.outputs.version }}-jupyter"
  200. docker build -f docker/Dockerfile-jupyter -t $t -t ghcr.io/$t -t $v -t ghcr.io/$v \
  201. --label "org.opencontainers.image.source=https://github.com/ultralytics/ultralytics" \
  202. --label "org.opencontainers.image.description=Ultralytics Jupyter image" \
  203. --label "org.opencontainers.image.licenses=AGPL-3.0-or-later" \
  204. .
  205. docker push $t
  206. docker push ghcr.io/$t
  207. if [[ "${{ steps.check_tag_dockerhub.outputs.new_release }}" == "true" ]]; then
  208. docker push $v
  209. docker push ghcr.io/$v
  210. fi
  211. fi
  212. trigger-actions:
  213. runs-on: ubuntu-latest
  214. needs: docker
  215. # Only trigger actions on new Ultralytics releases
  216. if: success() && github.repository == 'ultralytics/ultralytics' && github.event_name == 'push' && needs.docker.outputs.new_release == 'true'
  217. steps:
  218. - name: Trigger Additional GitHub Actions
  219. env:
  220. GH_TOKEN: ${{ secrets._GITHUB_TOKEN }}
  221. run: |
  222. sleep 60
  223. gh workflow run deploy_cloud_run.yml \
  224. --repo ultralytics/assistant \
  225. --ref main
  226. notify:
  227. runs-on: ubuntu-latest
  228. needs: [docker, trigger-actions]
  229. if: always()
  230. steps:
  231. - name: Check for failure and notify
  232. if: needs.docker.result == 'failure' && github.repository == 'ultralytics/ultralytics' && github.event_name == 'push' && github.run_attempt == '1'
  233. uses: slackapi/slack-github-action@v2.0.0
  234. with:
  235. webhook-type: incoming-webhook
  236. webhook: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
  237. payload: |
  238. text: "<!channel> GitHub Actions error for ${{ github.workflow }} โŒ\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n"
Discard
Tip!

Press p or to see the previous file or, n or to see the next file