Skip to content

Commit adcb113

Browse files
committed
Remove the orphaned onnxruntime Dockerfiles
#11803 dropped onnx and flax from the docker build matrix in build_docker_images.yml. #12151 finished the flax half by deleting docker/diffusers-flax-*, but the two onnxruntime directories were left behind, so docker/ has listed two images for thirteen months that neither job in the workflow builds. Their :latest tags on Docker Hub have been frozen since 2025-06-27 as a result. Delete docker/diffusers-onnxruntime-cpu and docker/diffusers-onnxruntime-cuda, mirroring what was done for flax. Nothing else in the repo references them: every test workflow filters ONNX out with -k "not Onnx", run_nightly_onnx_tests is commented out, and no doc or script names the images. Add tests/others/test_docker_images.py, which asserts that the directories under docker/ are exactly the images named in both jobs of build_docker_images.yml, the PR-time ALLOWED_IMAGES array and the nightly strategy.matrix.image-name list. It fails on both before this change and passes after. This does not remove the stale tags from Docker Hub, which needs registry credentials. Fixes #14325
1 parent 4b8e466 commit adcb113

3 files changed

Lines changed: 26 additions & 98 deletions

File tree

docker/diffusers-onnxruntime-cpu/Dockerfile

Lines changed: 0 additions & 49 deletions
This file was deleted.

docker/diffusers-onnxruntime-cuda/Dockerfile

Lines changed: 0 additions & 49 deletions
This file was deleted.

tests/others/test_docker_images.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import os
2+
import re
3+
import unittest
4+
5+
import yaml
6+
7+
8+
git_repo_path = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
9+
docker_path = os.path.join(git_repo_path, "docker")
10+
workflow_path = os.path.join(git_repo_path, ".github", "workflows", "build_docker_images.yml")
11+
12+
13+
class TestDockerImages(unittest.TestCase):
14+
def setUp(self):
15+
self.image_dirs = set(os.listdir(docker_path))
16+
with open(workflow_path, "r") as f:
17+
self.workflow = yaml.safe_load(f)
18+
19+
def test_images_are_built_on_pull_requests(self):
20+
run = self.workflow["jobs"]["test-build-docker-images"]["steps"][-1]["run"]
21+
allowed_images = re.search(r"ALLOWED_IMAGES=\(\n(.*?)\)", run, flags=re.DOTALL).group(1)
22+
self.assertSetEqual(set(allowed_images.split()), self.image_dirs)
23+
24+
def test_images_are_pushed_on_schedule(self):
25+
matrix = self.workflow["jobs"]["build-and-push-docker-images"]["strategy"]["matrix"]
26+
self.assertSetEqual(set(matrix["image-name"]), self.image_dirs)

0 commit comments

Comments
 (0)