Skip to content

Commit 0d87700

Browse files
committed
doc: Add instructions to build custom container images
1 parent a30a5da commit 0d87700

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

images/runtime/examples/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,43 @@
33
> [!IMPORTANT]
44
> These examples are provided for documentation purpose, on how to build custom container images for Distributed Workloads.
55
> These container examples are not supported, not part of OpenShift AI.
6+
7+
## Prerequisites
8+
9+
You need to have Podman install on your local environment, to build and push these custom container images to your registry, so they can be used to run distributed workloads in OpenShift AI.
10+
11+
## Build
12+
13+
The container images can be built using Podman, e.g., for the `ray-torch` example:
14+
15+
```
16+
export IMG=ray-torch
17+
cd $IMG
18+
podman build -t ${IMG} -f Dockerfile
19+
```
20+
21+
You can then push that image to your container registry.
22+
Alternatively, you can use the [integrated OpenShift container registry](https://docs.openshift.com/container-platform/4.16/registry/index.html#registry-integrated-openshift-registry_registry-overview), by following these intructions:
23+
24+
1. Expose the integrated container registry:
25+
```
26+
oc patch configs.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"defaultRoute":true}}' --type=merge
27+
```
28+
2. Wait for the route to the container registry to be admitted:
29+
```
30+
oc wait -n openshift-image-registry route/default-route --for=jsonpath='{.status.ingress[0].conditions[0].status}'=True
31+
```
32+
3. Login to the container registry, e.g., with Podman:
33+
```
34+
podman login -u $(oc whoami) -p $(oc whoami -t) $(oc registry info)
35+
```
36+
4. Push the image to the integrated container registry:
37+
```
38+
podman tag ${IMG} $(oc registry info)/$(oc project -q)/${IMG}
39+
podman push $(oc registry info)/$(oc project -q)/${IMG}
40+
```
41+
5. Retrieve the image repository for the tag you want, e.g.:
42+
```
43+
oc get is ${IMG} -o jsonpath='{.status.tags[?(@.tag=="<TAG>")].items[0].dockerImageReference}'
44+
```
45+
6. You can now use that image repository in your notebook.

0 commit comments

Comments
 (0)