Paste P65870

(An Untitled Masterwork)
ActivePublic

Authored by isarantopoulos on Fri, Jul 5, 2:33 PM.
Tags
None
Referenced Files
F56239216: raw-paste-data.txt
Fri, Jul 5, 2:33 PM
Subscribers
None
```
docker-pkg -c config.yaml update amd-pytorch23 --version 2.3.0rocm6.0-3 --reason '* Append site-packages dir to PYTHONPATH' ./images/amd/pytorch23
== Step 0: scanning /Users/isaranto/repoz/production-images/./images/amd/pytorch23
Traceback (most recent call last):
File "/Users/isaranto/repoz/production-images/.venv/bin/docker-pkg", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/isaranto/repoz/docker-pkg/docker_pkg/cli.py", line 203, in main
update(application, args.reason, args.select, args.version)
File "/Users/isaranto/repoz/docker-pkg/docker_pkg/cli.py", line 259, in update
to_update = application.images_to_update()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/isaranto/repoz/docker-pkg/docker_pkg/builder.py", line 368, in images_to_update
self._build_dependencies()
File "/Users/isaranto/repoz/docker-pkg/docker_pkg/builder.py", line 361, in _build_dependencies
raise RuntimeError(
RuntimeError: Image amd-pytorch-common (dependency of docker-registry.wikimedia.org/amd-pytorch23:2.3.0rocm6.0-2-20240630) not found
```

Event Timeline

I've added these 2 lines of code to the template
+# Add the site-packages to the PYTHONPATH so that pip can discover the installed packages
+ENV PYTHONPATH=/opt/lib/python/site-packages:$PYTHONPATH

 seed_image: docker-registry.wikimedia.org/buster:latest
 base_images:
   - docker-registry.wikimedia.org/bullseye:latest
diff --git a/images/amd/pytorch23/Dockerfile.template b/images/amd/pytorch23/Dockerfile.template
index eb5b7a6..48b8ab1 100644
--- a/images/amd/pytorch23/Dockerfile.template
+++ b/images/amd/pytorch23/Dockerfile.template
@@ -9,3 +9,6 @@ FROM {{ "amd-pytorch-common" | image_tag }}
 USER {{ "somebody" | uid }}
 RUN  /usr/bin/pip3 install --target /opt/lib/python/base-packages --no-cache-dir --break-system-packages torch==2.3.0 --extra-index-url https://download.pytorch.org/whl/rocm6.0 && \
 /bin/bash -c 'for file in $(ls /opt/lib/python/base-packages | egrep -v "bin|share|__pycache__"); do ln -s "/opt/lib/python/base-packages/${file}" "/opt/lib/python/site-packages/${file}"; done'
+
+# Add the site-packages to the PYTHONPATH so that pip can discover the installed packages
+ENV PYTHONPATH=/opt/lib/python/site-packages:$PYTHONPATH
~
~
~
~
~
~
~
~
~
(END)