Commit 5fe0edd
committed
Fix runtime spacy model loading for non-root containers (#26753)
* fix: run pip installs as non-root user to enable runtime model downloads
When the container runs with securityContext runAsUser: 1000 but no
/etc/passwd entry for that UID, Python disables user site-packages.
This causes spacy.load() to fail after downloading a model via pip
--user, because the installed package is invisible to the import
system.
Creating the openmetadata user (UID 1000, GID 1000) before pip
installs solves this: all packages are installed under ~/.local at
build time, so the user site-packages directory already exists when
the interpreter starts. Runtime downloads (e.g. spacy models) land
in the same directory and are immediately importable.
* Ensure `openmetadata` user owns `/ingestion` workdir
* Add local bin to PATH1 parent 08577ec commit 5fe0edd
2 files changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
78 | 91 | | |
79 | 92 | | |
80 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
80 | 93 | | |
81 | 94 | | |
82 | 95 | | |
| |||
0 commit comments