Skip to content

Commit ef33a50

Browse files
Merge branch 'master' into 8071-introduce-task-filter-class-in-celery
2 parents d3af22b + e1d722b commit ef33a50

File tree

57 files changed

+190
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+190
-171
lines changed

packages/postgres-database/docker/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ COPY --from=uv_build /uv /uvx /bin/
3232
# NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv
3333
RUN uv venv "${VIRTUAL_ENV}"
3434

35+
# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
36+
ENV UV_COMPILE_BYTECODE=1 \
37+
UV_LINK_MODE=copy
38+
3539
ARG GIT_BRANCH
3640
ARG GIT_REPOSITORY
3741

@@ -41,8 +45,6 @@ RUN git clone --single-branch --branch ${GIT_BRANCH} ${GIT_REPOSITORY} osparc-si
4145
FROM base AS production
4246

4347
ENV PYTHONOPTIMIZE=TRUE
44-
# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
45-
ENV UV_COMPILE_BYTECODE=1
4648

4749
WORKDIR /home/scu
4850
# ensure home folder is read/writable for user scu

packages/service-integration/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ ENV LANG=C.UTF-8
5050
ENV PYTHONDONTWRITEBYTECODE=1 \
5151
VIRTUAL_ENV=/home/scu/.venv
5252
# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
53-
ENV UV_COMPILE_BYTECODE=1
53+
ENV UV_COMPILE_BYTECODE=1 \
54+
UV_LINK_MODE=copy
5455

5556
# Ensures that the python and pip executables used
5657
# in the image will be those from our virtualenv.

services/agent/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
3333
set -eux && \
3434
apt-get update && \
3535
apt-get install -y --no-install-recommends \
36+
fd-find \
3637
gosu \
3738
curl \
3839
&& apt-get clean -y \
@@ -113,6 +114,9 @@ WORKDIR /build
113114
FROM build AS prod-only-deps
114115

115116
ENV SC_BUILD_TARGET=prod-only-deps
117+
# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
118+
ENV UV_COMPILE_BYTECODE=1 \
119+
UV_LINK_MODE=copy
116120

117121
WORKDIR /build/services/agent
118122

@@ -138,8 +142,6 @@ ENV SC_BUILD_TARGET=production \
138142
SC_BOOT_MODE=production
139143

140144
ENV PYTHONOPTIMIZE=TRUE
141-
# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
142-
ENV UV_COMPILE_BYTECODE=1
143145

144146
WORKDIR /home/scu
145147

services/agent/docker/boot.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then
2424
command -v python | sed 's/^/ /'
2525

2626
cd services/agent
27-
uv pip --quiet sync requirements/dev.txt
27+
uv pip --quiet sync --link-mode=copy requirements/dev.txt
2828
cd -
2929
echo "$INFO" "PIP :"
3030
uv pip list
@@ -33,7 +33,7 @@ fi
3333
if [ "${SC_BOOT_MODE}" = "debug" ]; then
3434
# NOTE: production does NOT pre-installs debugpy
3535
if command -v uv >/dev/null 2>&1; then
36-
uv pip install debugpy
36+
uv pip install --link-mode=copy debugpy
3737
else
3838
pip install debugpy
3939
fi
@@ -48,15 +48,14 @@ SERVER_LOG_LEVEL=$(echo "${APP_LOG_LEVEL}" | tr '[:upper:]' '[:lower:]')
4848
echo "$INFO" "Log-level app/server: $APP_LOG_LEVEL/$SERVER_LOG_LEVEL"
4949

5050
if [ "${SC_BOOT_MODE}" = "debug" ]; then
51-
reload_dir_packages=$(find /devel/packages -maxdepth 3 -type d -path "*/src/*" ! -path "*.*" -exec echo '--reload-dir {} \' \;)
52-
51+
reload_dir_packages=$(fdfind src /devel/packages --exec echo '--reload-dir {} ' | tr '\n' ' ')
5352
exec sh -c "
5453
cd services/agent/src/simcore_service_agent && \
5554
python -Xfrozen_modules=off -m debugpy --listen 0.0.0.0:${AGENT_SERVER_REMOTE_DEBUG_PORT} -m uvicorn main:the_app \
5655
--host 0.0.0.0 \
5756
--port 8000 \
5857
--reload \
59-
$reload_dir_packages
58+
$reload_dir_packages \
6059
--reload-dir . \
6160
--log-level \"${SERVER_LOG_LEVEL}\"
6261
"

services/agent/docker/entrypoint.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then
5656
usermod --uid "$HOST_USERID" --gid "$HOST_GROUPID" "$SC_USER_NAME"
5757

5858
echo "$INFO" "Changing group properties of files around from $SC_USER_ID to group $CONT_GROUPNAME"
59-
find / -path /proc -prune -o -group "$SC_USER_ID" -exec chgrp --no-dereference "$CONT_GROUPNAME" {} \;
60-
# change user property of files already around
59+
fdfind --owner ":$SC_USER_ID" --exclude proc --exec-batch chgrp --no-dereference "$CONT_GROUPNAME" . '/'
6160
echo "$INFO" "Changing ownership properties of files around from $SC_USER_ID to group $CONT_GROUPNAME"
62-
find / -path /proc -prune -o -user "$SC_USER_ID" -exec chown --no-dereference "$SC_USER_NAME" {} \;
61+
fdfind --owner "$SC_USER_ID:" --exclude proc --exec-batch chown --no-dereference "$SC_USER_NAME" . '/'
6362
fi
6463
fi
6564

services/api-server/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
3030
set -eux && \
3131
apt-get update && \
3232
apt-get install -y --no-install-recommends \
33+
fd-find \
3334
gosu \
3435
&& apt-get clean -y \
3536
&& rm -rf /var/lib/apt/lists/* \
@@ -106,6 +107,9 @@ WORKDIR /build
106107
FROM build AS prod-only-deps
107108

108109
ENV SC_BUILD_TARGET=prod-only-deps
110+
# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
111+
ENV UV_COMPILE_BYTECODE=1 \
112+
UV_LINK_MODE=copy
109113

110114
WORKDIR /build/services/api-server
111115

@@ -132,8 +136,6 @@ ENV SC_BUILD_TARGET=production \
132136
SC_BOOT_MODE=production
133137

134138
ENV PYTHONOPTIMIZE=TRUE
135-
# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
136-
ENV UV_COMPILE_BYTECODE=1
137139

138140
WORKDIR /home/scu
139141

services/api-server/docker/boot.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then
1919
command -v python | sed 's/^/ /'
2020

2121
cd services/api-server
22-
uv pip --quiet sync requirements/dev.txt
22+
uv pip --quiet sync --link-mode=copy requirements/dev.txt
2323
cd -
2424
echo "$INFO" "PIP :"
2525
uv pip list
@@ -28,7 +28,7 @@ fi
2828
if [ "${SC_BOOT_MODE}" = "debug" ]; then
2929
# NOTE: production does NOT pre-installs debugpy
3030
if command -v uv >/dev/null 2>&1; then
31-
uv pip install debugpy
31+
uv pip install --link-mode=copy debugpy
3232
else
3333
pip install debugpy
3434
fi
@@ -40,14 +40,14 @@ SERVER_LOG_LEVEL=$(echo "${APP_LOG_LEVEL}" | tr '[:upper:]' '[:lower:]')
4040
echo "$INFO" "Log-level app/server: $APP_LOG_LEVEL/$SERVER_LOG_LEVEL"
4141

4242
if [ "${SC_BOOT_MODE}" = "debug" ]; then
43-
reload_dir_packages=$(find /devel/packages -maxdepth 3 -type d -path "*/src/*" ! -path "*.*" -exec echo '--reload-dir {} \' \;)
43+
reload_dir_packages=$(fdfind src /devel/packages --exec echo '--reload-dir {} ' | tr '\n' ' ')
4444

4545
exec sh -c "
4646
cd services/api-server/src/simcore_service_api_server && \
4747
python -Xfrozen_modules=off -m debugpy --listen 0.0.0.0:${API_SERVER_REMOTE_DEBUG_PORT} -m uvicorn main:the_app \
4848
--host 0.0.0.0 \
4949
--reload \
50-
$reload_dir_packages
50+
$reload_dir_packages \
5151
--reload-dir . \
5252
--log-level \"${SERVER_LOG_LEVEL}\"
5353
"

services/api-server/docker/entrypoint.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then
5757
usermod --uid "$HOST_USERID" --gid "$HOST_GROUPID" "$SC_USER_NAME"
5858

5959
echo "$INFO" "Changing group properties of files around from $SC_USER_ID to group $CONT_GROUPNAME"
60-
find / -path /proc -prune -o -group "$SC_USER_ID" -exec chgrp --no-dereference "$CONT_GROUPNAME" {} \;
61-
# change user property of files already around
60+
fdfind --owner ":$SC_USER_ID" --exclude proc --exec-batch chgrp --no-dereference "$CONT_GROUPNAME" . '/'
6261
echo "$INFO" "Changing ownership properties of files around from $SC_USER_ID to group $CONT_GROUPNAME"
63-
find / -path /proc -prune -o -user "$SC_USER_ID" -exec chown --no-dereference "$SC_USER_NAME" {} \;
62+
fdfind --owner "$SC_USER_ID:" --exclude proc --exec-batch chown --no-dereference "$SC_USER_NAME" . '/'
6463
fi
6564
fi
6665

services/autoscaling/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
3434
set -eux; \
3535
apt-get update; \
3636
apt-get install -y --no-install-recommends \
37+
fd-find \
3738
gosu \
3839
ca-certificates \
3940
curl \
@@ -122,6 +123,9 @@ WORKDIR /build
122123
FROM build AS prod-only-deps
123124

124125
ENV SC_BUILD_TARGET=prod-only-deps
126+
# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
127+
ENV UV_COMPILE_BYTECODE=1 \
128+
UV_LINK_MODE=copy
125129

126130
WORKDIR /build/services/autoscaling
127131

@@ -147,8 +151,6 @@ ENV SC_BUILD_TARGET=production \
147151
SC_BOOT_MODE=production
148152

149153
ENV PYTHONOPTIMIZE=TRUE
150-
# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
151-
ENV UV_COMPILE_BYTECODE=1
152154

153155
WORKDIR /home/scu
154156
# ensure home folder is read/writable for user scu

services/autoscaling/docker/boot.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then
2424
command -v python | sed 's/^/ /'
2525

2626
cd services/autoscaling
27-
uv pip --quiet sync requirements/dev.txt
27+
uv pip --quiet sync --link-mode=copy requirements/dev.txt
2828
cd -
2929
uv pip list
3030
fi
3131

3232
if [ "${SC_BOOT_MODE}" = "debug" ]; then
3333
# NOTE: production does NOT pre-installs debugpy
3434
if command -v uv >/dev/null 2>&1; then
35-
uv pip install debugpy
35+
uv pip install --link-mode=copy debugpy
3636
else
3737
pip install debugpy
3838
fi
@@ -47,14 +47,14 @@ SERVER_LOG_LEVEL=$(echo "${APP_LOG_LEVEL}" | tr '[:upper:]' '[:lower:]')
4747
echo "$INFO" "Log-level app/server: $APP_LOG_LEVEL/$SERVER_LOG_LEVEL"
4848

4949
if [ "${SC_BOOT_MODE}" = "debug" ]; then
50-
reload_dir_packages=$(find /devel/packages -maxdepth 3 -type d -path "*/src/*" ! -path "*.*" -exec echo '--reload-dir {} \' \;)
50+
reload_dir_packages=$(fdfind src /devel/packages --exec echo '--reload-dir {} ' | tr '\n' ' ')
5151

5252
exec sh -c "
5353
cd services/autoscaling/src/simcore_service_autoscaling && \
5454
python -Xfrozen_modules=off -m debugpy --listen 0.0.0.0:${AUTOSCALING_REMOTE_DEBUGGING_PORT} -m uvicorn main:the_app \
5555
--host 0.0.0.0 \
5656
--reload \
57-
$reload_dir_packages
57+
$reload_dir_packages \
5858
--reload-dir . \
5959
--log-level \"${SERVER_LOG_LEVEL}\"
6060
"

0 commit comments

Comments
 (0)