Skip to content

Commit f010ebe

Browse files
authored
Cherry pick 3.18 udi fixes to devspaces-3-rhel-9 (#729)
* Update UDI to automatically detect fuse and for podman 5 support Fixes are from devfile/developer-images/pull/198 and devfile/developer-images/pull/209 Signed-off-by: David Kwon <[email protected]> * Update .stow-local-ignore with files in /home/user that would break running stow Fix from devfile/developer-images/pull/196 Signed-off-by: David Kwon <[email protected]> * Update virtualenv to 20.28.0 Signed-off-by: David Kwon <[email protected]> * Fix UDI build (#709) * Undo 9a57bfc * Update virtualenv to 20.28.0 in requirements-build.in and run pip-compile * Update hatch-vcs, hatchling, packaging, and all calver * Move && to previous line Signed-off-by: David Kwon <[email protected]> --------- Signed-off-by: David Kwon <[email protected]>
1 parent 95848c4 commit f010ebe

File tree

5 files changed

+61
-30
lines changed

5 files changed

+61
-30
lines changed

devspaces-udi/Dockerfile

+1-5
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,7 @@ RUN \
220220
mkdir -p /var/lib/shared/overlay-images /var/lib/shared/overlay-layers; \
221221
touch /var/lib/shared/overlay-images/images.lock; \
222222
touch /var/lib/shared/overlay-layers/layers.lock && \
223-
## Rootless podman install #5: but use VFS since we were not able to make Fuse work yet...
224-
# TODO switch this to fuse in OCP 4.12?
225-
mkdir -p "${HOME}"/.config/containers && \
226-
(echo '[storage]';echo 'driver = "vfs"') > "${HOME}"/.config/containers/storage.conf && \
227-
## Rootless podman install #6: rename podman to allow the execution of 'podman run' using
223+
## Rootless podman install #5: rename podman to allow the execution of 'podman run' using
228224
## kubedock but 'podman build' using podman.orig
229225
mv /usr/bin/podman /usr/bin/podman.orig && \
230226
# Docker alias

devspaces-udi/build/python/requirements-build.in

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
# for python lang server + yq
55
argcomplete==2.0.0
66
attrs==22.1.0
7+
calver==2022.6.26
78
Cython==0.29.32
89
exceptiongroup==1.0.1
910
flit_scm==1.7.0
1011
flit_core==3.8.0
11-
hatch-vcs>=0.2
12-
hatchling>=1.11.1
12+
hatch-vcs>=0.3
13+
hatchling==1.25
1314
iniconfig==1.1.1
14-
packaging==21.3
15+
packaging==23.2
1516
pip==23.0.1
1617
pluggy==1.0.0
1718
pyparsing==3.0.9
@@ -23,7 +24,7 @@ six==1.16.0
2324
toml==0.10.2
2425
tomli==2.0.1
2526
typing_extensions==4.4.0
26-
virtualenv
27+
virtualenv==20.28.0
2728
xmltodict==0.13.0
2829
wheel
2930
yq==3.1.0

devspaces-udi/build/python/requirements-build.txt

+16-21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.10
3-
# To update, run:
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
44
#
55
# pip-compile --allow-unsafe --output-file=requirements-build.txt requirements-build.in
66
#
@@ -12,17 +12,15 @@ attrs==22.1.0
1212
# via
1313
# -r requirements-build.in
1414
# pytest
15+
calver==2022.6.26
16+
# via -r requirements-build.in
1517
cython==0.29.32
1618
# via -r requirements-build.in
17-
distlib==0.3.6
19+
distlib==0.3.9
1820
# via virtualenv
19-
editables==0.3
20-
# via hatchling
2121
exceptiongroup==1.0.1
22-
# via
23-
# -r requirements-build.in
24-
# pytest
25-
filelock==3.8.2
22+
# via -r requirements-build.in
23+
filelock==3.16.1
2624
# via virtualenv
2725
flake8==6.0.0
2826
# via -r requirements-build.in
@@ -32,9 +30,9 @@ flit-core==3.8.0
3230
# flit-scm
3331
flit-scm==1.7.0
3432
# via -r requirements-build.in
35-
hatch-vcs==0.2.1
33+
hatch-vcs==0.4.0
3634
# via -r requirements-build.in
37-
hatchling==1.11.1
35+
hatchling==1.25.0
3836
# via
3937
# -r requirements-build.in
4038
# hatch-vcs
@@ -46,15 +44,15 @@ mccabe==0.7.0
4644
# via
4745
# -r requirements-build.in
4846
# flake8
49-
packaging==21.3
47+
packaging==23.2
5048
# via
5149
# -r requirements-build.in
5250
# hatchling
5351
# pytest
5452
# setuptools-scm
55-
pathspec==0.10.2
53+
pathspec==0.12.1
5654
# via hatchling
57-
platformdirs==2.6.0
55+
platformdirs==4.3.6
5856
# via virtualenv
5957
pluggy==1.0.0
6058
# via
@@ -70,9 +68,7 @@ pyflakes==3.0.1
7068
# -r requirements-build.in
7169
# flake8
7270
pyparsing==3.0.9
73-
# via
74-
# -r requirements-build.in
75-
# packaging
71+
# via -r requirements-build.in
7672
pytest==7.2.0
7773
# via -r requirements-build.in
7874
pyyaml==6.0
@@ -93,15 +89,14 @@ toml==0.10.2
9389
tomli==2.0.1
9490
# via
9591
# -r requirements-build.in
96-
# flit-scm
97-
# hatchling
98-
# pytest
9992
# setuptools-scm
93+
trove-classifiers==2025.1.7.14
94+
# via hatchling
10095
typing-extensions==4.4.0
10196
# via
10297
# -r requirements-build.in
10398
# setuptools-scm
104-
virtualenv==20.17.1
99+
virtualenv==20.28.0
105100
# via -r requirements-build.in
106101
wheel==0.38.4
107102
# via -r requirements-build.in

devspaces-udi/etc/.stow-local-ignore

+3
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
# but we don't want them to be symbolic links (or to cause stow conflicts). They will be copied to /home/user/ manually.
66
\.bashrc
77
\.bash_profile
8+
9+
# Ignore files under .config directory
10+
\.config

devspaces-udi/etc/entrypoint.sh

+36
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ else
118118
ln -f -s /usr/bin/podman.orig /home/tooling/.local/bin/podman
119119
fi
120120

121+
# Configure container builds to use vfs or fuse-overlayfs
122+
if [ ! -d "${HOME}/.config/containers" ]; then
123+
mkdir -p ${HOME}/.config/containers
124+
if [ -c "/dev/fuse" ] && [ -f "/usr/bin/fuse-overlayfs" ]; then
125+
(echo '[storage]';echo 'driver = "overlay"';echo '[storage.options.overlay]';echo 'mount_program = "/usr/bin/fuse-overlayfs"') > ${HOME}/.config/containers/storage.conf
126+
else
127+
(echo '[storage]';echo 'driver = "vfs"') > "${HOME}"/.config/containers/storage.conf
128+
fi
129+
fi
130+
121131
#############################################################################
122132
# Stow: If persistUserHome is enabled, then the contents of /home/user/
123133
# will be mounted by a PVC and overwritten. In this case, we use stow to
@@ -135,6 +145,32 @@ mountpoint -q /home/user/ || HOME_USER_MOUNTED=$?
135145
STOW_COMPLETE=/home/user/.stow_completed
136146

137147
if [ $HOME_USER_MOUNTED -eq 0 ] && [ ! -f $STOW_COMPLETE ]; then
148+
# There may be regular, non-symlink files in /home/user that match the
149+
# pathing of files in /home/tooling. Stow will error out when it tries to
150+
# stow on top of that. Instead, we can append to the current
151+
# /home/tooling/.stow-local-ignore file to ignore pre-existing,
152+
# non-symlinked files in /home/user that match those in /home/tooling before
153+
# we run stow.
154+
#
155+
# Create two text files containing a sorted path-based list of files in
156+
# /home/tooling and /home/user. Cut off "/home/user" and "/home/tooling" and
157+
# only get the sub-paths so we can do a proper comparison
158+
#
159+
# In the case of /home/user, we want regular file types and not symbolic
160+
# links.
161+
find /home/user -type f -xtype f -print | sort | sed 's|/home/user||g' > /tmp/user.txt
162+
find /home/tooling -print | sort | sed 's|/home/tooling||g' > /tmp/tooling.txt
163+
# We compare the two files, trying to find files that exist in /home/user
164+
# and /home/tooling. Being that the files that get flagged here are not
165+
# already synlinks, we will want to ignore them.
166+
IGNORE_FILES="$(comm -12 /tmp/user.txt /tmp/tooling.txt)"
167+
# We no longer require the file lists, so remove them
168+
rm /tmp/user.txt /tmp/tooling.txt
169+
# For each file we need to ignore, append them to
170+
# /home/tooling/.stow-local-ignore.
171+
for f in $IGNORE_FILES; do echo "${f}" >> /home/tooling/.stow-local-ignore;done
172+
# We are now ready to run stow
173+
#
138174
# Create symbolic links from /home/tooling/ -> /home/user/
139175
stow . -t /home/user/ -d /home/tooling/ --no-folding -v 2 > /tmp/stow.log 2>&1
140176
# Vim does not permit .viminfo to be a symbolic link for security reasons, so manually copy it

0 commit comments

Comments
 (0)