You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Container images: Support "template" images and use it for cuda-tests
The `gpu/cuda-tests` and `gpu/cuda-tests-12-8` are duplicates of each other,
other than the CUDA version they use. As more CUDA versions are added, this
isn't a scalable pattern.
This change adds support in the `Makefile` (more specifically
`tools/images.mk`) for "image templates" and "image template instances".
If an image directory ends in `.tmpl`, it will be ignored from the set of images
that the `Makefile` recognizes. Instead, this directory can be used to
instantiate other images.
For example, given the following filesystem structure:
```
images/
├─ my-little-image.tmpl/
│ └─ Dockerfile
├─ my-little-image.foo.bar → my-little-image.tmpl (symlink)
└─ my-little-image.baz.qux → my-little-image.tmpl (symlink)
```
Then this will effectively create two images, `my-little-image.foo.bar` and
`my-little-image.baz.qux`. It will not create a `my-little-image.tmpl` image.
The behavior of the template instance images is determined by the
`TEMPLATE_VERSION` build argument passed to `my-little-image.tmpl/Dockerfile`.
This argument takes on the value of everything after the first `.` character of
the last component of the template instance image name. For example, the image
`my-little-image.foo.bar` will be built with `docker build
--build-arg=TEMPLATE_VERSION=foo.bar`, whereas the `my-little-image.baz.quux`
will be built with `docker build --build-arg=TEMPLATE_VERSION=baz.qux`. The
`my-little-image.tmpl/Dockerfile` image definition file can use this variable to
make the necessary tweaks to distinguish these two images.
#codehealth
PiperOrigin-RevId: 756101224
0 commit comments