From da47aba0ba8cdaeb0413da8a4840426873089692 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:08:36 +0200 Subject: [PATCH 01/23] install UV via COPY --- packages/postgres-database/docker/Dockerfile | 5 ++--- packages/service-integration/Dockerfile | 5 ++--- requirements/tools/Dockerfile | 5 ++--- services/agent/Dockerfile | 5 ++--- services/api-server/Dockerfile | 5 ++--- services/autoscaling/Dockerfile | 6 +++--- services/catalog/Dockerfile | 5 ++--- services/clusters-keeper/Dockerfile | 5 ++--- services/dask-sidecar/Dockerfile | 5 ++--- services/datcore-adapter/Dockerfile | 5 ++--- services/director-v2/Dockerfile | 5 ++--- services/dynamic-scheduler/Dockerfile | 5 ++--- services/dynamic-sidecar/Dockerfile | 21 ++++++++++---------- services/efs-guardian/Dockerfile | 5 ++--- services/invitations/Dockerfile | 5 ++--- services/migration/Dockerfile | 5 ++--- services/osparc-gateway-server/Dockerfile | 5 ++--- services/payments/Dockerfile | 5 ++--- services/resource-usage-tracker/Dockerfile | 5 ++--- services/storage/Dockerfile | 5 ++--- services/web/Dockerfile | 5 ++--- 21 files changed, 51 insertions(+), 71 deletions(-) diff --git a/packages/postgres-database/docker/Dockerfile b/packages/postgres-database/docker/Dockerfile index 7c3e74870b2d..3d3c75902751 100644 --- a/packages/postgres-database/docker/Dockerfile +++ b/packages/postgres-database/docker/Dockerfile @@ -22,9 +22,8 @@ RUN apt-get update \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" diff --git a/packages/service-integration/Dockerfile b/packages/service-integration/Dockerfile index 15c1de6cc24e..10e40a38ac80 100644 --- a/packages/service-integration/Dockerfile +++ b/packages/service-integration/Dockerfile @@ -55,9 +55,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/requirements/tools/Dockerfile b/requirements/tools/Dockerfile index e6af4395ed65..05660c5ed6d9 100644 --- a/requirements/tools/Dockerfile +++ b/requirements/tools/Dockerfile @@ -24,9 +24,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get clean -y -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/agent/Dockerfile b/services/agent/Dockerfile index fe6fef17c35f..1b70cbeba5ad 100644 --- a/services/agent/Dockerfile +++ b/services/agent/Dockerfile @@ -73,9 +73,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/api-server/Dockerfile b/services/api-server/Dockerfile index ced7167fe5c7..030bcb670322 100644 --- a/services/api-server/Dockerfile +++ b/services/api-server/Dockerfile @@ -69,9 +69,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/autoscaling/Dockerfile b/services/autoscaling/Dockerfile index 1821d873057a..cdf8393380bc 100644 --- a/services/autoscaling/Dockerfile +++ b/services/autoscaling/Dockerfile @@ -89,9 +89,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ + # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/catalog/Dockerfile b/services/catalog/Dockerfile index c4f48d2ec08f..7873fc70b9e7 100644 --- a/services/catalog/Dockerfile +++ b/services/catalog/Dockerfile @@ -70,9 +70,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/clusters-keeper/Dockerfile b/services/clusters-keeper/Dockerfile index 2dd08b4b44b4..8baf59f3ba38 100644 --- a/services/clusters-keeper/Dockerfile +++ b/services/clusters-keeper/Dockerfile @@ -89,9 +89,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/dask-sidecar/Dockerfile b/services/dask-sidecar/Dockerfile index a85f653f5ccd..4b234a3b28f5 100644 --- a/services/dask-sidecar/Dockerfile +++ b/services/dask-sidecar/Dockerfile @@ -80,9 +80,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/datcore-adapter/Dockerfile b/services/datcore-adapter/Dockerfile index bdd52d81841f..84276a851bba 100644 --- a/services/datcore-adapter/Dockerfile +++ b/services/datcore-adapter/Dockerfile @@ -70,9 +70,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/director-v2/Dockerfile b/services/director-v2/Dockerfile index 4780eb62e333..48ec8c0c6191 100644 --- a/services/director-v2/Dockerfile +++ b/services/director-v2/Dockerfile @@ -70,9 +70,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/dynamic-scheduler/Dockerfile b/services/dynamic-scheduler/Dockerfile index bc94b83125a1..f081c446b569 100644 --- a/services/dynamic-scheduler/Dockerfile +++ b/services/dynamic-scheduler/Dockerfile @@ -69,9 +69,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/dynamic-sidecar/Dockerfile b/services/dynamic-sidecar/Dockerfile index 3be8bae74d09..dafcf84fa7c7 100644 --- a/services/dynamic-sidecar/Dockerfile +++ b/services/dynamic-sidecar/Dockerfile @@ -53,14 +53,14 @@ RUN \ ./install_rclone.bash RUN AWS_CLI_VERSION="2.11.11" \ - && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWS_CLI_VERSION}.zip" -o "awscliv2.zip" \ - && apt-get update && apt-get install -y unzip \ - && unzip awscliv2.zip \ - && ./aws/install \ - && apt-get remove --purge -y unzip \ - && rm awscliv2.zip \ - && rm -rf awscliv2 \ - && aws --version + && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWS_CLI_VERSION}.zip" -o "awscliv2.zip" \ + && apt-get update && apt-get install -y unzip \ + && unzip awscliv2.zip \ + && ./aws/install \ + && apt-get remove --purge -y unzip \ + && rm awscliv2.zip \ + && rm -rf awscliv2 \ + && aws --version # simcore-user uid=8004(scu) gid=8004(scu) groups=8004(scu) ENV SC_USER_ID=8004 \ @@ -110,9 +110,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/efs-guardian/Dockerfile b/services/efs-guardian/Dockerfile index 229e43563c44..bb549ed38276 100644 --- a/services/efs-guardian/Dockerfile +++ b/services/efs-guardian/Dockerfile @@ -107,9 +107,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/invitations/Dockerfile b/services/invitations/Dockerfile index 5d935426c484..413c9e519f01 100644 --- a/services/invitations/Dockerfile +++ b/services/invitations/Dockerfile @@ -69,9 +69,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/migration/Dockerfile b/services/migration/Dockerfile index d70eec97f93a..ebe0f4f8a793 100644 --- a/services/migration/Dockerfile +++ b/services/migration/Dockerfile @@ -43,9 +43,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential \ git -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/osparc-gateway-server/Dockerfile b/services/osparc-gateway-server/Dockerfile index 59f55c8b3b6f..789a64900caa 100644 --- a/services/osparc-gateway-server/Dockerfile +++ b/services/osparc-gateway-server/Dockerfile @@ -72,9 +72,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ git \ golang-go -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/payments/Dockerfile b/services/payments/Dockerfile index 90cbb1c908e6..64ba4841c975 100644 --- a/services/payments/Dockerfile +++ b/services/payments/Dockerfile @@ -69,9 +69,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/resource-usage-tracker/Dockerfile b/services/resource-usage-tracker/Dockerfile index 55976c00c538..ca4b4833613f 100644 --- a/services/resource-usage-tracker/Dockerfile +++ b/services/resource-usage-tracker/Dockerfile @@ -70,9 +70,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ && apt-get install -y --no-install-recommends \ build-essential -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/storage/Dockerfile b/services/storage/Dockerfile index 12e60feb78dc..0f2a16c44eb4 100644 --- a/services/storage/Dockerfile +++ b/services/storage/Dockerfile @@ -78,9 +78,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential \ git -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/web/Dockerfile b/services/web/Dockerfile index 1a1a443333a4..e308949c6000 100644 --- a/services/web/Dockerfile +++ b/services/web/Dockerfile @@ -81,9 +81,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential \ libffi-dev -# NOTE: install https://github.com/astral-sh/uv ultra-fast rust-based pip replacement -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install uv~=0.2 +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed From b3f06acb21545ba09ef9a79bf18144281762ee07 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:43:00 +0200 Subject: [PATCH 02/23] added parametrization --- packages/postgres-database/docker/Dockerfile | 3 ++- packages/service-integration/Dockerfile | 3 ++- requirements/tools/Dockerfile | 3 ++- services/agent/Dockerfile | 3 ++- services/api-server/Dockerfile | 3 ++- services/autoscaling/Dockerfile | 3 ++- services/catalog/Dockerfile | 3 ++- services/clusters-keeper/Dockerfile | 3 ++- services/dask-sidecar/Dockerfile | 3 ++- services/datcore-adapter/Dockerfile | 3 ++- services/director-v2/Dockerfile | 3 ++- services/dynamic-scheduler/Dockerfile | 3 ++- services/dynamic-sidecar/Dockerfile | 3 ++- services/efs-guardian/Dockerfile | 3 ++- services/invitations/Dockerfile | 3 ++- services/migration/Dockerfile | 3 ++- services/osparc-gateway-server/Dockerfile | 3 ++- services/payments/Dockerfile | 3 ++- services/resource-usage-tracker/Dockerfile | 3 ++- services/storage/Dockerfile | 3 ++- services/web/Dockerfile | 3 ++- 21 files changed, 42 insertions(+), 21 deletions(-) diff --git a/packages/postgres-database/docker/Dockerfile b/packages/postgres-database/docker/Dockerfile index 3d3c75902751..1872fcbe331f 100644 --- a/packages/postgres-database/docker/Dockerfile +++ b/packages/postgres-database/docker/Dockerfile @@ -23,7 +23,8 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" diff --git a/packages/service-integration/Dockerfile b/packages/service-integration/Dockerfile index 10e40a38ac80..201806ff248d 100644 --- a/packages/service-integration/Dockerfile +++ b/packages/service-integration/Dockerfile @@ -56,7 +56,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/requirements/tools/Dockerfile b/requirements/tools/Dockerfile index 05660c5ed6d9..b5e05b3e9bc0 100644 --- a/requirements/tools/Dockerfile +++ b/requirements/tools/Dockerfile @@ -25,7 +25,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/agent/Dockerfile b/services/agent/Dockerfile index 1b70cbeba5ad..c05bc4a8d58d 100644 --- a/services/agent/Dockerfile +++ b/services/agent/Dockerfile @@ -74,7 +74,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/api-server/Dockerfile b/services/api-server/Dockerfile index 030bcb670322..0fca986d4a9d 100644 --- a/services/api-server/Dockerfile +++ b/services/api-server/Dockerfile @@ -70,7 +70,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/autoscaling/Dockerfile b/services/autoscaling/Dockerfile index cdf8393380bc..ef371c3b4b6b 100644 --- a/services/autoscaling/Dockerfile +++ b/services/autoscaling/Dockerfile @@ -90,7 +90,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/catalog/Dockerfile b/services/catalog/Dockerfile index 7873fc70b9e7..e49c3afe2f4d 100644 --- a/services/catalog/Dockerfile +++ b/services/catalog/Dockerfile @@ -71,7 +71,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/clusters-keeper/Dockerfile b/services/clusters-keeper/Dockerfile index 8baf59f3ba38..389c2691b553 100644 --- a/services/clusters-keeper/Dockerfile +++ b/services/clusters-keeper/Dockerfile @@ -90,7 +90,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/dask-sidecar/Dockerfile b/services/dask-sidecar/Dockerfile index 4b234a3b28f5..181bb6fbc349 100644 --- a/services/dask-sidecar/Dockerfile +++ b/services/dask-sidecar/Dockerfile @@ -81,7 +81,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/datcore-adapter/Dockerfile b/services/datcore-adapter/Dockerfile index 84276a851bba..054579522616 100644 --- a/services/datcore-adapter/Dockerfile +++ b/services/datcore-adapter/Dockerfile @@ -71,7 +71,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/director-v2/Dockerfile b/services/director-v2/Dockerfile index 48ec8c0c6191..21d50fc42863 100644 --- a/services/director-v2/Dockerfile +++ b/services/director-v2/Dockerfile @@ -71,7 +71,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/dynamic-scheduler/Dockerfile b/services/dynamic-scheduler/Dockerfile index f081c446b569..2f848c5fe611 100644 --- a/services/dynamic-scheduler/Dockerfile +++ b/services/dynamic-scheduler/Dockerfile @@ -70,7 +70,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/dynamic-sidecar/Dockerfile b/services/dynamic-sidecar/Dockerfile index dafcf84fa7c7..3513dd271781 100644 --- a/services/dynamic-sidecar/Dockerfile +++ b/services/dynamic-sidecar/Dockerfile @@ -111,7 +111,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/efs-guardian/Dockerfile b/services/efs-guardian/Dockerfile index bb549ed38276..ff1b6e30a20e 100644 --- a/services/efs-guardian/Dockerfile +++ b/services/efs-guardian/Dockerfile @@ -108,7 +108,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/invitations/Dockerfile b/services/invitations/Dockerfile index 413c9e519f01..e936750a3972 100644 --- a/services/invitations/Dockerfile +++ b/services/invitations/Dockerfile @@ -70,7 +70,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/migration/Dockerfile b/services/migration/Dockerfile index ebe0f4f8a793..5d5b21e8a3a3 100644 --- a/services/migration/Dockerfile +++ b/services/migration/Dockerfile @@ -44,7 +44,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ git # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/osparc-gateway-server/Dockerfile b/services/osparc-gateway-server/Dockerfile index 789a64900caa..86d8d4177fca 100644 --- a/services/osparc-gateway-server/Dockerfile +++ b/services/osparc-gateway-server/Dockerfile @@ -73,7 +73,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ golang-go # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/payments/Dockerfile b/services/payments/Dockerfile index 64ba4841c975..a70b2bb37057 100644 --- a/services/payments/Dockerfile +++ b/services/payments/Dockerfile @@ -70,7 +70,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/resource-usage-tracker/Dockerfile b/services/resource-usage-tracker/Dockerfile index ca4b4833613f..201c929d024a 100644 --- a/services/resource-usage-tracker/Dockerfile +++ b/services/resource-usage-tracker/Dockerfile @@ -71,7 +71,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/storage/Dockerfile b/services/storage/Dockerfile index 0f2a16c44eb4..608badb00f45 100644 --- a/services/storage/Dockerfile +++ b/services/storage/Dockerfile @@ -79,7 +79,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ git # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/web/Dockerfile b/services/web/Dockerfile index e308949c6000..7f5dda9badda 100644 --- a/services/web/Dockerfile +++ b/services/web/Dockerfile @@ -82,7 +82,8 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ libffi-dev # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -COPY --from=ghcr.io/astral-sh/uv:0.4.24 /uv /uvx /bin/ +ARG UV_VERSION="0.4.24" +COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed From 0764d8efef95d796c0138b894e62498deb827d6e Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:47:19 +0200 Subject: [PATCH 03/23] use all patch version --- packages/postgres-database/docker/Dockerfile | 2 +- packages/service-integration/Dockerfile | 2 +- requirements/tools/Dockerfile | 2 +- services/agent/Dockerfile | 2 +- services/api-server/Dockerfile | 2 +- services/autoscaling/Dockerfile | 2 +- services/catalog/Dockerfile | 2 +- services/clusters-keeper/Dockerfile | 2 +- services/dask-sidecar/Dockerfile | 2 +- services/datcore-adapter/Dockerfile | 2 +- services/director-v2/Dockerfile | 2 +- services/dynamic-scheduler/Dockerfile | 2 +- services/dynamic-sidecar/Dockerfile | 2 +- services/efs-guardian/Dockerfile | 2 +- services/invitations/Dockerfile | 2 +- services/migration/Dockerfile | 2 +- services/osparc-gateway-server/Dockerfile | 2 +- services/payments/Dockerfile | 2 +- services/resource-usage-tracker/Dockerfile | 2 +- services/storage/Dockerfile | 2 +- services/web/Dockerfile | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/postgres-database/docker/Dockerfile b/packages/postgres-database/docker/Dockerfile index 1872fcbe331f..6e7bafb5b9dd 100644 --- a/packages/postgres-database/docker/Dockerfile +++ b/packages/postgres-database/docker/Dockerfile @@ -23,7 +23,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv diff --git a/packages/service-integration/Dockerfile b/packages/service-integration/Dockerfile index 201806ff248d..ecb5cf1fe5a3 100644 --- a/packages/service-integration/Dockerfile +++ b/packages/service-integration/Dockerfile @@ -56,7 +56,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/requirements/tools/Dockerfile b/requirements/tools/Dockerfile index b5e05b3e9bc0..097aa0d892a0 100644 --- a/requirements/tools/Dockerfile +++ b/requirements/tools/Dockerfile @@ -25,7 +25,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/agent/Dockerfile b/services/agent/Dockerfile index c05bc4a8d58d..e69d8a6248fb 100644 --- a/services/agent/Dockerfile +++ b/services/agent/Dockerfile @@ -74,7 +74,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/api-server/Dockerfile b/services/api-server/Dockerfile index 0fca986d4a9d..68d62364e999 100644 --- a/services/api-server/Dockerfile +++ b/services/api-server/Dockerfile @@ -70,7 +70,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/autoscaling/Dockerfile b/services/autoscaling/Dockerfile index ef371c3b4b6b..732aa2edfc64 100644 --- a/services/autoscaling/Dockerfile +++ b/services/autoscaling/Dockerfile @@ -90,7 +90,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ diff --git a/services/catalog/Dockerfile b/services/catalog/Dockerfile index e49c3afe2f4d..28ad227714ac 100644 --- a/services/catalog/Dockerfile +++ b/services/catalog/Dockerfile @@ -71,7 +71,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/clusters-keeper/Dockerfile b/services/clusters-keeper/Dockerfile index 389c2691b553..f338479c603c 100644 --- a/services/clusters-keeper/Dockerfile +++ b/services/clusters-keeper/Dockerfile @@ -90,7 +90,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/dask-sidecar/Dockerfile b/services/dask-sidecar/Dockerfile index 181bb6fbc349..7633dab42cfc 100644 --- a/services/dask-sidecar/Dockerfile +++ b/services/dask-sidecar/Dockerfile @@ -81,7 +81,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv diff --git a/services/datcore-adapter/Dockerfile b/services/datcore-adapter/Dockerfile index 054579522616..b1e6325149f6 100644 --- a/services/datcore-adapter/Dockerfile +++ b/services/datcore-adapter/Dockerfile @@ -71,7 +71,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/director-v2/Dockerfile b/services/director-v2/Dockerfile index 21d50fc42863..6aa3cbea7ede 100644 --- a/services/director-v2/Dockerfile +++ b/services/director-v2/Dockerfile @@ -71,7 +71,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/dynamic-scheduler/Dockerfile b/services/dynamic-scheduler/Dockerfile index 2f848c5fe611..473c59d3c73f 100644 --- a/services/dynamic-scheduler/Dockerfile +++ b/services/dynamic-scheduler/Dockerfile @@ -70,7 +70,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/dynamic-sidecar/Dockerfile b/services/dynamic-sidecar/Dockerfile index 3513dd271781..226503446166 100644 --- a/services/dynamic-sidecar/Dockerfile +++ b/services/dynamic-sidecar/Dockerfile @@ -111,7 +111,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/efs-guardian/Dockerfile b/services/efs-guardian/Dockerfile index ff1b6e30a20e..5418a0fcea66 100644 --- a/services/efs-guardian/Dockerfile +++ b/services/efs-guardian/Dockerfile @@ -108,7 +108,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/invitations/Dockerfile b/services/invitations/Dockerfile index e936750a3972..0613926cb86c 100644 --- a/services/invitations/Dockerfile +++ b/services/invitations/Dockerfile @@ -70,7 +70,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/migration/Dockerfile b/services/migration/Dockerfile index 5d5b21e8a3a3..56221e250a39 100644 --- a/services/migration/Dockerfile +++ b/services/migration/Dockerfile @@ -44,7 +44,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ git # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv diff --git a/services/osparc-gateway-server/Dockerfile b/services/osparc-gateway-server/Dockerfile index 86d8d4177fca..fa0c7df090ba 100644 --- a/services/osparc-gateway-server/Dockerfile +++ b/services/osparc-gateway-server/Dockerfile @@ -73,7 +73,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ golang-go # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv diff --git a/services/payments/Dockerfile b/services/payments/Dockerfile index a70b2bb37057..6c9422ef668e 100644 --- a/services/payments/Dockerfile +++ b/services/payments/Dockerfile @@ -70,7 +70,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/resource-usage-tracker/Dockerfile b/services/resource-usage-tracker/Dockerfile index 201c929d024a..cd15529b40cf 100644 --- a/services/resource-usage-tracker/Dockerfile +++ b/services/resource-usage-tracker/Dockerfile @@ -71,7 +71,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/storage/Dockerfile b/services/storage/Dockerfile index 608badb00f45..f80b4c8544b1 100644 --- a/services/storage/Dockerfile +++ b/services/storage/Dockerfile @@ -79,7 +79,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ git # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed diff --git a/services/web/Dockerfile b/services/web/Dockerfile index 7f5dda9badda..1266d7b3fdba 100644 --- a/services/web/Dockerfile +++ b/services/web/Dockerfile @@ -82,7 +82,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ libffi-dev # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4.24" +ARG UV_VERSION="0.4" COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ From ba8f31246e61f62baa3e2aba5227398ba794bda7 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Fri, 18 Oct 2024 18:28:38 +0200 Subject: [PATCH 04/23] stuff half working --- packages/postgres-database/docker/Dockerfile | 2 +- packages/service-integration/Dockerfile | 4 +-- requirements/tools/Dockerfile | 4 +-- services/agent/Dockerfile | 6 ++-- services/api-server/Dockerfile | 6 ++-- services/autoscaling/Dockerfile | 31 ++++++++------------ services/autoscaling/docker/boot.sh | 10 +++---- services/catalog/Dockerfile | 6 ++-- services/clusters-keeper/Dockerfile | 6 ++-- services/dask-sidecar/Dockerfile | 6 ++-- services/datcore-adapter/Dockerfile | 6 ++-- services/director-v2/Dockerfile | 6 ++-- services/dynamic-scheduler/Dockerfile | 6 ++-- services/dynamic-sidecar/Dockerfile | 4 +-- services/efs-guardian/Dockerfile | 6 ++-- services/invitations/Dockerfile | 6 ++-- services/migration/Dockerfile | 4 +-- services/osparc-gateway-server/Dockerfile | 6 ++-- services/payments/Dockerfile | 6 ++-- services/resource-usage-tracker/Dockerfile | 6 ++-- services/storage/Dockerfile | 6 ++-- services/web/Dockerfile | 6 ++-- 22 files changed, 71 insertions(+), 78 deletions(-) diff --git a/packages/postgres-database/docker/Dockerfile b/packages/postgres-database/docker/Dockerfile index 6e7bafb5b9dd..67d117870f8c 100644 --- a/packages/postgres-database/docker/Dockerfile +++ b/packages/postgres-database/docker/Dockerfile @@ -29,7 +29,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ diff --git a/packages/service-integration/Dockerfile b/packages/service-integration/Dockerfile index ecb5cf1fe5a3..d935a5d6fd8a 100644 --- a/packages/service-integration/Dockerfile +++ b/packages/service-integration/Dockerfile @@ -63,7 +63,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -74,7 +74,7 @@ WORKDIR /build/packages/service-integration RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=packages/service-integration,target=/build/packages/service-integration,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/requirements/tools/Dockerfile b/requirements/tools/Dockerfile index 097aa0d892a0..050e506daf0b 100644 --- a/requirements/tools/Dockerfile +++ b/requirements/tools/Dockerfile @@ -30,7 +30,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -39,7 +39,7 @@ RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ # devenv -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install \ pip-tools \ pipreqs \ diff --git a/services/agent/Dockerfile b/services/agent/Dockerfile index e69d8a6248fb..f3176eb33c9d 100644 --- a/services/agent/Dockerfile +++ b/services/agent/Dockerfile @@ -81,7 +81,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -93,7 +93,7 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/agent/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -113,7 +113,7 @@ WORKDIR /build/services/agent RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/agent,target=/build/services/agent,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/api-server/Dockerfile b/services/api-server/Dockerfile index 68d62364e999..31c2b483658d 100644 --- a/services/api-server/Dockerfile +++ b/services/api-server/Dockerfile @@ -77,7 +77,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -89,7 +89,7 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/api-server/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -109,7 +109,7 @@ WORKDIR /build/services/api-server RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/api-server,target=/build/services/api-server,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/autoscaling/Dockerfile b/services/autoscaling/Dockerfile index 732aa2edfc64..f0ac4356ee31 100644 --- a/services/autoscaling/Dockerfile +++ b/services/autoscaling/Dockerfile @@ -1,10 +1,15 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # # USAGE: -# cd sercices/autoscaling +# cd services/autoscaling # docker build -f Dockerfile -t autoscaling:prod --target production ../../ # docker run autoscaling:prod # @@ -90,31 +95,21 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ - +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools WORKDIR /build -# install base 3rd party dependencies -# NOTE: copies to /build to avoid overwriting later which would invalidate this layer -RUN \ - --mount=type=bind,source=services/autoscaling/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt - - # --------------------------Prod-depends-only stage ------------------- # This stage is for production only dependencies that get partially wiped out afterwards (final docker image concerns) # @@ -130,9 +125,9 @@ WORKDIR /build/services/autoscaling RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/autoscaling,target=/build/services/autoscaling,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + --mount=type=cache,target=/root/.cache/uv \ + uv pip sync \ + requirements/prod.txt \ && uv pip list diff --git a/services/autoscaling/docker/boot.sh b/services/autoscaling/docker/boot.sh index 0e8766523866..379c88ebbe35 100755 --- a/services/autoscaling/docker/boot.sh +++ b/services/autoscaling/docker/boot.sh @@ -23,12 +23,10 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/autoscaling || exit 1 - pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + cd services/autoscaling + uv pip --quiet --no-cache-dir sync requirements/dev.txt + cd - + uv pip list fi # diff --git a/services/catalog/Dockerfile b/services/catalog/Dockerfile index 28ad227714ac..c724ea844072 100644 --- a/services/catalog/Dockerfile +++ b/services/catalog/Dockerfile @@ -78,7 +78,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -90,7 +90,7 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/catalog/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -110,7 +110,7 @@ WORKDIR /build/services/catalog RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/catalog,target=/build/services/catalog,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/clusters-keeper/Dockerfile b/services/clusters-keeper/Dockerfile index f338479c603c..211682ea8546 100644 --- a/services/clusters-keeper/Dockerfile +++ b/services/clusters-keeper/Dockerfile @@ -97,7 +97,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -109,7 +109,7 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/clusters-keeper/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -129,7 +129,7 @@ WORKDIR /build/services/clusters-keeper RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/clusters-keeper,target=/build/services/clusters-keeper,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/dask-sidecar/Dockerfile b/services/dask-sidecar/Dockerfile index 7633dab42cfc..df7cc0c6d1b7 100644 --- a/services/dask-sidecar/Dockerfile +++ b/services/dask-sidecar/Dockerfile @@ -87,7 +87,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -98,7 +98,7 @@ WORKDIR /build # install base 3rd party dependencies (NOTE: this speeds up devel mode) RUN \ --mount=type=bind,source=services/dask-sidecar/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -117,7 +117,7 @@ WORKDIR /build/services/dask-sidecar RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/dask-sidecar,target=/build/services/dask-sidecar,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/datcore-adapter/Dockerfile b/services/datcore-adapter/Dockerfile index b1e6325149f6..a82d611589e4 100644 --- a/services/datcore-adapter/Dockerfile +++ b/services/datcore-adapter/Dockerfile @@ -78,7 +78,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -90,7 +90,7 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/datcore-adapter/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -110,7 +110,7 @@ WORKDIR /build/services/datcore-adapter RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/datcore-adapter,target=/build/services/datcore-adapter,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/director-v2/Dockerfile b/services/director-v2/Dockerfile index 6aa3cbea7ede..f9bf46104b67 100644 --- a/services/director-v2/Dockerfile +++ b/services/director-v2/Dockerfile @@ -78,7 +78,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -90,7 +90,7 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/director-v2/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -110,7 +110,7 @@ WORKDIR /build/services/director-v2 RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/director-v2,target=/build/services/director-v2,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/dynamic-scheduler/Dockerfile b/services/dynamic-scheduler/Dockerfile index 473c59d3c73f..66f0f2b88f22 100644 --- a/services/dynamic-scheduler/Dockerfile +++ b/services/dynamic-scheduler/Dockerfile @@ -77,7 +77,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -89,7 +89,7 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/dynamic-scheduler/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -110,7 +110,7 @@ WORKDIR /build/services/dynamic-scheduler RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/dynamic-scheduler,target=/build/services/dynamic-scheduler,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/dynamic-sidecar/Dockerfile b/services/dynamic-sidecar/Dockerfile index 226503446166..0ba70bef904c 100644 --- a/services/dynamic-sidecar/Dockerfile +++ b/services/dynamic-sidecar/Dockerfile @@ -119,7 +119,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ RUN uv venv "${VIRTUAL_ENV}" \ && mkdir -p "${DYNAMIC_SIDECAR_DY_VOLUMES_MOUNT_DIR}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -155,7 +155,7 @@ WORKDIR /build/services/dynamic-sidecar RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/dynamic-sidecar,target=/build/services/dynamic-sidecar,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/efs-guardian/Dockerfile b/services/efs-guardian/Dockerfile index 5418a0fcea66..11b63134ab5d 100644 --- a/services/efs-guardian/Dockerfile +++ b/services/efs-guardian/Dockerfile @@ -115,7 +115,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -127,7 +127,7 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/efs-guardian/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -147,7 +147,7 @@ WORKDIR /build/services/efs-guardian RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/efs-guardian,target=/build/services/efs-guardian,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/invitations/Dockerfile b/services/invitations/Dockerfile index 0613926cb86c..66a622ac3531 100644 --- a/services/invitations/Dockerfile +++ b/services/invitations/Dockerfile @@ -77,7 +77,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -89,7 +89,7 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/invitations/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -110,7 +110,7 @@ WORKDIR /build/services/invitations RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/invitations,target=/build/services/invitations,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/migration/Dockerfile b/services/migration/Dockerfile index 56221e250a39..be11a91912c4 100644 --- a/services/migration/Dockerfile +++ b/services/migration/Dockerfile @@ -50,7 +50,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -61,7 +61,7 @@ WORKDIR /build/packages/postgres-database # install only base 3rd party dependencies RUN \ --mount=type=bind,source=packages/postgres-database,target=/build/packages/postgres-database,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/osparc-gateway-server/Dockerfile b/services/osparc-gateway-server/Dockerfile index fa0c7df090ba..49360fe6870f 100644 --- a/services/osparc-gateway-server/Dockerfile +++ b/services/osparc-gateway-server/Dockerfile @@ -78,7 +78,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -89,7 +89,7 @@ WORKDIR /build # install base 3rd party dependencies (NOTE: this speeds up devel mode) RUN \ --mount=type=bind,source=services/osparc-gateway-server/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -117,7 +117,7 @@ WORKDIR /build/services/osparc-gateway-server RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/osparc-gateway-server,target=/build/services/osparc-gateway-server,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt diff --git a/services/payments/Dockerfile b/services/payments/Dockerfile index 6c9422ef668e..aacd9ef83e5a 100644 --- a/services/payments/Dockerfile +++ b/services/payments/Dockerfile @@ -77,7 +77,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -89,7 +89,7 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/payments/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -110,7 +110,7 @@ WORKDIR /build/services/payments RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/payments,target=/build/services/payments,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/resource-usage-tracker/Dockerfile b/services/resource-usage-tracker/Dockerfile index cd15529b40cf..333149d3dc5b 100644 --- a/services/resource-usage-tracker/Dockerfile +++ b/services/resource-usage-tracker/Dockerfile @@ -78,7 +78,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -90,7 +90,7 @@ WORKDIR /build # NOTE: copies to /build to avoid overwriting later which would invalidate this layer RUN \ --mount=type=bind,source=services/resource-usage-tracker/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -110,7 +110,7 @@ WORKDIR /build/services/resource-usage-tracker RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/resource-usage-tracker,target=/build/services/resource-usage-tracker,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/storage/Dockerfile b/services/storage/Dockerfile index f80b4c8544b1..192407bd0f5e 100644 --- a/services/storage/Dockerfile +++ b/services/storage/Dockerfile @@ -86,7 +86,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -97,7 +97,7 @@ WORKDIR /build # install only base 3rd party dependencies RUN \ --mount=type=bind,source=services/storage/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -122,7 +122,7 @@ WORKDIR /build/services/storage RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/storage,target=/build/services/storage,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list diff --git a/services/web/Dockerfile b/services/web/Dockerfile index 1266d7b3fdba..c7d12cda0403 100644 --- a/services/web/Dockerfile +++ b/services/web/Dockerfile @@ -90,7 +90,7 @@ COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ # packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" -RUN --mount=type=cache,mode=0755,target=/root/.cache/uv \ +RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ pip~=24.0 \ wheel \ @@ -101,7 +101,7 @@ WORKDIR /build # install only base 3rd party dependencies RUN \ --mount=type=bind,source=services/web/server/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement _base.txt @@ -121,7 +121,7 @@ WORKDIR /build/services/web/server RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/web/server,target=/build/services/web/server,rw \ - --mount=type=cache,mode=0755,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/uv \ uv pip install \ --requirement requirements/prod.txt \ && uv pip list From b8947f0d28485548892d3e923fe791427a5c0c89 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Mon, 21 Oct 2024 08:08:36 +0200 Subject: [PATCH 05/23] use multi-stage uv --- packages/postgres-database/docker/Dockerfile | 5 +++-- packages/service-integration/Dockerfile | 5 +++-- requirements/tools/Dockerfile | 5 +++-- services/agent/Dockerfile | 5 +++-- services/api-server/Dockerfile | 5 +++-- services/catalog/Dockerfile | 5 +++-- services/clusters-keeper/Dockerfile | 5 +++-- services/dask-sidecar/Dockerfile | 5 +++-- services/datcore-adapter/Dockerfile | 5 +++-- services/director-v2/Dockerfile | 5 +++-- services/dynamic-scheduler/Dockerfile | 5 +++-- services/dynamic-sidecar/Dockerfile | 5 +++-- services/efs-guardian/Dockerfile | 5 +++-- services/invitations/Dockerfile | 5 +++-- services/migration/Dockerfile | 5 +++-- services/osparc-gateway-server/Dockerfile | 5 +++-- services/payments/Dockerfile | 5 +++-- services/resource-usage-tracker/Dockerfile | 5 +++-- services/storage/Dockerfile | 5 +++-- services/web/Dockerfile | 5 +++-- 20 files changed, 60 insertions(+), 40 deletions(-) diff --git a/packages/postgres-database/docker/Dockerfile b/packages/postgres-database/docker/Dockerfile index 67d117870f8c..f4e054a9dcc6 100644 --- a/packages/postgres-database/docker/Dockerfile +++ b/packages/postgres-database/docker/Dockerfile @@ -23,8 +23,9 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" diff --git a/packages/service-integration/Dockerfile b/packages/service-integration/Dockerfile index d935a5d6fd8a..9ffc9049f425 100644 --- a/packages/service-integration/Dockerfile +++ b/packages/service-integration/Dockerfile @@ -56,8 +56,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/requirements/tools/Dockerfile b/requirements/tools/Dockerfile index 050e506daf0b..850749e0730e 100644 --- a/requirements/tools/Dockerfile +++ b/requirements/tools/Dockerfile @@ -25,8 +25,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/agent/Dockerfile b/services/agent/Dockerfile index f3176eb33c9d..265cb2ae0313 100644 --- a/services/agent/Dockerfile +++ b/services/agent/Dockerfile @@ -74,8 +74,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/api-server/Dockerfile b/services/api-server/Dockerfile index 31c2b483658d..1f599e14fbfd 100644 --- a/services/api-server/Dockerfile +++ b/services/api-server/Dockerfile @@ -70,8 +70,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/catalog/Dockerfile b/services/catalog/Dockerfile index c724ea844072..bea089f49572 100644 --- a/services/catalog/Dockerfile +++ b/services/catalog/Dockerfile @@ -71,8 +71,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/clusters-keeper/Dockerfile b/services/clusters-keeper/Dockerfile index 211682ea8546..f9689d3f2d98 100644 --- a/services/clusters-keeper/Dockerfile +++ b/services/clusters-keeper/Dockerfile @@ -90,8 +90,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/dask-sidecar/Dockerfile b/services/dask-sidecar/Dockerfile index df7cc0c6d1b7..a538c0f90112 100644 --- a/services/dask-sidecar/Dockerfile +++ b/services/dask-sidecar/Dockerfile @@ -81,8 +81,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/datcore-adapter/Dockerfile b/services/datcore-adapter/Dockerfile index a82d611589e4..a2a73655f374 100644 --- a/services/datcore-adapter/Dockerfile +++ b/services/datcore-adapter/Dockerfile @@ -71,8 +71,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/director-v2/Dockerfile b/services/director-v2/Dockerfile index f9bf46104b67..6604c85c960f 100644 --- a/services/director-v2/Dockerfile +++ b/services/director-v2/Dockerfile @@ -71,8 +71,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/dynamic-scheduler/Dockerfile b/services/dynamic-scheduler/Dockerfile index 66f0f2b88f22..e8d3047d6e43 100644 --- a/services/dynamic-scheduler/Dockerfile +++ b/services/dynamic-scheduler/Dockerfile @@ -70,8 +70,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/dynamic-sidecar/Dockerfile b/services/dynamic-sidecar/Dockerfile index 0ba70bef904c..5bb599c7df09 100644 --- a/services/dynamic-sidecar/Dockerfile +++ b/services/dynamic-sidecar/Dockerfile @@ -111,8 +111,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/efs-guardian/Dockerfile b/services/efs-guardian/Dockerfile index 11b63134ab5d..e29a3b17ef78 100644 --- a/services/efs-guardian/Dockerfile +++ b/services/efs-guardian/Dockerfile @@ -108,8 +108,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/invitations/Dockerfile b/services/invitations/Dockerfile index 66a622ac3531..1d5b4a47d7da 100644 --- a/services/invitations/Dockerfile +++ b/services/invitations/Dockerfile @@ -70,8 +70,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/migration/Dockerfile b/services/migration/Dockerfile index be11a91912c4..1eb98d4ca386 100644 --- a/services/migration/Dockerfile +++ b/services/migration/Dockerfile @@ -44,8 +44,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ git # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/osparc-gateway-server/Dockerfile b/services/osparc-gateway-server/Dockerfile index 49360fe6870f..4d780c37aa52 100644 --- a/services/osparc-gateway-server/Dockerfile +++ b/services/osparc-gateway-server/Dockerfile @@ -73,8 +73,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ golang-go # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/payments/Dockerfile b/services/payments/Dockerfile index aacd9ef83e5a..ddbd8690f18f 100644 --- a/services/payments/Dockerfile +++ b/services/payments/Dockerfile @@ -70,8 +70,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/resource-usage-tracker/Dockerfile b/services/resource-usage-tracker/Dockerfile index 333149d3dc5b..14269323b388 100644 --- a/services/resource-usage-tracker/Dockerfile +++ b/services/resource-usage-tracker/Dockerfile @@ -71,8 +71,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ build-essential # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/storage/Dockerfile b/services/storage/Dockerfile index 192407bd0f5e..b233723450d3 100644 --- a/services/storage/Dockerfile +++ b/services/storage/Dockerfile @@ -79,8 +79,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ git # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv diff --git a/services/web/Dockerfile b/services/web/Dockerfile index c7d12cda0403..3d8c6164c350 100644 --- a/services/web/Dockerfile +++ b/services/web/Dockerfile @@ -82,8 +82,9 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ libffi-dev # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv -ARG UV_VERSION="0.4" -COPY --from=ghcr.io/astral-sh/uv:${UV_VERSION} /uv /uvx /bin/ +COPY --from=uv_build /uv /uvx /bin/ +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed From a73794cfbd47c000fea7808a824100d5c1aa1549 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:36:15 +0200 Subject: [PATCH 06/23] use multi-stage to install UV --- packages/postgres-database/scripts/erd/Dockerfile | 5 +++++ packages/service-integration/Dockerfile | 5 +++++ scripts/apt-packages-versions/Dockerfile | 5 +++++ services/agent/Dockerfile | 5 +++++ services/api-server/Dockerfile | 5 +++++ services/catalog/Dockerfile | 5 +++++ services/clusters-keeper/Dockerfile | 5 +++++ services/dask-sidecar/Dockerfile | 5 +++++ services/datcore-adapter/Dockerfile | 5 +++++ services/director-v2/Dockerfile | 5 +++++ services/dynamic-scheduler/Dockerfile | 5 +++++ services/dynamic-sidecar/Dockerfile | 5 +++++ services/efs-guardian/Dockerfile | 5 +++++ services/invitations/Dockerfile | 5 +++++ services/migration/Dockerfile | 5 +++++ services/osparc-gateway-server/Dockerfile | 5 +++++ services/payments/Dockerfile | 5 +++++ services/resource-usage-tracker/Dockerfile | 5 +++++ services/storage/Dockerfile | 5 +++++ services/web/Dockerfile | 5 +++++ 20 files changed, 100 insertions(+) diff --git a/packages/postgres-database/scripts/erd/Dockerfile b/packages/postgres-database/scripts/erd/Dockerfile index e18bec73e164..08d231098446 100644 --- a/packages/postgres-database/scripts/erd/Dockerfile +++ b/packages/postgres-database/scripts/erd/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base RUN apt-get update \ diff --git a/packages/service-integration/Dockerfile b/packages/service-integration/Dockerfile index 9ffc9049f425..613e01cc9c5e 100644 --- a/packages/service-integration/Dockerfile +++ b/packages/service-integration/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base LABEL maintainer=pcrespov diff --git a/scripts/apt-packages-versions/Dockerfile b/scripts/apt-packages-versions/Dockerfile index 02708317fe10..9ac5ed49ea7a 100644 --- a/scripts/apt-packages-versions/Dockerfile +++ b/scripts/apt-packages-versions/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base RUN \ diff --git a/services/agent/Dockerfile b/services/agent/Dockerfile index 265cb2ae0313..4bfcafa09de3 100644 --- a/services/agent/Dockerfile +++ b/services/agent/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # diff --git a/services/api-server/Dockerfile b/services/api-server/Dockerfile index 1f599e14fbfd..6bfa3b2978fc 100644 --- a/services/api-server/Dockerfile +++ b/services/api-server/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # # USAGE: diff --git a/services/catalog/Dockerfile b/services/catalog/Dockerfile index bea089f49572..0298253fb3b7 100644 --- a/services/catalog/Dockerfile +++ b/services/catalog/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # # diff --git a/services/clusters-keeper/Dockerfile b/services/clusters-keeper/Dockerfile index f9689d3f2d98..1c94f8d2bb37 100644 --- a/services/clusters-keeper/Dockerfile +++ b/services/clusters-keeper/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # diff --git a/services/dask-sidecar/Dockerfile b/services/dask-sidecar/Dockerfile index a538c0f90112..67c7462ca71d 100644 --- a/services/dask-sidecar/Dockerfile +++ b/services/dask-sidecar/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM --platform=${TARGETPLATFORM} python:${PYTHON_VERSION}-slim-bookworm AS base ARG TARGETPLATFORM ARG BUILDPLATFORM diff --git a/services/datcore-adapter/Dockerfile b/services/datcore-adapter/Dockerfile index a2a73655f374..a1fbcbd6d570 100644 --- a/services/datcore-adapter/Dockerfile +++ b/services/datcore-adapter/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # diff --git a/services/director-v2/Dockerfile b/services/director-v2/Dockerfile index 6604c85c960f..8b9805a85a40 100644 --- a/services/director-v2/Dockerfile +++ b/services/director-v2/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # diff --git a/services/dynamic-scheduler/Dockerfile b/services/dynamic-scheduler/Dockerfile index e8d3047d6e43..27fcafa0496c 100644 --- a/services/dynamic-scheduler/Dockerfile +++ b/services/dynamic-scheduler/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # diff --git a/services/dynamic-sidecar/Dockerfile b/services/dynamic-sidecar/Dockerfile index 5bb599c7df09..47ad3b7cae6c 100644 --- a/services/dynamic-sidecar/Dockerfile +++ b/services/dynamic-sidecar/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # # USAGE: diff --git a/services/efs-guardian/Dockerfile b/services/efs-guardian/Dockerfile index e29a3b17ef78..2f31d4574aa7 100644 --- a/services/efs-guardian/Dockerfile +++ b/services/efs-guardian/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # diff --git a/services/invitations/Dockerfile b/services/invitations/Dockerfile index 1d5b4a47d7da..7e7789b443c9 100644 --- a/services/invitations/Dockerfile +++ b/services/invitations/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # diff --git a/services/migration/Dockerfile b/services/migration/Dockerfile index 1eb98d4ca386..6abc740ba70e 100644 --- a/services/migration/Dockerfile +++ b/services/migration/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base LABEL maintainer=sanderegg diff --git a/services/osparc-gateway-server/Dockerfile b/services/osparc-gateway-server/Dockerfile index 4d780c37aa52..dfde1fab2b6c 100644 --- a/services/osparc-gateway-server/Dockerfile +++ b/services/osparc-gateway-server/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bullseye AS base ARG TARGETPLATFORM ARG BUILDPLATFORM diff --git a/services/payments/Dockerfile b/services/payments/Dockerfile index ddbd8690f18f..12e8e650aa8a 100644 --- a/services/payments/Dockerfile +++ b/services/payments/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # diff --git a/services/resource-usage-tracker/Dockerfile b/services/resource-usage-tracker/Dockerfile index 14269323b388..51bc4bc3465c 100644 --- a/services/resource-usage-tracker/Dockerfile +++ b/services/resource-usage-tracker/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # diff --git a/services/storage/Dockerfile b/services/storage/Dockerfile index b233723450d3..821abb18f272 100644 --- a/services/storage/Dockerfile +++ b/services/storage/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # # USAGE: diff --git a/services/web/Dockerfile b/services/web/Dockerfile index 3d8c6164c350..45d5e083f04c 100644 --- a/services/web/Dockerfile +++ b/services/web/Dockerfile @@ -1,5 +1,10 @@ # syntax=docker/dockerfile:1 + +# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base # # USAGE: From 9814a7be585fcda4b63eb7346e945b07af7c70e9 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:44:27 +0200 Subject: [PATCH 07/23] compile byte code for production --- packages/postgres-database/docker/Dockerfile | 4 ++-- packages/service-integration/Dockerfile | 8 +++++--- requirements/tools/Dockerfile | 2 -- services/agent/Dockerfile | 4 ++-- services/api-server/Dockerfile | 4 ++-- services/autoscaling/Dockerfile | 5 +++-- services/catalog/Dockerfile | 4 ++-- services/clusters-keeper/Dockerfile | 4 ++-- services/dask-sidecar/Dockerfile | 4 ++-- services/datcore-adapter/Dockerfile | 4 ++-- services/director-v2/Dockerfile | 4 ++-- services/dynamic-scheduler/Dockerfile | 4 ++-- services/dynamic-sidecar/Dockerfile | 4 ++-- services/efs-guardian/Dockerfile | 4 ++-- services/invitations/Dockerfile | 4 ++-- services/migration/Dockerfile | 4 ++-- services/osparc-gateway-server/Dockerfile | 4 ++-- services/payments/Dockerfile | 4 ++-- services/resource-usage-tracker/Dockerfile | 4 ++-- services/storage/Dockerfile | 4 ++-- services/web/Dockerfile | 4 ++-- 21 files changed, 44 insertions(+), 43 deletions(-) diff --git a/packages/postgres-database/docker/Dockerfile b/packages/postgres-database/docker/Dockerfile index f4e054a9dcc6..89b7ad2c37e1 100644 --- a/packages/postgres-database/docker/Dockerfile +++ b/packages/postgres-database/docker/Dockerfile @@ -24,8 +24,6 @@ RUN apt-get update \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" @@ -45,6 +43,8 @@ RUN git clone --single-branch --branch ${GIT_BRANCH} ${GIT_REPOSITORY} osparc-si FROM base AS production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu # ensure home folder is read/writable for user scu diff --git a/packages/service-integration/Dockerfile b/packages/service-integration/Dockerfile index 613e01cc9c5e..4868968c5d24 100644 --- a/packages/service-integration/Dockerfile +++ b/packages/service-integration/Dockerfile @@ -62,8 +62,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -93,6 +91,8 @@ FROM base AS development FROM base AS production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu # ensure home folder is read/writable for user scu @@ -102,5 +102,7 @@ USER scu COPY --from=build --chown=scu:scu ${VIRTUAL_ENV} ${VIRTUAL_ENV} -# NOTE: do not activate ENV PYTHONOPTIMIZE=TRUE since excutable contains pytest code +# NOTE: do not activate ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 since excutable contains pytest code ENTRYPOINT [ "ooil" ] diff --git a/requirements/tools/Dockerfile b/requirements/tools/Dockerfile index 850749e0730e..48c7ef56a1ee 100644 --- a/requirements/tools/Dockerfile +++ b/requirements/tools/Dockerfile @@ -26,8 +26,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 RUN uv venv "${VIRTUAL_ENV}" diff --git a/services/agent/Dockerfile b/services/agent/Dockerfile index 4bfcafa09de3..cc844ff1399a 100644 --- a/services/agent/Dockerfile +++ b/services/agent/Dockerfile @@ -80,8 +80,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -138,6 +136,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu diff --git a/services/api-server/Dockerfile b/services/api-server/Dockerfile index 6bfa3b2978fc..954d205fcb04 100644 --- a/services/api-server/Dockerfile +++ b/services/api-server/Dockerfile @@ -76,8 +76,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -135,6 +133,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu diff --git a/services/autoscaling/Dockerfile b/services/autoscaling/Dockerfile index f0ac4356ee31..4ace322f5f90 100644 --- a/services/autoscaling/Dockerfile +++ b/services/autoscaling/Dockerfile @@ -96,8 +96,7 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 + # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -144,6 +143,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu # ensure home folder is read/writable for user scu diff --git a/services/catalog/Dockerfile b/services/catalog/Dockerfile index 0298253fb3b7..e77663cf29f5 100644 --- a/services/catalog/Dockerfile +++ b/services/catalog/Dockerfile @@ -77,8 +77,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -135,6 +133,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu diff --git a/services/clusters-keeper/Dockerfile b/services/clusters-keeper/Dockerfile index 1c94f8d2bb37..c7f46b91811b 100644 --- a/services/clusters-keeper/Dockerfile +++ b/services/clusters-keeper/Dockerfile @@ -96,8 +96,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -154,6 +152,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu # ensure home folder is read/writable for user scu diff --git a/services/dask-sidecar/Dockerfile b/services/dask-sidecar/Dockerfile index 67c7462ca71d..9782d280ec6a 100644 --- a/services/dask-sidecar/Dockerfile +++ b/services/dask-sidecar/Dockerfile @@ -87,8 +87,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" @@ -141,6 +139,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu diff --git a/services/datcore-adapter/Dockerfile b/services/datcore-adapter/Dockerfile index a1fbcbd6d570..50a8226a06bf 100644 --- a/services/datcore-adapter/Dockerfile +++ b/services/datcore-adapter/Dockerfile @@ -77,8 +77,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -135,6 +133,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu diff --git a/services/director-v2/Dockerfile b/services/director-v2/Dockerfile index 8b9805a85a40..c9f26c112549 100644 --- a/services/director-v2/Dockerfile +++ b/services/director-v2/Dockerfile @@ -77,8 +77,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -135,6 +133,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu diff --git a/services/dynamic-scheduler/Dockerfile b/services/dynamic-scheduler/Dockerfile index 27fcafa0496c..ad2443b0de8f 100644 --- a/services/dynamic-scheduler/Dockerfile +++ b/services/dynamic-scheduler/Dockerfile @@ -76,8 +76,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -135,6 +133,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu diff --git a/services/dynamic-sidecar/Dockerfile b/services/dynamic-sidecar/Dockerfile index 47ad3b7cae6c..636959ebeaa5 100644 --- a/services/dynamic-sidecar/Dockerfile +++ b/services/dynamic-sidecar/Dockerfile @@ -117,8 +117,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -179,6 +177,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu diff --git a/services/efs-guardian/Dockerfile b/services/efs-guardian/Dockerfile index 2f31d4574aa7..24d6f7afe412 100644 --- a/services/efs-guardian/Dockerfile +++ b/services/efs-guardian/Dockerfile @@ -114,8 +114,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -172,6 +170,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/efs diff --git a/services/invitations/Dockerfile b/services/invitations/Dockerfile index 7e7789b443c9..9fcc77bd7ab9 100644 --- a/services/invitations/Dockerfile +++ b/services/invitations/Dockerfile @@ -76,8 +76,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -135,6 +133,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu diff --git a/services/migration/Dockerfile b/services/migration/Dockerfile index 6abc740ba70e..4c80ad5d08d2 100644 --- a/services/migration/Dockerfile +++ b/services/migration/Dockerfile @@ -50,8 +50,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" @@ -77,6 +75,8 @@ RUN \ FROM base AS production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # testing defaults ENV POSTGRES_USER=scu \ diff --git a/services/osparc-gateway-server/Dockerfile b/services/osparc-gateway-server/Dockerfile index dfde1fab2b6c..9b97a5b78175 100644 --- a/services/osparc-gateway-server/Dockerfile +++ b/services/osparc-gateway-server/Dockerfile @@ -79,8 +79,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed packages may be moved to production image easily by copying the venv RUN uv venv "${VIRTUAL_ENV}" @@ -140,6 +138,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu # ensure home folder is read/writable for user scu diff --git a/services/payments/Dockerfile b/services/payments/Dockerfile index 12e8e650aa8a..e7c675772a58 100644 --- a/services/payments/Dockerfile +++ b/services/payments/Dockerfile @@ -76,8 +76,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -135,6 +133,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu diff --git a/services/resource-usage-tracker/Dockerfile b/services/resource-usage-tracker/Dockerfile index 51bc4bc3465c..24f811969017 100644 --- a/services/resource-usage-tracker/Dockerfile +++ b/services/resource-usage-tracker/Dockerfile @@ -77,8 +77,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -135,6 +133,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu diff --git a/services/storage/Dockerfile b/services/storage/Dockerfile index 821abb18f272..55722844bd69 100644 --- a/services/storage/Dockerfile +++ b/services/storage/Dockerfile @@ -85,8 +85,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed # packages may be moved to production image easily by copying the venv @@ -147,6 +145,8 @@ ENV SC_BUILD_TARGET=production \ SC_HEALTHCHECK_RETRY=3 ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu diff --git a/services/web/Dockerfile b/services/web/Dockerfile index 45d5e083f04c..bc15908e93ce 100644 --- a/services/web/Dockerfile +++ b/services/web/Dockerfile @@ -88,8 +88,6 @@ RUN --mount=type=cache,target=/var/cache/apt,mode=0755,sharing=private \ # install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=uv_build /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 # NOTE: python virtualenv is used here such that installed @@ -145,6 +143,8 @@ ENV SC_BUILD_TARGET=production \ SC_BOOT_MODE=production ENV PYTHONOPTIMIZE=TRUE +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu From 1409fa43b69e772f86292eb169679ed83c0cd371 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:46:31 +0200 Subject: [PATCH 08/23] any .venv should not be part of a docker context --- .dockerignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 34ae3126ea54..a00f0b105089 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,7 +8,7 @@ ops/ *.py[cod] # virtualenv -.venv +**/.venv #python eggs **/*.egg-info From 17220300ddb259281027d001207b8de6480d9d94 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:54:21 +0200 Subject: [PATCH 09/23] unify --- services/dask-sidecar/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/dask-sidecar/Dockerfile b/services/dask-sidecar/Dockerfile index 9782d280ec6a..02e3b5b48231 100644 --- a/services/dask-sidecar/Dockerfile +++ b/services/dask-sidecar/Dockerfile @@ -143,11 +143,13 @@ ENV PYTHONOPTIMIZE=TRUE ENV UV_COMPILE_BYTECODE=1 WORKDIR /home/scu - # ensure home folder is read/writable for user scu RUN chown -R scu /home/scu -# bring installed package without build tools + +# Starting from clean base image, copies pre-installed virtualenv from prod-only-deps COPY --from=prod-only-deps --chown=scu:scu ${VIRTUAL_ENV} ${VIRTUAL_ENV} + +# Copies booting scripts COPY --chown=scu:scu services/dask-sidecar/docker services/dask-sidecar/docker RUN chmod +x services/dask-sidecar/docker/*.sh From 104ff3c879f013a5ea3e0f32e852a7e12d72a42a Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:55:11 +0200 Subject: [PATCH 10/23] remove unnecessary stuff --- requirements/tools/Dockerfile | 1 - services/agent/Dockerfile | 1 - services/api-server/Dockerfile | 1 - services/catalog/Dockerfile | 1 - services/clusters-keeper/Dockerfile | 1 - services/dask-sidecar/Dockerfile | 1 - services/datcore-adapter/Dockerfile | 1 - services/director-v2/Dockerfile | 1 - services/dynamic-scheduler/Dockerfile | 1 - services/dynamic-sidecar/Dockerfile | 1 - services/efs-guardian/Dockerfile | 1 - services/invitations/Dockerfile | 1 - services/migration/Dockerfile | 1 - services/osparc-gateway-server/Dockerfile | 1 - services/payments/Dockerfile | 1 - services/resource-usage-tracker/Dockerfile | 1 - services/storage/Dockerfile | 1 - services/web/Dockerfile | 1 - 18 files changed, 18 deletions(-) diff --git a/requirements/tools/Dockerfile b/requirements/tools/Dockerfile index 48c7ef56a1ee..3016cc60310f 100644 --- a/requirements/tools/Dockerfile +++ b/requirements/tools/Dockerfile @@ -31,7 +31,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/agent/Dockerfile b/services/agent/Dockerfile index cc844ff1399a..b1bce1f7af1e 100644 --- a/services/agent/Dockerfile +++ b/services/agent/Dockerfile @@ -87,7 +87,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/api-server/Dockerfile b/services/api-server/Dockerfile index 954d205fcb04..72d22bc67376 100644 --- a/services/api-server/Dockerfile +++ b/services/api-server/Dockerfile @@ -83,7 +83,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/catalog/Dockerfile b/services/catalog/Dockerfile index e77663cf29f5..982c72f86d7a 100644 --- a/services/catalog/Dockerfile +++ b/services/catalog/Dockerfile @@ -84,7 +84,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/clusters-keeper/Dockerfile b/services/clusters-keeper/Dockerfile index c7f46b91811b..49d802e24f34 100644 --- a/services/clusters-keeper/Dockerfile +++ b/services/clusters-keeper/Dockerfile @@ -103,7 +103,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/dask-sidecar/Dockerfile b/services/dask-sidecar/Dockerfile index 02e3b5b48231..df16cd7460da 100644 --- a/services/dask-sidecar/Dockerfile +++ b/services/dask-sidecar/Dockerfile @@ -93,7 +93,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/datcore-adapter/Dockerfile b/services/datcore-adapter/Dockerfile index 50a8226a06bf..de14e5e665aa 100644 --- a/services/datcore-adapter/Dockerfile +++ b/services/datcore-adapter/Dockerfile @@ -84,7 +84,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/director-v2/Dockerfile b/services/director-v2/Dockerfile index c9f26c112549..556539fb26d5 100644 --- a/services/director-v2/Dockerfile +++ b/services/director-v2/Dockerfile @@ -84,7 +84,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/dynamic-scheduler/Dockerfile b/services/dynamic-scheduler/Dockerfile index ad2443b0de8f..daa20f1012e5 100644 --- a/services/dynamic-scheduler/Dockerfile +++ b/services/dynamic-scheduler/Dockerfile @@ -83,7 +83,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/dynamic-sidecar/Dockerfile b/services/dynamic-sidecar/Dockerfile index 636959ebeaa5..cb0c58b967a6 100644 --- a/services/dynamic-sidecar/Dockerfile +++ b/services/dynamic-sidecar/Dockerfile @@ -125,7 +125,6 @@ RUN uv venv "${VIRTUAL_ENV}" \ RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/efs-guardian/Dockerfile b/services/efs-guardian/Dockerfile index 24d6f7afe412..4bf854002ac5 100644 --- a/services/efs-guardian/Dockerfile +++ b/services/efs-guardian/Dockerfile @@ -121,7 +121,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/invitations/Dockerfile b/services/invitations/Dockerfile index 9fcc77bd7ab9..31b3baf6a86e 100644 --- a/services/invitations/Dockerfile +++ b/services/invitations/Dockerfile @@ -83,7 +83,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/migration/Dockerfile b/services/migration/Dockerfile index 4c80ad5d08d2..30a20c6df93f 100644 --- a/services/migration/Dockerfile +++ b/services/migration/Dockerfile @@ -56,7 +56,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/osparc-gateway-server/Dockerfile b/services/osparc-gateway-server/Dockerfile index 9b97a5b78175..c1d7626a1556 100644 --- a/services/osparc-gateway-server/Dockerfile +++ b/services/osparc-gateway-server/Dockerfile @@ -84,7 +84,6 @@ COPY --from=uv_build /uv /uvx /bin/ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/payments/Dockerfile b/services/payments/Dockerfile index e7c675772a58..0d5d95050a2d 100644 --- a/services/payments/Dockerfile +++ b/services/payments/Dockerfile @@ -83,7 +83,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/resource-usage-tracker/Dockerfile b/services/resource-usage-tracker/Dockerfile index 24f811969017..657affe9a986 100644 --- a/services/resource-usage-tracker/Dockerfile +++ b/services/resource-usage-tracker/Dockerfile @@ -84,7 +84,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/storage/Dockerfile b/services/storage/Dockerfile index 55722844bd69..66fc3de8fc37 100644 --- a/services/storage/Dockerfile +++ b/services/storage/Dockerfile @@ -92,7 +92,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/services/web/Dockerfile b/services/web/Dockerfile index bc15908e93ce..e09e012fa756 100644 --- a/services/web/Dockerfile +++ b/services/web/Dockerfile @@ -96,7 +96,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools From da7c6f8265bb579a59d17ed5a6bbe48d8eaa2c82 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:58:11 +0200 Subject: [PATCH 11/23] remove base installation --- services/agent/Dockerfile | 7 +------ services/api-server/Dockerfile | 7 +------ services/catalog/Dockerfile | 7 +------ services/clusters-keeper/Dockerfile | 7 +------ services/dask-sidecar/Dockerfile | 7 +------ services/datcore-adapter/Dockerfile | 7 +------ services/director-v2/Dockerfile | 7 +------ services/dynamic-scheduler/Dockerfile | 7 +------ services/efs-guardian/Dockerfile | 7 +------ services/invitations/Dockerfile | 7 +------ services/osparc-gateway-server/Dockerfile | 7 +------ services/payments/Dockerfile | 7 +------ services/resource-usage-tracker/Dockerfile | 7 +------ services/storage/Dockerfile | 7 +------ services/web/Dockerfile | 7 +------ 15 files changed, 15 insertions(+), 90 deletions(-) diff --git a/services/agent/Dockerfile b/services/agent/Dockerfile index b1bce1f7af1e..6458eaa35519 100644 --- a/services/agent/Dockerfile +++ b/services/agent/Dockerfile @@ -93,12 +93,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build # install base 3rd party dependencies -# NOTE: copies to /build to avoid overwriting later which would invalidate this layer -RUN \ - --mount=type=bind,source=services/agent/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + # --------------------------Prod-depends-only stage ------------------- diff --git a/services/api-server/Dockerfile b/services/api-server/Dockerfile index 72d22bc67376..8de2fe27df73 100644 --- a/services/api-server/Dockerfile +++ b/services/api-server/Dockerfile @@ -89,12 +89,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build # install base 3rd party dependencies -# NOTE: copies to /build to avoid overwriting later which would invalidate this layer -RUN \ - --mount=type=bind,source=services/api-server/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + # --------------------------Prod-depends-only stage ------------------- diff --git a/services/catalog/Dockerfile b/services/catalog/Dockerfile index 982c72f86d7a..4fefa035dd47 100644 --- a/services/catalog/Dockerfile +++ b/services/catalog/Dockerfile @@ -90,12 +90,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build # install base 3rd party dependencies -# NOTE: copies to /build to avoid overwriting later which would invalidate this layer -RUN \ - --mount=type=bind,source=services/catalog/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + # --------------------------Prod-depends-only stage ------------------- diff --git a/services/clusters-keeper/Dockerfile b/services/clusters-keeper/Dockerfile index 49d802e24f34..25a85687e24e 100644 --- a/services/clusters-keeper/Dockerfile +++ b/services/clusters-keeper/Dockerfile @@ -109,12 +109,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build # install base 3rd party dependencies -# NOTE: copies to /build to avoid overwriting later which would invalidate this layer -RUN \ - --mount=type=bind,source=services/clusters-keeper/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + # --------------------------Prod-depends-only stage ------------------- diff --git a/services/dask-sidecar/Dockerfile b/services/dask-sidecar/Dockerfile index df16cd7460da..e55d6c7fa177 100644 --- a/services/dask-sidecar/Dockerfile +++ b/services/dask-sidecar/Dockerfile @@ -98,12 +98,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build -# install base 3rd party dependencies (NOTE: this speeds up devel mode) -RUN \ - --mount=type=bind,source=services/dask-sidecar/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + # --------------------------Prod-depends-only stage ------------------- # This stage is for production only dependencies that get partially wiped out afterwards (final docker image concerns) diff --git a/services/datcore-adapter/Dockerfile b/services/datcore-adapter/Dockerfile index de14e5e665aa..973a311d74b1 100644 --- a/services/datcore-adapter/Dockerfile +++ b/services/datcore-adapter/Dockerfile @@ -90,12 +90,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build # install base 3rd party dependencies -# NOTE: copies to /build to avoid overwriting later which would invalidate this layer -RUN \ - --mount=type=bind,source=services/datcore-adapter/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + # --------------------------Prod-depends-only stage ------------------- diff --git a/services/director-v2/Dockerfile b/services/director-v2/Dockerfile index 556539fb26d5..c848393d9902 100644 --- a/services/director-v2/Dockerfile +++ b/services/director-v2/Dockerfile @@ -90,12 +90,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build # install base 3rd party dependencies -# NOTE: copies to /build to avoid overwriting later which would invalidate this layer -RUN \ - --mount=type=bind,source=services/director-v2/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + # --------------------------Prod-depends-only stage ------------------- diff --git a/services/dynamic-scheduler/Dockerfile b/services/dynamic-scheduler/Dockerfile index daa20f1012e5..50ee3b8f1845 100644 --- a/services/dynamic-scheduler/Dockerfile +++ b/services/dynamic-scheduler/Dockerfile @@ -89,12 +89,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build # install base 3rd party dependencies -# NOTE: copies to /build to avoid overwriting later which would invalidate this layer -RUN \ - --mount=type=bind,source=services/dynamic-scheduler/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + diff --git a/services/efs-guardian/Dockerfile b/services/efs-guardian/Dockerfile index 4bf854002ac5..100367886ad3 100644 --- a/services/efs-guardian/Dockerfile +++ b/services/efs-guardian/Dockerfile @@ -127,12 +127,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build # install base 3rd party dependencies -# NOTE: copies to /build to avoid overwriting later which would invalidate this layer -RUN \ - --mount=type=bind,source=services/efs-guardian/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + # --------------------------Prod-depends-only stage ------------------- diff --git a/services/invitations/Dockerfile b/services/invitations/Dockerfile index 31b3baf6a86e..a93111352863 100644 --- a/services/invitations/Dockerfile +++ b/services/invitations/Dockerfile @@ -89,12 +89,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build # install base 3rd party dependencies -# NOTE: copies to /build to avoid overwriting later which would invalidate this layer -RUN \ - --mount=type=bind,source=services/invitations/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + diff --git a/services/osparc-gateway-server/Dockerfile b/services/osparc-gateway-server/Dockerfile index c1d7626a1556..899ef0fb434c 100644 --- a/services/osparc-gateway-server/Dockerfile +++ b/services/osparc-gateway-server/Dockerfile @@ -89,12 +89,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build -# install base 3rd party dependencies (NOTE: this speeds up devel mode) -RUN \ - --mount=type=bind,source=services/osparc-gateway-server/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + # in ARM64 mode there is a catch: the piwheels package does not contain the dask-gateway-proxy executable in 64-bit RUN dpkgArch="$(dpkg --print-architecture)";\ diff --git a/services/payments/Dockerfile b/services/payments/Dockerfile index 0d5d95050a2d..0fe754acaf4e 100644 --- a/services/payments/Dockerfile +++ b/services/payments/Dockerfile @@ -89,12 +89,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build # install base 3rd party dependencies -# NOTE: copies to /build to avoid overwriting later which would invalidate this layer -RUN \ - --mount=type=bind,source=services/payments/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + diff --git a/services/resource-usage-tracker/Dockerfile b/services/resource-usage-tracker/Dockerfile index 657affe9a986..94a9563e39c7 100644 --- a/services/resource-usage-tracker/Dockerfile +++ b/services/resource-usage-tracker/Dockerfile @@ -90,12 +90,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build # install base 3rd party dependencies -# NOTE: copies to /build to avoid overwriting later which would invalidate this layer -RUN \ - --mount=type=bind,source=services/resource-usage-tracker/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + # --------------------------Prod-depends-only stage ------------------- diff --git a/services/storage/Dockerfile b/services/storage/Dockerfile index 66fc3de8fc37..5cfa463ee224 100644 --- a/services/storage/Dockerfile +++ b/services/storage/Dockerfile @@ -97,12 +97,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build -# install only base 3rd party dependencies -RUN \ - --mount=type=bind,source=services/storage/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + # -------------------------- ------------------------------- diff --git a/services/web/Dockerfile b/services/web/Dockerfile index e09e012fa756..58886cf17bc7 100644 --- a/services/web/Dockerfile +++ b/services/web/Dockerfile @@ -101,12 +101,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build -# install only base 3rd party dependencies -RUN \ - --mount=type=bind,source=services/web/server/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement _base.txt + # --------------------------Prod-depends-only stage ------------------- # This stage is for production only dependencies that get partially wiped out afterwards (final docker image concerns) From 2db6388f8dcf1b0d96d6d7b8e1e79ae855de8a74 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Mon, 21 Oct 2024 19:03:24 +0200 Subject: [PATCH 12/23] us pip sync --- services/agent/Dockerfile | 4 ++-- services/api-server/Dockerfile | 4 ++-- services/catalog/Dockerfile | 4 ++-- services/clusters-keeper/Dockerfile | 4 ++-- services/dask-sidecar/Dockerfile | 4 ++-- services/datcore-adapter/Dockerfile | 4 ++-- services/director-v2/Dockerfile | 4 ++-- services/dynamic-scheduler/Dockerfile | 4 ++-- services/dynamic-sidecar/Dockerfile | 11 ++--------- services/efs-guardian/Dockerfile | 4 ++-- services/invitations/Dockerfile | 4 ++-- services/payments/Dockerfile | 4 ++-- services/resource-usage-tracker/Dockerfile | 4 ++-- services/storage/Dockerfile | 4 ++-- services/web/Dockerfile | 4 ++-- 15 files changed, 30 insertions(+), 37 deletions(-) diff --git a/services/agent/Dockerfile b/services/agent/Dockerfile index 6458eaa35519..9b5d031affd7 100644 --- a/services/agent/Dockerfile +++ b/services/agent/Dockerfile @@ -112,8 +112,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/agent,target=/build/services/agent,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list diff --git a/services/api-server/Dockerfile b/services/api-server/Dockerfile index 8de2fe27df73..933df727fc67 100644 --- a/services/api-server/Dockerfile +++ b/services/api-server/Dockerfile @@ -108,8 +108,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/api-server,target=/build/services/api-server,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list diff --git a/services/catalog/Dockerfile b/services/catalog/Dockerfile index 4fefa035dd47..8fb6418b3ce4 100644 --- a/services/catalog/Dockerfile +++ b/services/catalog/Dockerfile @@ -109,8 +109,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/catalog,target=/build/services/catalog,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list diff --git a/services/clusters-keeper/Dockerfile b/services/clusters-keeper/Dockerfile index 25a85687e24e..e75ba032ac0c 100644 --- a/services/clusters-keeper/Dockerfile +++ b/services/clusters-keeper/Dockerfile @@ -128,8 +128,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/clusters-keeper,target=/build/services/clusters-keeper,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list diff --git a/services/dask-sidecar/Dockerfile b/services/dask-sidecar/Dockerfile index e55d6c7fa177..5ea8e90d5454 100644 --- a/services/dask-sidecar/Dockerfile +++ b/services/dask-sidecar/Dockerfile @@ -116,8 +116,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/dask-sidecar,target=/build/services/dask-sidecar,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list # --------------------------Production stage ------------------- diff --git a/services/datcore-adapter/Dockerfile b/services/datcore-adapter/Dockerfile index 973a311d74b1..e83bf01c37eb 100644 --- a/services/datcore-adapter/Dockerfile +++ b/services/datcore-adapter/Dockerfile @@ -109,8 +109,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/datcore-adapter,target=/build/services/datcore-adapter,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list diff --git a/services/director-v2/Dockerfile b/services/director-v2/Dockerfile index c848393d9902..5388dbb6f73e 100644 --- a/services/director-v2/Dockerfile +++ b/services/director-v2/Dockerfile @@ -109,8 +109,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/director-v2,target=/build/services/director-v2,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list diff --git a/services/dynamic-scheduler/Dockerfile b/services/dynamic-scheduler/Dockerfile index 50ee3b8f1845..b3e9119c898b 100644 --- a/services/dynamic-scheduler/Dockerfile +++ b/services/dynamic-scheduler/Dockerfile @@ -109,8 +109,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/dynamic-scheduler,target=/build/services/dynamic-scheduler,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list diff --git a/services/dynamic-sidecar/Dockerfile b/services/dynamic-sidecar/Dockerfile index cb0c58b967a6..5eb6662593f7 100644 --- a/services/dynamic-sidecar/Dockerfile +++ b/services/dynamic-sidecar/Dockerfile @@ -131,13 +131,6 @@ RUN --mount=type=cache,target=/root/.cache/uv \ WORKDIR /build -# install base 3rd party dependencies -# NOTE: copies to /build to avoid overwriting later which would invalidate this layer -RUN \ - --mount=type=bind,source=services/dynamic-sidecar/requirements/_base.txt,target=_base.txt \ - --mount=type=cache,mode=0755,target=/root/.cache/pip \ - uv pip install \ - --requirement _base.txt # copy utility devops scripts COPY --chown=scu:scu services/dynamic-sidecar/scripts/Makefile /home/scu @@ -159,8 +152,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/dynamic-sidecar,target=/build/services/dynamic-sidecar,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list # --------------------------Production stage ------------------- diff --git a/services/efs-guardian/Dockerfile b/services/efs-guardian/Dockerfile index 100367886ad3..82174799ca59 100644 --- a/services/efs-guardian/Dockerfile +++ b/services/efs-guardian/Dockerfile @@ -146,8 +146,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/efs-guardian,target=/build/services/efs-guardian,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list diff --git a/services/invitations/Dockerfile b/services/invitations/Dockerfile index a93111352863..0422ca73cbd6 100644 --- a/services/invitations/Dockerfile +++ b/services/invitations/Dockerfile @@ -109,8 +109,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/invitations,target=/build/services/invitations,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list diff --git a/services/payments/Dockerfile b/services/payments/Dockerfile index 0fe754acaf4e..32fada11361d 100644 --- a/services/payments/Dockerfile +++ b/services/payments/Dockerfile @@ -109,8 +109,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/payments,target=/build/services/payments,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list diff --git a/services/resource-usage-tracker/Dockerfile b/services/resource-usage-tracker/Dockerfile index 94a9563e39c7..528ecabfd3ea 100644 --- a/services/resource-usage-tracker/Dockerfile +++ b/services/resource-usage-tracker/Dockerfile @@ -109,8 +109,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/resource-usage-tracker,target=/build/services/resource-usage-tracker,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list diff --git a/services/storage/Dockerfile b/services/storage/Dockerfile index 5cfa463ee224..8c9f0e381c0e 100644 --- a/services/storage/Dockerfile +++ b/services/storage/Dockerfile @@ -121,8 +121,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/storage,target=/build/services/storage,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list # -------------------------- ------------------------------- diff --git a/services/web/Dockerfile b/services/web/Dockerfile index 58886cf17bc7..e7ff6b3fe41c 100644 --- a/services/web/Dockerfile +++ b/services/web/Dockerfile @@ -120,8 +120,8 @@ RUN \ --mount=type=bind,source=packages,target=/build/packages,rw \ --mount=type=bind,source=services/web/server,target=/build/services/web/server,rw \ --mount=type=cache,target=/root/.cache/uv \ - uv pip install \ - --requirement requirements/prod.txt \ + uv pip sync \ + requirements/prod.txt \ && uv pip list # --------------------------Production stage ------------------- From f88211d8973fb3144021abbe1e0e76b4c4438d06 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Mon, 21 Oct 2024 19:05:45 +0200 Subject: [PATCH 13/23] unify --- services/agent/docker/boot.sh | 2 +- services/api-server/docker/boot.sh | 2 +- services/catalog/docker/boot.sh | 2 +- services/clusters-keeper/docker/boot.sh | 2 +- services/dask-sidecar/docker/boot.sh | 2 +- services/datcore-adapter/docker/boot.sh | 2 +- services/director-v2/docker/boot.sh | 2 +- services/dynamic-scheduler/docker/boot.sh | 2 +- services/efs-guardian/docker/boot.sh | 2 +- services/invitations/docker/boot.sh | 2 +- services/osparc-gateway-server/docker/boot.sh | 2 +- services/payments/docker/boot.sh | 2 +- services/resource-usage-tracker/docker/boot.sh | 2 +- services/storage/docker/boot.sh | 2 +- services/web/server/docker/boot.sh | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/services/agent/docker/boot.sh b/services/agent/docker/boot.sh index 333a4af7469e..5dd20242243c 100755 --- a/services/agent/docker/boot.sh +++ b/services/agent/docker/boot.sh @@ -23,7 +23,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/agent || exit 1 + cd services/agent pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 diff --git a/services/api-server/docker/boot.sh b/services/api-server/docker/boot.sh index 39f5867806a5..858c455f13bb 100755 --- a/services/api-server/docker/boot.sh +++ b/services/api-server/docker/boot.sh @@ -18,7 +18,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/api-server || exit 1 + cd services/api-server pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 diff --git a/services/catalog/docker/boot.sh b/services/catalog/docker/boot.sh index 69ce7ebb4ec2..1cc88e91c780 100755 --- a/services/catalog/docker/boot.sh +++ b/services/catalog/docker/boot.sh @@ -18,7 +18,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/catalog || exit 1 + cd services/catalog pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 diff --git a/services/clusters-keeper/docker/boot.sh b/services/clusters-keeper/docker/boot.sh index f0239f42e720..04bbeb178f06 100755 --- a/services/clusters-keeper/docker/boot.sh +++ b/services/clusters-keeper/docker/boot.sh @@ -23,7 +23,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/clusters-keeper || exit 1 + cd services/clusters-keeper pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 diff --git a/services/dask-sidecar/docker/boot.sh b/services/dask-sidecar/docker/boot.sh index 213377cbf0ee..73fefc55a9c1 100755 --- a/services/dask-sidecar/docker/boot.sh +++ b/services/dask-sidecar/docker/boot.sh @@ -24,7 +24,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then print_info "Python :" python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/dask-sidecar || exit 1 + cd services/dask-sidecar pip install --no-cache-dir -r requirements/dev.txt cd - || exit 1 print_info "PIP :" diff --git a/services/datcore-adapter/docker/boot.sh b/services/datcore-adapter/docker/boot.sh index 1002a32de8a2..d99199946726 100755 --- a/services/datcore-adapter/docker/boot.sh +++ b/services/datcore-adapter/docker/boot.sh @@ -23,7 +23,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/datcore-adapter || exit 1 + cd services/datcore-adapter pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 diff --git a/services/director-v2/docker/boot.sh b/services/director-v2/docker/boot.sh index 348b976149cb..4d4d162fd207 100755 --- a/services/director-v2/docker/boot.sh +++ b/services/director-v2/docker/boot.sh @@ -23,7 +23,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/director-v2 || exit 1 + cd services/director-v2 pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 diff --git a/services/dynamic-scheduler/docker/boot.sh b/services/dynamic-scheduler/docker/boot.sh index 7164715d7dce..c7c403ca32ad 100755 --- a/services/dynamic-scheduler/docker/boot.sh +++ b/services/dynamic-scheduler/docker/boot.sh @@ -23,7 +23,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/dynamic-scheduler || exit 1 + cd services/dynamic-scheduler pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 diff --git a/services/efs-guardian/docker/boot.sh b/services/efs-guardian/docker/boot.sh index d4d046d5a14e..e041fa0a89c9 100755 --- a/services/efs-guardian/docker/boot.sh +++ b/services/efs-guardian/docker/boot.sh @@ -23,7 +23,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/efs-guardian || exit 1 + cd services/efs-guardian pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 diff --git a/services/invitations/docker/boot.sh b/services/invitations/docker/boot.sh index b6ed691759ff..533e0370863b 100755 --- a/services/invitations/docker/boot.sh +++ b/services/invitations/docker/boot.sh @@ -23,7 +23,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/invitations || exit 1 + cd services/invitations pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 diff --git a/services/osparc-gateway-server/docker/boot.sh b/services/osparc-gateway-server/docker/boot.sh index d1daccc6195f..364e8e8588a0 100755 --- a/services/osparc-gateway-server/docker/boot.sh +++ b/services/osparc-gateway-server/docker/boot.sh @@ -18,7 +18,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then echo "$INFO" "Python :" python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/osparc-gateway-server || exit 1 + cd services/osparc-gateway-server pip install --no-cache-dir -r requirements/dev.txt cd - || exit 1 echo "$INFO" "PIP :" diff --git a/services/payments/docker/boot.sh b/services/payments/docker/boot.sh index bf5b6881fa13..cd9d2d9178a9 100755 --- a/services/payments/docker/boot.sh +++ b/services/payments/docker/boot.sh @@ -23,7 +23,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/payments || exit 1 + cd services/payments pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 diff --git a/services/resource-usage-tracker/docker/boot.sh b/services/resource-usage-tracker/docker/boot.sh index 878b164a05e8..0a67d78df6a6 100755 --- a/services/resource-usage-tracker/docker/boot.sh +++ b/services/resource-usage-tracker/docker/boot.sh @@ -23,7 +23,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/resource-usage-tracker || exit 1 + cd services/resource-usage-tracker pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 diff --git a/services/storage/docker/boot.sh b/services/storage/docker/boot.sh index 8f4c4f64346b..49e9446009d0 100755 --- a/services/storage/docker/boot.sh +++ b/services/storage/docker/boot.sh @@ -18,7 +18,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/storage || exit 1 + cd services/storage pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 diff --git a/services/web/server/docker/boot.sh b/services/web/server/docker/boot.sh index e6b36ce57888..8a766082d7ca 100755 --- a/services/web/server/docker/boot.sh +++ b/services/web/server/docker/boot.sh @@ -18,7 +18,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' - cd services/web/server || exit 1 + cd services/web/server pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt cd - || exit 1 From 26a997234fc504d0449650a6a90a8e809ef91c29 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Mon, 21 Oct 2024 19:07:43 +0200 Subject: [PATCH 14/23] unify --- services/agent/docker/boot.sh | 2 +- services/api-server/docker/boot.sh | 2 +- services/catalog/docker/boot.sh | 2 +- services/clusters-keeper/docker/boot.sh | 2 +- services/dask-sidecar/docker/boot.sh | 4 ++-- services/datcore-adapter/docker/boot.sh | 2 +- services/director-v2/docker/boot.sh | 2 +- services/dynamic-scheduler/docker/boot.sh | 2 +- services/dynamic-sidecar/docker/boot.sh | 2 +- services/efs-guardian/docker/boot.sh | 2 +- services/invitations/docker/boot.sh | 2 +- services/osparc-gateway-server/docker/boot.sh | 4 ++-- services/payments/docker/boot.sh | 2 +- services/resource-usage-tracker/docker/boot.sh | 2 +- services/storage/docker/boot.sh | 2 +- services/web/server/docker/boot.sh | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-) diff --git a/services/agent/docker/boot.sh b/services/agent/docker/boot.sh index 5dd20242243c..552790e2a347 100755 --- a/services/agent/docker/boot.sh +++ b/services/agent/docker/boot.sh @@ -26,7 +26,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/agent pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' fi diff --git a/services/api-server/docker/boot.sh b/services/api-server/docker/boot.sh index 858c455f13bb..270c807371b8 100755 --- a/services/api-server/docker/boot.sh +++ b/services/api-server/docker/boot.sh @@ -21,7 +21,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/api-server pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' fi diff --git a/services/catalog/docker/boot.sh b/services/catalog/docker/boot.sh index 1cc88e91c780..9c493aa27b82 100755 --- a/services/catalog/docker/boot.sh +++ b/services/catalog/docker/boot.sh @@ -21,7 +21,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/catalog pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' fi diff --git a/services/clusters-keeper/docker/boot.sh b/services/clusters-keeper/docker/boot.sh index 04bbeb178f06..b4cfad74f0a8 100755 --- a/services/clusters-keeper/docker/boot.sh +++ b/services/clusters-keeper/docker/boot.sh @@ -26,7 +26,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/clusters-keeper pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' fi diff --git a/services/dask-sidecar/docker/boot.sh b/services/dask-sidecar/docker/boot.sh index 73fefc55a9c1..f81c992f7e16 100755 --- a/services/dask-sidecar/docker/boot.sh +++ b/services/dask-sidecar/docker/boot.sh @@ -25,8 +25,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' cd services/dask-sidecar - pip install --no-cache-dir -r requirements/dev.txt - cd - || exit 1 + uv pip install --no-cache-dir -r requirements/dev.txt + cd - print_info "PIP :" uv pip list | sed 's/^/ /' fi diff --git a/services/datcore-adapter/docker/boot.sh b/services/datcore-adapter/docker/boot.sh index d99199946726..31fcae9830f9 100755 --- a/services/datcore-adapter/docker/boot.sh +++ b/services/datcore-adapter/docker/boot.sh @@ -26,7 +26,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/datcore-adapter pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' fi diff --git a/services/director-v2/docker/boot.sh b/services/director-v2/docker/boot.sh index 4d4d162fd207..70e5307dc349 100755 --- a/services/director-v2/docker/boot.sh +++ b/services/director-v2/docker/boot.sh @@ -26,7 +26,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/director-v2 pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' fi diff --git a/services/dynamic-scheduler/docker/boot.sh b/services/dynamic-scheduler/docker/boot.sh index c7c403ca32ad..7ec0c732a244 100755 --- a/services/dynamic-scheduler/docker/boot.sh +++ b/services/dynamic-scheduler/docker/boot.sh @@ -26,7 +26,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/dynamic-scheduler pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' fi diff --git a/services/dynamic-sidecar/docker/boot.sh b/services/dynamic-sidecar/docker/boot.sh index ff63ce74cfb9..c089c302388c 100755 --- a/services/dynamic-sidecar/docker/boot.sh +++ b/services/dynamic-sidecar/docker/boot.sh @@ -26,7 +26,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then # NOTE: uv does not like this requirement file... cd /devel/services/dynamic-sidecar pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" pip list | sed 's/^/ /' fi diff --git a/services/efs-guardian/docker/boot.sh b/services/efs-guardian/docker/boot.sh index e041fa0a89c9..3d9b166c749a 100755 --- a/services/efs-guardian/docker/boot.sh +++ b/services/efs-guardian/docker/boot.sh @@ -26,7 +26,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/efs-guardian pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' fi diff --git a/services/invitations/docker/boot.sh b/services/invitations/docker/boot.sh index 533e0370863b..b79e8aa2c384 100755 --- a/services/invitations/docker/boot.sh +++ b/services/invitations/docker/boot.sh @@ -26,7 +26,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/invitations pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' fi diff --git a/services/osparc-gateway-server/docker/boot.sh b/services/osparc-gateway-server/docker/boot.sh index 364e8e8588a0..8f8669cec0be 100755 --- a/services/osparc-gateway-server/docker/boot.sh +++ b/services/osparc-gateway-server/docker/boot.sh @@ -19,8 +19,8 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' cd services/osparc-gateway-server - pip install --no-cache-dir -r requirements/dev.txt - cd - || exit 1 + uv pip install --no-cache-dir -r requirements/dev.txt + cd - echo "$INFO" "PIP :" pip list | sed 's/^/ /' fi diff --git a/services/payments/docker/boot.sh b/services/payments/docker/boot.sh index cd9d2d9178a9..a300324d26d8 100755 --- a/services/payments/docker/boot.sh +++ b/services/payments/docker/boot.sh @@ -26,7 +26,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/payments pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' fi diff --git a/services/resource-usage-tracker/docker/boot.sh b/services/resource-usage-tracker/docker/boot.sh index 0a67d78df6a6..5289bc035b60 100755 --- a/services/resource-usage-tracker/docker/boot.sh +++ b/services/resource-usage-tracker/docker/boot.sh @@ -26,7 +26,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/resource-usage-tracker pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' fi diff --git a/services/storage/docker/boot.sh b/services/storage/docker/boot.sh index 49e9446009d0..78408aea5e2d 100755 --- a/services/storage/docker/boot.sh +++ b/services/storage/docker/boot.sh @@ -21,7 +21,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/storage pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/web/server/docker/boot.sh b/services/web/server/docker/boot.sh index 8a766082d7ca..fbc310dedc20 100755 --- a/services/web/server/docker/boot.sh +++ b/services/web/server/docker/boot.sh @@ -21,7 +21,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/web/server pip install uv uv pip --quiet --no-cache-dir install -r requirements/dev.txt - cd - || exit 1 + cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' From b44356cd9a48106a9615d2696ceb23c8f329f929 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Mon, 21 Oct 2024 19:10:11 +0200 Subject: [PATCH 15/23] unify --- services/agent/docker/boot.sh | 2 +- services/api-server/docker/boot.sh | 2 +- services/catalog/docker/boot.sh | 2 +- services/clusters-keeper/docker/boot.sh | 2 +- services/dask-sidecar/docker/boot.sh | 2 +- services/datcore-adapter/docker/boot.sh | 2 +- services/director-v2/docker/boot.sh | 2 +- services/dynamic-scheduler/docker/boot.sh | 2 +- services/dynamic-sidecar/docker/boot.sh | 2 +- services/efs-guardian/docker/boot.sh | 2 +- services/invitations/docker/boot.sh | 2 +- services/payments/docker/boot.sh | 2 +- services/resource-usage-tracker/docker/boot.sh | 2 +- services/storage/docker/boot.sh | 2 +- services/web/server/docker/boot.sh | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/services/agent/docker/boot.sh b/services/agent/docker/boot.sh index 552790e2a347..76463703e0cb 100755 --- a/services/agent/docker/boot.sh +++ b/services/agent/docker/boot.sh @@ -25,7 +25,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/agent pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/api-server/docker/boot.sh b/services/api-server/docker/boot.sh index 270c807371b8..94961536d0e4 100755 --- a/services/api-server/docker/boot.sh +++ b/services/api-server/docker/boot.sh @@ -20,7 +20,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/api-server pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/catalog/docker/boot.sh b/services/catalog/docker/boot.sh index 9c493aa27b82..f0faf0760593 100755 --- a/services/catalog/docker/boot.sh +++ b/services/catalog/docker/boot.sh @@ -20,7 +20,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/catalog pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/clusters-keeper/docker/boot.sh b/services/clusters-keeper/docker/boot.sh index b4cfad74f0a8..b9cdaa95b5d6 100755 --- a/services/clusters-keeper/docker/boot.sh +++ b/services/clusters-keeper/docker/boot.sh @@ -25,7 +25,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/clusters-keeper pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/dask-sidecar/docker/boot.sh b/services/dask-sidecar/docker/boot.sh index f81c992f7e16..88e7cdf9d743 100755 --- a/services/dask-sidecar/docker/boot.sh +++ b/services/dask-sidecar/docker/boot.sh @@ -25,7 +25,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then python --version | sed 's/^/ /' command -v python | sed 's/^/ /' cd services/dask-sidecar - uv pip install --no-cache-dir -r requirements/dev.txt + uv pip sync --quiet --no-cache-dir requirements/dev.txt cd - print_info "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/datcore-adapter/docker/boot.sh b/services/datcore-adapter/docker/boot.sh index 31fcae9830f9..e5c8eec569b4 100755 --- a/services/datcore-adapter/docker/boot.sh +++ b/services/datcore-adapter/docker/boot.sh @@ -25,7 +25,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/datcore-adapter pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/director-v2/docker/boot.sh b/services/director-v2/docker/boot.sh index 70e5307dc349..209524a70323 100755 --- a/services/director-v2/docker/boot.sh +++ b/services/director-v2/docker/boot.sh @@ -25,7 +25,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/director-v2 pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/dynamic-scheduler/docker/boot.sh b/services/dynamic-scheduler/docker/boot.sh index 7ec0c732a244..5b5fe16fa99b 100755 --- a/services/dynamic-scheduler/docker/boot.sh +++ b/services/dynamic-scheduler/docker/boot.sh @@ -25,7 +25,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/dynamic-scheduler pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/dynamic-sidecar/docker/boot.sh b/services/dynamic-sidecar/docker/boot.sh index c089c302388c..a15772d0ab53 100755 --- a/services/dynamic-sidecar/docker/boot.sh +++ b/services/dynamic-sidecar/docker/boot.sh @@ -25,7 +25,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then # NOTE: uv does not like this requirement file... cd /devel/services/dynamic-sidecar - pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" pip list | sed 's/^/ /' diff --git a/services/efs-guardian/docker/boot.sh b/services/efs-guardian/docker/boot.sh index 3d9b166c749a..ad6bf55d549e 100755 --- a/services/efs-guardian/docker/boot.sh +++ b/services/efs-guardian/docker/boot.sh @@ -25,7 +25,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/efs-guardian pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/invitations/docker/boot.sh b/services/invitations/docker/boot.sh index b79e8aa2c384..1b335db4e71e 100755 --- a/services/invitations/docker/boot.sh +++ b/services/invitations/docker/boot.sh @@ -25,7 +25,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/invitations pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/payments/docker/boot.sh b/services/payments/docker/boot.sh index a300324d26d8..6b1e5f591878 100755 --- a/services/payments/docker/boot.sh +++ b/services/payments/docker/boot.sh @@ -25,7 +25,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/payments pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/resource-usage-tracker/docker/boot.sh b/services/resource-usage-tracker/docker/boot.sh index 5289bc035b60..d871773821a7 100755 --- a/services/resource-usage-tracker/docker/boot.sh +++ b/services/resource-usage-tracker/docker/boot.sh @@ -25,7 +25,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/resource-usage-tracker pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/storage/docker/boot.sh b/services/storage/docker/boot.sh index 78408aea5e2d..e327977e6bcc 100755 --- a/services/storage/docker/boot.sh +++ b/services/storage/docker/boot.sh @@ -20,7 +20,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/storage pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' diff --git a/services/web/server/docker/boot.sh b/services/web/server/docker/boot.sh index fbc310dedc20..02037e508acc 100755 --- a/services/web/server/docker/boot.sh +++ b/services/web/server/docker/boot.sh @@ -20,7 +20,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then cd services/web/server pip install uv - uv pip --quiet --no-cache-dir install -r requirements/dev.txt + uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" uv pip list | sed 's/^/ /' From 476c88f4b3d831d6896612b2c390f64b5bce6909 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 22 Oct 2024 08:07:43 +0200 Subject: [PATCH 16/23] use uv --- packages/postgres-database/scripts/erd/Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/postgres-database/scripts/erd/Dockerfile b/packages/postgres-database/scripts/erd/Dockerfile index 08d231098446..168c55222904 100644 --- a/packages/postgres-database/scripts/erd/Dockerfile +++ b/packages/postgres-database/scripts/erd/Dockerfile @@ -20,15 +20,14 @@ RUN apt-get update \ && apt-get clean -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ - pip~=24.0 \ +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip install --upgrade \ wheel \ setuptools # devenv COPY requirements.txt requirements.txt -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install \ - -r requirements.txt +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip sync \ + requirements.txt From 48330b67bd33a2421da3a279f87a5ce5c8d983d1 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 22 Oct 2024 08:16:00 +0200 Subject: [PATCH 17/23] fixes --- packages/postgres-database/docker/Dockerfile | 7 +++++-- packages/service-integration/Dockerfile | 11 +++-------- requirements/tools/Dockerfile | 4 +++- scripts/apt-packages-versions/Dockerfile | 5 ----- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/packages/postgres-database/docker/Dockerfile b/packages/postgres-database/docker/Dockerfile index 89b7ad2c37e1..ba5a04156af9 100644 --- a/packages/postgres-database/docker/Dockerfile +++ b/packages/postgres-database/docker/Dockerfile @@ -1,5 +1,9 @@ # syntax=docker/dockerfile:1 -FROM python:3.6-slim AS base +ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian +FROM python:${PYTHON_VERSION}-slim-bookworm AS base LABEL maintainer=sanderegg @@ -30,7 +34,6 @@ RUN uv venv "${VIRTUAL_ENV}" RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install --upgrade \ - pip~=24.0 \ wheel \ setuptools diff --git a/packages/service-integration/Dockerfile b/packages/service-integration/Dockerfile index 4868968c5d24..b41f4d07b0bd 100644 --- a/packages/service-integration/Dockerfile +++ b/packages/service-integration/Dockerfile @@ -43,12 +43,13 @@ ENV LANG=C.UTF-8 # Turns off writing .pyc files; superfluous on an ephemeral container. ENV PYTHONDONTWRITEBYTECODE=1 \ VIRTUAL_ENV=/home/scu/.venv +# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 # Ensures that the python and pip executables used # in the image will be those from our virtualenv. ENV PATH="${VIRTUAL_ENV}/bin:$PATH" - # -------------------------- Build stage ------------------- FROM base AS build @@ -90,10 +91,6 @@ FROM base AS development # NOTE: this is necessary to allow to build development images but is the same as production here FROM base AS production -ENV PYTHONOPTIMIZE=TRUE -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 - WORKDIR /home/scu # ensure home folder is read/writable for user scu RUN chown -R scu /home/scu @@ -102,7 +99,5 @@ USER scu COPY --from=build --chown=scu:scu ${VIRTUAL_ENV} ${VIRTUAL_ENV} -# NOTE: do not activate ENV PYTHONOPTIMIZE=TRUE -# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode -ENV UV_COMPILE_BYTECODE=1 since excutable contains pytest code +# NOTE: do not activate ENV PYTHONOPTIMIZE=TRUE since excutable contains pytest code ENTRYPOINT [ "ooil" ] diff --git a/requirements/tools/Dockerfile b/requirements/tools/Dockerfile index 3016cc60310f..0901b5e83025 100644 --- a/requirements/tools/Dockerfile +++ b/requirements/tools/Dockerfile @@ -9,6 +9,9 @@ # # ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base ENV VIRTUAL_ENV=/home/scu/.venv @@ -39,7 +42,6 @@ RUN --mount=type=cache,target=/root/.cache/uv \ # devenv RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install \ - pip-tools \ pipreqs \ pipdeptree && \ uv pip list -vv diff --git a/scripts/apt-packages-versions/Dockerfile b/scripts/apt-packages-versions/Dockerfile index 9ac5ed49ea7a..02708317fe10 100644 --- a/scripts/apt-packages-versions/Dockerfile +++ b/scripts/apt-packages-versions/Dockerfile @@ -1,10 +1,5 @@ # syntax=docker/dockerfile:1 - -# Define arguments in the global scope ARG PYTHON_VERSION="3.11.9" -ARG UV_VERSION="0.4" -FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build -# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base RUN \ From 6531cde7b6202ccd7ff59e393e4bb5241adb0655 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 22 Oct 2024 08:23:44 +0200 Subject: [PATCH 18/23] do not install uv it's there --- services/agent/docker/boot.sh | 1 - services/api-server/docker/boot.sh | 1 - services/catalog/docker/boot.sh | 1 - services/clusters-keeper/docker/boot.sh | 1 - services/datcore-adapter/docker/boot.sh | 1 - services/director-v2/docker/boot.sh | 1 - services/dynamic-scheduler/docker/boot.sh | 1 - services/efs-guardian/docker/boot.sh | 1 - services/invitations/docker/boot.sh | 1 - services/payments/docker/boot.sh | 1 - services/resource-usage-tracker/docker/boot.sh | 1 - services/storage/docker/boot.sh | 1 - services/web/server/docker/boot.sh | 1 - 13 files changed, 13 deletions(-) diff --git a/services/agent/docker/boot.sh b/services/agent/docker/boot.sh index 76463703e0cb..bbe20bdf8ef2 100755 --- a/services/agent/docker/boot.sh +++ b/services/agent/docker/boot.sh @@ -24,7 +24,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/agent - pip install uv uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" diff --git a/services/api-server/docker/boot.sh b/services/api-server/docker/boot.sh index 94961536d0e4..80452df1e03e 100755 --- a/services/api-server/docker/boot.sh +++ b/services/api-server/docker/boot.sh @@ -19,7 +19,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/api-server - pip install uv uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" diff --git a/services/catalog/docker/boot.sh b/services/catalog/docker/boot.sh index f0faf0760593..f71fd2a0c854 100755 --- a/services/catalog/docker/boot.sh +++ b/services/catalog/docker/boot.sh @@ -19,7 +19,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/catalog - pip install uv uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" diff --git a/services/clusters-keeper/docker/boot.sh b/services/clusters-keeper/docker/boot.sh index b9cdaa95b5d6..8b86edc15542 100755 --- a/services/clusters-keeper/docker/boot.sh +++ b/services/clusters-keeper/docker/boot.sh @@ -24,7 +24,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/clusters-keeper - pip install uv uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" diff --git a/services/datcore-adapter/docker/boot.sh b/services/datcore-adapter/docker/boot.sh index e5c8eec569b4..63682660492a 100755 --- a/services/datcore-adapter/docker/boot.sh +++ b/services/datcore-adapter/docker/boot.sh @@ -24,7 +24,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/datcore-adapter - pip install uv uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" diff --git a/services/director-v2/docker/boot.sh b/services/director-v2/docker/boot.sh index 209524a70323..74efe795a987 100755 --- a/services/director-v2/docker/boot.sh +++ b/services/director-v2/docker/boot.sh @@ -24,7 +24,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/director-v2 - pip install uv uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" diff --git a/services/dynamic-scheduler/docker/boot.sh b/services/dynamic-scheduler/docker/boot.sh index 5b5fe16fa99b..d68e3aab6ddf 100755 --- a/services/dynamic-scheduler/docker/boot.sh +++ b/services/dynamic-scheduler/docker/boot.sh @@ -24,7 +24,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/dynamic-scheduler - pip install uv uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" diff --git a/services/efs-guardian/docker/boot.sh b/services/efs-guardian/docker/boot.sh index ad6bf55d549e..e0f3be8059ee 100755 --- a/services/efs-guardian/docker/boot.sh +++ b/services/efs-guardian/docker/boot.sh @@ -24,7 +24,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/efs-guardian - pip install uv uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" diff --git a/services/invitations/docker/boot.sh b/services/invitations/docker/boot.sh index 1b335db4e71e..2a192344db0d 100755 --- a/services/invitations/docker/boot.sh +++ b/services/invitations/docker/boot.sh @@ -24,7 +24,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/invitations - pip install uv uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" diff --git a/services/payments/docker/boot.sh b/services/payments/docker/boot.sh index 6b1e5f591878..b223b0991404 100755 --- a/services/payments/docker/boot.sh +++ b/services/payments/docker/boot.sh @@ -24,7 +24,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/payments - pip install uv uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" diff --git a/services/resource-usage-tracker/docker/boot.sh b/services/resource-usage-tracker/docker/boot.sh index d871773821a7..9e6d99480695 100755 --- a/services/resource-usage-tracker/docker/boot.sh +++ b/services/resource-usage-tracker/docker/boot.sh @@ -24,7 +24,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/resource-usage-tracker - pip install uv uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" diff --git a/services/storage/docker/boot.sh b/services/storage/docker/boot.sh index e327977e6bcc..5f47389ce132 100755 --- a/services/storage/docker/boot.sh +++ b/services/storage/docker/boot.sh @@ -19,7 +19,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/storage - pip install uv uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" diff --git a/services/web/server/docker/boot.sh b/services/web/server/docker/boot.sh index 02037e508acc..78c12a5eca1d 100755 --- a/services/web/server/docker/boot.sh +++ b/services/web/server/docker/boot.sh @@ -19,7 +19,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then command -v python | sed 's/^/ /' cd services/web/server - pip install uv uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" From 6f68083b7c7d7e924dd1f60bbf5560172304b69d Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 22 Oct 2024 08:23:52 +0200 Subject: [PATCH 19/23] unify --- scripts/erd/Dockerfile | 14 +++++++++----- scripts/maintenance/migrate_project/Dockerfile | 18 ++++++++++++------ scripts/openapi/oas_resolver/Dockerfile | 17 ++++++++++------- scripts/pydeps-docker/Dockerfile | 15 ++++++++++----- 4 files changed, 41 insertions(+), 23 deletions(-) diff --git a/scripts/erd/Dockerfile b/scripts/erd/Dockerfile index 9294fa23e1d7..8289d6ab16ca 100644 --- a/scripts/erd/Dockerfile +++ b/scripts/erd/Dockerfile @@ -8,6 +8,9 @@ # ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base RUN apt-get update \ @@ -22,13 +25,14 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && apt-get clean +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=uv_build /uv /uvx /bin/ -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ - pip~=24.0 \ +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip install --upgrade \ wheel \ setuptools COPY requirements.txt . -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install -r requirements.txt +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip install -r requirements.txt diff --git a/scripts/maintenance/migrate_project/Dockerfile b/scripts/maintenance/migrate_project/Dockerfile index d4a17f9ba408..b215ed0886df 100644 --- a/scripts/maintenance/migrate_project/Dockerfile +++ b/scripts/maintenance/migrate_project/Dockerfile @@ -1,21 +1,27 @@ # syntax=docker/dockerfile:1 +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:3.11.9-buster RUN curl https://rclone.org/install.sh | bash && \ rclone --version +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=uv_build /uv /uvx /bin/ + WORKDIR /scripts COPY packages/postgres-database postgres-database -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - cd postgres-database && pip install . +RUN --mount=type=cache,target=/root/.cache/uv \ + cd postgres-database && uv pip install . COPY packages/settings-library settings-library -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - cd settings-library && pip install . +RUN --mount=type=cache,target=/root/.cache/uv \ + cd settings-library && uv pip install . COPY scripts/maintenance/migrate_project/requirements.txt /scripts/requirements.txt -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install -r /scripts/requirements.txt +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip install -r /scripts/requirements.txt COPY scripts/maintenance/migrate_project/src/*.py /scripts/ diff --git a/scripts/openapi/oas_resolver/Dockerfile b/scripts/openapi/oas_resolver/Dockerfile index 5b0d51570ae1..19ffedfdc160 100644 --- a/scripts/openapi/oas_resolver/Dockerfile +++ b/scripts/openapi/oas_resolver/Dockerfile @@ -2,6 +2,9 @@ # Usage: # docker build . -t oas_resolver # docker run -v /path/to/api:/input -v /path/to/compiled/file:/output oas_resolver /input/path/to/openapi.yaml /output/output_file.yaml +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:3.6-alpine LABEL maintainer=sanderegg @@ -11,16 +14,16 @@ VOLUME [ "/output" ] WORKDIR /src +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=uv_build /uv /uvx /bin/ + # update pip -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ - pip~=24.0 \ +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip install --upgrade \ wheel \ setuptools -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install prance && \ - pip install click &&\ - pip install openapi_spec_validator +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip install prance click openapi_spec_validator ENTRYPOINT [ "prance", "compile" , "--backend=openapi-spec-validator"] diff --git a/scripts/pydeps-docker/Dockerfile b/scripts/pydeps-docker/Dockerfile index 610fe9aa6f06..51d24208672e 100644 --- a/scripts/pydeps-docker/Dockerfile +++ b/scripts/pydeps-docker/Dockerfile @@ -9,6 +9,9 @@ # # ARG PYTHON_VERSION="3.11.9" +ARG UV_VERSION="0.4" +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build +# we docker image is built based on debian FROM python:${PYTHON_VERSION}-slim-bookworm AS base @@ -23,18 +26,20 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && apt-get clean +# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=uv_build /uv /uvx /bin/ + ARG HOME_DIR RUN mkdir -p ${HOME_DIR} COPY .pydeps ${HOME_DIR}/.pydeps -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install --upgrade \ - pip~=24.0 \ +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip install --upgrade \ wheel \ setuptools # devenv -RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ - pip install \ +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip install \ pydeps From f9c421c813fb08f71905faf39d14eeaa349f6211 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 22 Oct 2024 08:46:03 +0200 Subject: [PATCH 20/23] use uv --- services/agent/docker/entrypoint.sh | 26 ++-- services/api-server/docker/entrypoint.sh | 2 +- services/autoscaling/docker/entrypoint.sh | 2 +- services/catalog/docker/entrypoint.sh | 2 +- services/dask-sidecar/docker/entrypoint.sh | 117 ++++++++---------- services/datcore-adapter/docker/entrypoint.sh | 3 +- services/director-v2/docker/entrypoint.sh | 27 ++-- .../dynamic-scheduler/docker/entrypoint.sh | 2 +- services/dynamic-sidecar/docker/entrypoint.sh | 2 +- services/invitations/docker/entrypoint.sh | 2 +- .../docker/entrypoint.sh | 101 +++++++-------- services/payments/docker/entrypoint.sh | 2 +- .../docker/entrypoint.sh | 2 +- services/storage/docker/entrypoint.sh | 4 +- services/web/server/docker/entrypoint.sh | 2 +- 15 files changed, 135 insertions(+), 161 deletions(-) diff --git a/services/agent/docker/entrypoint.sh b/services/agent/docker/entrypoint.sh index 87f1cc84da5e..c3565d268b38 100755 --- a/services/agent/docker/entrypoint.sh +++ b/services/agent/docker/entrypoint.sh @@ -65,25 +65,23 @@ fi if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs debugpy - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi # Appends docker group if socket is mounted DOCKER_MOUNT=/var/run/docker.sock -if stat $DOCKER_MOUNT > /dev/null 2>&1 -then - echo "$INFO detected docker socket is mounted, adding user to group..." - GROUPID=$(stat --format=%g $DOCKER_MOUNT) - GROUPNAME=scdocker +if stat $DOCKER_MOUNT >/dev/null 2>&1; then + echo "$INFO detected docker socket is mounted, adding user to group..." + GROUPID=$(stat --format=%g $DOCKER_MOUNT) + GROUPNAME=scdocker - if ! addgroup --gid "$GROUPID" $GROUPNAME > /dev/null 2>&1 - then - echo "$WARNING docker group with $GROUPID already exists, getting group name..." - # if group already exists in container, then reuse name - GROUPNAME=$(getent group "${GROUPID}" | cut --delimiter=: --fields=1) - echo "$WARNING docker group with $GROUPID has name $GROUPNAME" - fi - adduser "$SC_USER_NAME" "$GROUPNAME" + if ! addgroup --gid "$GROUPID" $GROUPNAME >/dev/null 2>&1; then + echo "$WARNING docker group with $GROUPID already exists, getting group name..." + # if group already exists in container, then reuse name + GROUPNAME=$(getent group "${GROUPID}" | cut --delimiter=: --fields=1) + echo "$WARNING docker group with $GROUPID has name $GROUPNAME" + fi + adduser "$SC_USER_NAME" "$GROUPNAME" fi echo "$INFO Starting $* ..." diff --git a/services/api-server/docker/entrypoint.sh b/services/api-server/docker/entrypoint.sh index 68791d962fec..ce999219291b 100755 --- a/services/api-server/docker/entrypoint.sh +++ b/services/api-server/docker/entrypoint.sh @@ -66,7 +66,7 @@ fi if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs ptvsd - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi echo "$INFO Starting $* ..." diff --git a/services/autoscaling/docker/entrypoint.sh b/services/autoscaling/docker/entrypoint.sh index f928edbb4f5f..b01130e9ae3e 100755 --- a/services/autoscaling/docker/entrypoint.sh +++ b/services/autoscaling/docker/entrypoint.sh @@ -72,7 +72,7 @@ fi if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs debugpy - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi # Appends docker group if socket is mounted diff --git a/services/catalog/docker/entrypoint.sh b/services/catalog/docker/entrypoint.sh index 61529af46c62..699dc3da34f5 100755 --- a/services/catalog/docker/entrypoint.sh +++ b/services/catalog/docker/entrypoint.sh @@ -65,7 +65,7 @@ fi if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs ptvsd - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi echo "$INFO Starting $* ..." diff --git a/services/dask-sidecar/docker/entrypoint.sh b/services/dask-sidecar/docker/entrypoint.sh index 5c00a365b3a8..734a66b7bf71 100755 --- a/services/dask-sidecar/docker/entrypoint.sh +++ b/services/dask-sidecar/docker/entrypoint.sh @@ -22,60 +22,53 @@ update-ca-certificates # *runs* as non-root user [scu] # echo "$INFO" "Entrypoint for stage ${SC_BUILD_TARGET} ..." -echo User :"$(id "$(whoami)")" -echo Workdir :"$(pwd)" -echo scuUser :"$(id scu)" - - -if [ "${SC_BUILD_TARGET}" = "development" ] -then - echo "$INFO" "development mode detected..." - # NOTE: expects docker run ... -v $(pwd):/devel/services/dask-sidecar - DEVEL_MOUNT="/devel/services/dask-sidecar" - - stat $DEVEL_MOUNT > /dev/null 2>&1 || \ - (echo "$ERROR" "You must mount '$DEVEL_MOUNT' to deduce user and group ids" && exit 1) - - echo "setting correct user id/group id..." - HOST_USERID=$(stat --format=%u "${DEVEL_MOUNT}") - HOST_GROUPID=$(stat --format=%g "${DEVEL_MOUNT}") - CONT_GROUPNAME=$(getent group "${HOST_GROUPID}" | cut --delimiter=: --fields=1) - if [ "$HOST_USERID" -eq 0 ] - then - echo "Warning: Folder mounted owned by root user... adding $SC_USER_NAME to root..." - adduser "$SC_USER_NAME" root +echo User :"$(id "$(whoami)")" +echo Workdir :"$(pwd)" +echo scuUser :"$(id scu)" + +if [ "${SC_BUILD_TARGET}" = "development" ]; then + echo "$INFO" "development mode detected..." + # NOTE: expects docker run ... -v $(pwd):/devel/services/dask-sidecar + DEVEL_MOUNT="/devel/services/dask-sidecar" + + stat $DEVEL_MOUNT >/dev/null 2>&1 || + (echo "$ERROR" "You must mount '$DEVEL_MOUNT' to deduce user and group ids" && exit 1) + + echo "setting correct user id/group id..." + HOST_USERID=$(stat --format=%u "${DEVEL_MOUNT}") + HOST_GROUPID=$(stat --format=%g "${DEVEL_MOUNT}") + CONT_GROUPNAME=$(getent group "${HOST_GROUPID}" | cut --delimiter=: --fields=1) + if [ "$HOST_USERID" -eq 0 ]; then + echo "Warning: Folder mounted owned by root user... adding $SC_USER_NAME to root..." + adduser "$SC_USER_NAME" root + else + echo "Folder mounted owned by user $HOST_USERID:$HOST_GROUPID-'$CONT_GROUPNAME'..." + # take host's credentials in $SC_USER_NAME + if [ -z "$CONT_GROUPNAME" ]; then + echo "Creating new group my$SC_USER_NAME" + CONT_GROUPNAME=my$SC_USER_NAME + addgroup --gid "$HOST_GROUPID" "$CONT_GROUPNAME" else - echo "Folder mounted owned by user $HOST_USERID:$HOST_GROUPID-'$CONT_GROUPNAME'..." - # take host's credentials in $SC_USER_NAME - if [ -z "$CONT_GROUPNAME" ] - then - echo "Creating new group my$SC_USER_NAME" - CONT_GROUPNAME=my$SC_USER_NAME - addgroup --gid "$HOST_GROUPID" "$CONT_GROUPNAME" - else - echo "group already exists" - fi - echo "adding $SC_USER_NAME to group $CONT_GROUPNAME..." - adduser "$SC_USER_NAME" "$CONT_GROUPNAME" - - echo "changing $SC_USER_NAME:$SC_USER_NAME ($SC_USER_ID:$SC_USER_ID) to $SC_USER_NAME:$CONT_GROUPNAME ($HOST_USERID:$HOST_GROUPID)" - usermod --uid "$HOST_USERID" --gid "$HOST_GROUPID" "$SC_USER_NAME" - - echo "Changing group properties of files around from $SC_USER_ID to group $CONT_GROUPNAME" - find / -path /proc -prune -o -group "$SC_USER_ID" -exec chgrp --no-dereference "$CONT_GROUPNAME" {} \; - # change user property of files already around - echo "Changing ownership properties of files around from $SC_USER_ID to group $CONT_GROUPNAME" - find / -path /proc -prune -o -user "$SC_USER_ID" -exec chown --no-dereference "$SC_USER_NAME" {} \; + echo "group already exists" fi -fi + echo "adding $SC_USER_NAME to group $CONT_GROUPNAME..." + adduser "$SC_USER_NAME" "$CONT_GROUPNAME" + echo "changing $SC_USER_NAME:$SC_USER_NAME ($SC_USER_ID:$SC_USER_ID) to $SC_USER_NAME:$CONT_GROUPNAME ($HOST_USERID:$HOST_GROUPID)" + usermod --uid "$HOST_USERID" --gid "$HOST_GROUPID" "$SC_USER_NAME" -if [ "${SC_BOOT_MODE}" = "debug" ] -then - # NOTE: production does NOT pre-installs debugpy - pip install --no-cache-dir debugpy + echo "Changing group properties of files around from $SC_USER_ID to group $CONT_GROUPNAME" + find / -path /proc -prune -o -group "$SC_USER_ID" -exec chgrp --no-dereference "$CONT_GROUPNAME" {} \; + # change user property of files already around + echo "Changing ownership properties of files around from $SC_USER_ID to group $CONT_GROUPNAME" + find / -path /proc -prune -o -user "$SC_USER_ID" -exec chown --no-dereference "$SC_USER_NAME" {} \; + fi fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi if [ ${DASK_START_AS_SCHEDULER+x} ]; then @@ -83,32 +76,28 @@ if [ ${DASK_START_AS_SCHEDULER+x} ]; then echo " $SC_USER_NAME rights : $(id "$SC_USER_NAME")" echo " local dir : $(ls -al)" - else # Appends docker group if socket is mounted DOCKER_MOUNT=/var/run/docker.sock - if stat $DOCKER_MOUNT > /dev/null 2>&1 - then - echo "$INFO detected docker socket is mounted, adding user to group..." - GROUPID=$(stat --format=%g $DOCKER_MOUNT) - GROUPNAME=scdocker - - if ! addgroup --gid "$GROUPID" $GROUPNAME > /dev/null 2>&1 - then - echo "$WARNING docker group with $GROUPID already exists, getting group name..." - # if group already exists in container, then reuse name - GROUPNAME=$(getent group "${GROUPID}" | cut --delimiter=: --fields=1) - echo "$WARNING docker group with $GROUPID has name $GROUPNAME" - fi - adduser "$SC_USER_NAME" "$GROUPNAME" + if stat $DOCKER_MOUNT >/dev/null 2>&1; then + echo "$INFO detected docker socket is mounted, adding user to group..." + GROUPID=$(stat --format=%g $DOCKER_MOUNT) + GROUPNAME=scdocker + + if ! addgroup --gid "$GROUPID" $GROUPNAME >/dev/null 2>&1; then + echo "$WARNING docker group with $GROUPID already exists, getting group name..." + # if group already exists in container, then reuse name + GROUPNAME=$(getent group "${GROUPID}" | cut --delimiter=: --fields=1) + echo "$WARNING docker group with $GROUPID has name $GROUPNAME" + fi + adduser "$SC_USER_NAME" "$GROUPNAME" fi echo "$INFO ensuring write rights on computational shared folder ..." mkdir --parents "${SIDECAR_COMP_SERVICES_SHARED_FOLDER}" chown --recursive "$SC_USER_NAME":"$GROUPNAME" "${SIDECAR_COMP_SERVICES_SHARED_FOLDER}" - echo "$INFO Starting $* as WORKER ..." echo " $SC_USER_NAME rights : $(id "$SC_USER_NAME")" echo " local dir : $(ls -al)" diff --git a/services/datcore-adapter/docker/entrypoint.sh b/services/datcore-adapter/docker/entrypoint.sh index 3ac31b9b8153..bdae80016c1c 100755 --- a/services/datcore-adapter/docker/entrypoint.sh +++ b/services/datcore-adapter/docker/entrypoint.sh @@ -20,7 +20,6 @@ echo "$INFO" "User : $(id scu)" echo "$INFO" "python : $(command -v python)" echo "$INFO" "pip : $(command -v pip)" - # # DEVELOPMENT MODE # - expects docker run ... -v $(pwd):$SC_DEVEL_MOUNT @@ -66,7 +65,7 @@ fi if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs debugpy - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi echo "$INFO Starting $* ..." diff --git a/services/director-v2/docker/entrypoint.sh b/services/director-v2/docker/entrypoint.sh index 57b0d0ac2ff3..f888f1a36f69 100755 --- a/services/director-v2/docker/entrypoint.sh +++ b/services/director-v2/docker/entrypoint.sh @@ -27,7 +27,6 @@ echo "$INFO" "User : $(id scu)" echo "$INFO" "python : $(command -v python)" echo "$INFO" "pip : $(command -v pip)" - # # DEVELOPMENT MODE # - expects docker run ... -v $(pwd):$SC_DEVEL_MOUNT @@ -73,25 +72,23 @@ fi if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs debugpy - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi # Appends docker group if socket is mounted DOCKER_MOUNT=/var/run/docker.sock -if stat $DOCKER_MOUNT > /dev/null 2>&1 -then - echo "$INFO detected docker socket is mounted, adding user to group..." - GROUPID=$(stat --format=%g $DOCKER_MOUNT) - GROUPNAME=scdocker +if stat $DOCKER_MOUNT >/dev/null 2>&1; then + echo "$INFO detected docker socket is mounted, adding user to group..." + GROUPID=$(stat --format=%g $DOCKER_MOUNT) + GROUPNAME=scdocker - if ! addgroup --gid "$GROUPID" $GROUPNAME > /dev/null 2>&1 - then - echo "$WARNING docker group with $GROUPID already exists, getting group name..." - # if group already exists in container, then reuse name - GROUPNAME=$(getent group "${GROUPID}" | cut --delimiter=: --fields=1) - echo "$WARNING docker group with $GROUPID has name $GROUPNAME" - fi - adduser "$SC_USER_NAME" "$GROUPNAME" + if ! addgroup --gid "$GROUPID" $GROUPNAME >/dev/null 2>&1; then + echo "$WARNING docker group with $GROUPID already exists, getting group name..." + # if group already exists in container, then reuse name + GROUPNAME=$(getent group "${GROUPID}" | cut --delimiter=: --fields=1) + echo "$WARNING docker group with $GROUPID has name $GROUPNAME" + fi + adduser "$SC_USER_NAME" "$GROUPNAME" fi echo "$INFO Starting $* ..." diff --git a/services/dynamic-scheduler/docker/entrypoint.sh b/services/dynamic-scheduler/docker/entrypoint.sh index 908e8f9e64b8..bdae80016c1c 100755 --- a/services/dynamic-scheduler/docker/entrypoint.sh +++ b/services/dynamic-scheduler/docker/entrypoint.sh @@ -65,7 +65,7 @@ fi if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs debugpy - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi echo "$INFO Starting $* ..." diff --git a/services/dynamic-sidecar/docker/entrypoint.sh b/services/dynamic-sidecar/docker/entrypoint.sh index e326c25825b1..b1690472184c 100755 --- a/services/dynamic-sidecar/docker/entrypoint.sh +++ b/services/dynamic-sidecar/docker/entrypoint.sh @@ -76,7 +76,7 @@ fi if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs debugpy - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi # Appends docker group if socket is mounted diff --git a/services/invitations/docker/entrypoint.sh b/services/invitations/docker/entrypoint.sh index 908e8f9e64b8..bdae80016c1c 100755 --- a/services/invitations/docker/entrypoint.sh +++ b/services/invitations/docker/entrypoint.sh @@ -65,7 +65,7 @@ fi if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs debugpy - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi echo "$INFO Starting $* ..." diff --git a/services/osparc-gateway-server/docker/entrypoint.sh b/services/osparc-gateway-server/docker/entrypoint.sh index 91204dd9b606..f4ee91195ec7 100755 --- a/services/osparc-gateway-server/docker/entrypoint.sh +++ b/services/osparc-gateway-server/docker/entrypoint.sh @@ -15,74 +15,67 @@ ERROR="ERROR: [$(basename "$0")] " # *runs* as non-root user [scu] # echo "$INFO" "Entrypoint for stage ${SC_BUILD_TARGET} ..." -echo User :"$(id "$(whoami)")" -echo Workdir :"$(pwd)" -echo scuUser :"$(id scu)" +echo User :"$(id "$(whoami)")" +echo Workdir :"$(pwd)" +echo scuUser :"$(id scu)" +if [ "${SC_BUILD_TARGET}" = "development" ]; then + echo "$INFO" "development mode detected..." + # NOTE: expects docker run ... -v $(pwd):/devel/services/osparc-gateway-server + DEVEL_MOUNT=${DEVEL_MOUNT:="/devel/services/osparc-gateway-server"} -if [ "${SC_BUILD_TARGET}" = "development" ] -then - echo "$INFO" "development mode detected..." - # NOTE: expects docker run ... -v $(pwd):/devel/services/osparc-gateway-server - DEVEL_MOUNT=${DEVEL_MOUNT:="/devel/services/osparc-gateway-server"} + stat $DEVEL_MOUNT >/dev/null 2>&1 || + (echo "$ERROR" "You must mount '$DEVEL_MOUNT' to deduce user and group ids" && exit 1) - stat $DEVEL_MOUNT > /dev/null 2>&1 || \ - (echo "$ERROR" "You must mount '$DEVEL_MOUNT' to deduce user and group ids" && exit 1) - - echo "setting correct user id/group id..." - HOST_USERID=$(stat --format=%u "${DEVEL_MOUNT}") - HOST_GROUPID=$(stat --format=%g "${DEVEL_MOUNT}") - CONT_GROUPNAME=$(getent group "${HOST_GROUPID}" | cut --delimiter=: --fields=1) - if [ "$HOST_USERID" -eq 0 ] - then - echo "Warning: Folder mounted owned by root user... adding $SC_USER_NAME to root..." - adduser "$SC_USER_NAME" root + echo "setting correct user id/group id..." + HOST_USERID=$(stat --format=%u "${DEVEL_MOUNT}") + HOST_GROUPID=$(stat --format=%g "${DEVEL_MOUNT}") + CONT_GROUPNAME=$(getent group "${HOST_GROUPID}" | cut --delimiter=: --fields=1) + if [ "$HOST_USERID" -eq 0 ]; then + echo "Warning: Folder mounted owned by root user... adding $SC_USER_NAME to root..." + adduser "$SC_USER_NAME" root + else + echo "Folder mounted owned by user $HOST_USERID:$HOST_GROUPID-'$CONT_GROUPNAME'..." + # take host's credentials in $SC_USER_NAME + if [ -z "$CONT_GROUPNAME" ]; then + echo "Creating new group my$SC_USER_NAME" + CONT_GROUPNAME=my$SC_USER_NAME + addgroup --gid "$HOST_GROUPID" "$CONT_GROUPNAME" else - echo "Folder mounted owned by user $HOST_USERID:$HOST_GROUPID-'$CONT_GROUPNAME'..." - # take host's credentials in $SC_USER_NAME - if [ -z "$CONT_GROUPNAME" ] - then - echo "Creating new group my$SC_USER_NAME" - CONT_GROUPNAME=my$SC_USER_NAME - addgroup --gid "$HOST_GROUPID" "$CONT_GROUPNAME" - else - echo "group already exists" - fi - echo "adding $SC_USER_NAME to group $CONT_GROUPNAME..." - adduser "$SC_USER_NAME" "$CONT_GROUPNAME" + echo "group already exists" + fi + echo "adding $SC_USER_NAME to group $CONT_GROUPNAME..." + adduser "$SC_USER_NAME" "$CONT_GROUPNAME" - echo "changing $SC_USER_NAME:$SC_USER_NAME ($SC_USER_ID:$SC_USER_ID) to $SC_USER_NAME:$CONT_GROUPNAME ($HOST_USERID:$HOST_GROUPID)" - usermod --uid "$HOST_USERID" --gid "$HOST_GROUPID" "$SC_USER_NAME" + echo "changing $SC_USER_NAME:$SC_USER_NAME ($SC_USER_ID:$SC_USER_ID) to $SC_USER_NAME:$CONT_GROUPNAME ($HOST_USERID:$HOST_GROUPID)" + usermod --uid "$HOST_USERID" --gid "$HOST_GROUPID" "$SC_USER_NAME" - echo "Changing group properties of files around from $SC_USER_ID to group $CONT_GROUPNAME" - find / -path /proc -prune -o -group "$SC_USER_ID" -exec chgrp --no-dereference "$CONT_GROUPNAME" {} \; - # change user property of files already around - echo "Changing ownership properties of files around from $SC_USER_ID to group $CONT_GROUPNAME" - find / -path /proc -prune -o -user "$SC_USER_ID" -exec chown --no-dereference "$SC_USER_NAME" {} \; - fi + echo "Changing group properties of files around from $SC_USER_ID to group $CONT_GROUPNAME" + find / -path /proc -prune -o -group "$SC_USER_ID" -exec chgrp --no-dereference "$CONT_GROUPNAME" {} \; + # change user property of files already around + echo "Changing ownership properties of files around from $SC_USER_ID to group $CONT_GROUPNAME" + find / -path /proc -prune -o -user "$SC_USER_ID" -exec chown --no-dereference "$SC_USER_NAME" {} \; + fi fi - -if [ "${SC_BOOT_MODE}" = "debug" ] -then +if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs debugpy - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi DOCKER_MOUNT=/var/run/docker.sock if stat $DOCKER_MOUNT >/dev/null 2>&1; then - echo "$INFO detected docker socket is mounted, adding user to group..." - GROUPID=$(stat --format=%g $DOCKER_MOUNT) - GROUPNAME=scdocker + echo "$INFO detected docker socket is mounted, adding user to group..." + GROUPID=$(stat --format=%g $DOCKER_MOUNT) + GROUPNAME=scdocker - if ! addgroup --gid "$GROUPID" $GROUPNAME > /dev/null 2>&1 - then - echo "$WARNING docker group with $GROUPID already exists, getting group name..." - # if group already exists in container, then reuse name - GROUPNAME=$(getent group "${GROUPID}" | cut --delimiter=: --fields=1) - echo "$WARNING docker group with $GROUPID has name $GROUPNAME" - fi - adduser "$SC_USER_NAME" "$GROUPNAME" + if ! addgroup --gid "$GROUPID" $GROUPNAME >/dev/null 2>&1; then + echo "$WARNING docker group with $GROUPID already exists, getting group name..." + # if group already exists in container, then reuse name + GROUPNAME=$(getent group "${GROUPID}" | cut --delimiter=: --fields=1) + echo "$WARNING docker group with $GROUPID has name $GROUPNAME" + fi + adduser "$SC_USER_NAME" "$GROUPNAME" fi echo "$INFO Starting osparc-gateway-server ..." diff --git a/services/payments/docker/entrypoint.sh b/services/payments/docker/entrypoint.sh index 908e8f9e64b8..bdae80016c1c 100755 --- a/services/payments/docker/entrypoint.sh +++ b/services/payments/docker/entrypoint.sh @@ -65,7 +65,7 @@ fi if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs debugpy - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi echo "$INFO Starting $* ..." diff --git a/services/resource-usage-tracker/docker/entrypoint.sh b/services/resource-usage-tracker/docker/entrypoint.sh index a1a8c1600325..c3565d268b38 100755 --- a/services/resource-usage-tracker/docker/entrypoint.sh +++ b/services/resource-usage-tracker/docker/entrypoint.sh @@ -65,7 +65,7 @@ fi if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs debugpy - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi # Appends docker group if socket is mounted diff --git a/services/storage/docker/entrypoint.sh b/services/storage/docker/entrypoint.sh index 076dd425e67f..359575ae70e6 100755 --- a/services/storage/docker/entrypoint.sh +++ b/services/storage/docker/entrypoint.sh @@ -15,7 +15,6 @@ ERROR="ERROR: [$(basename "$0")] " # It needs to be executed as root. update-ca-certificates - # This entrypoint script: # # - Executes *inside* of the container upon start as --user [default root] @@ -29,7 +28,6 @@ echo "$INFO" "User : $(id scu)" echo "$INFO" "python : $(command -v python)" echo "$INFO" "pip : $(command -v pip)" - if [ "${SC_BUILD_TARGET}" = "development" ]; then echo "$INFO" "development mode detected..." # NOTE: expects docker run ... -v $(pwd):$DEVEL_MOUNT @@ -72,7 +70,7 @@ fi if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs debugpy - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi echo "$INFO Starting $* ..." diff --git a/services/web/server/docker/entrypoint.sh b/services/web/server/docker/entrypoint.sh index d488a0ef2c7b..6f4facc747ef 100755 --- a/services/web/server/docker/entrypoint.sh +++ b/services/web/server/docker/entrypoint.sh @@ -73,7 +73,7 @@ fi if [ "${SC_BOOT_MODE}" = "debug" ]; then # NOTE: production does NOT pre-installs debugpy - pip install --no-cache-dir debugpy + uv pip install --no-cache-dir debugpy fi echo "$INFO Starting $* ..." From 836b69752b240c5021d6f49ad60adf84681efaf6 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 22 Oct 2024 08:46:41 +0200 Subject: [PATCH 21/23] unify --- services/agent/docker/boot.sh | 2 +- services/api-server/docker/boot.sh | 2 +- services/catalog/docker/boot.sh | 2 +- services/clusters-keeper/docker/boot.sh | 2 +- services/dask-sidecar/docker/boot.sh | 2 +- services/datcore-adapter/docker/boot.sh | 2 +- services/director-v2/docker/boot.sh | 2 +- services/dynamic-scheduler/docker/boot.sh | 2 +- services/efs-guardian/docker/boot.sh | 2 +- services/invitations/docker/boot.sh | 2 +- services/payments/docker/boot.sh | 2 +- services/resource-usage-tracker/docker/boot.sh | 2 +- services/storage/docker/boot.sh | 2 +- services/web/server/docker/boot.sh | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/services/agent/docker/boot.sh b/services/agent/docker/boot.sh index bbe20bdf8ef2..9ec1df7b4bec 100755 --- a/services/agent/docker/boot.sh +++ b/services/agent/docker/boot.sh @@ -27,7 +27,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + uv pip list fi # diff --git a/services/api-server/docker/boot.sh b/services/api-server/docker/boot.sh index 80452df1e03e..21b7970adb7e 100755 --- a/services/api-server/docker/boot.sh +++ b/services/api-server/docker/boot.sh @@ -22,7 +22,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + uv pip list fi # RUNNING application ---------------------------------------- diff --git a/services/catalog/docker/boot.sh b/services/catalog/docker/boot.sh index f71fd2a0c854..d6c6958cd221 100755 --- a/services/catalog/docker/boot.sh +++ b/services/catalog/docker/boot.sh @@ -22,7 +22,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + uv pip list fi # RUNNING application ---------------------------------------- diff --git a/services/clusters-keeper/docker/boot.sh b/services/clusters-keeper/docker/boot.sh index 8b86edc15542..79969f26d6e4 100755 --- a/services/clusters-keeper/docker/boot.sh +++ b/services/clusters-keeper/docker/boot.sh @@ -27,7 +27,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + uv pip list fi # diff --git a/services/dask-sidecar/docker/boot.sh b/services/dask-sidecar/docker/boot.sh index 88e7cdf9d743..b4977f38b0d7 100755 --- a/services/dask-sidecar/docker/boot.sh +++ b/services/dask-sidecar/docker/boot.sh @@ -28,7 +28,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip sync --quiet --no-cache-dir requirements/dev.txt cd - print_info "PIP :" - uv pip list | sed 's/^/ /' + uv pip list fi # RUNNING application ---------------------------------------- diff --git a/services/datcore-adapter/docker/boot.sh b/services/datcore-adapter/docker/boot.sh index 63682660492a..378089678e18 100755 --- a/services/datcore-adapter/docker/boot.sh +++ b/services/datcore-adapter/docker/boot.sh @@ -27,7 +27,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + uv pip list fi # RUNNING application ---------------------------------------- diff --git a/services/director-v2/docker/boot.sh b/services/director-v2/docker/boot.sh index 74efe795a987..809596b62998 100755 --- a/services/director-v2/docker/boot.sh +++ b/services/director-v2/docker/boot.sh @@ -27,7 +27,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + uv pip list fi # diff --git a/services/dynamic-scheduler/docker/boot.sh b/services/dynamic-scheduler/docker/boot.sh index d68e3aab6ddf..cca71b186d65 100755 --- a/services/dynamic-scheduler/docker/boot.sh +++ b/services/dynamic-scheduler/docker/boot.sh @@ -27,7 +27,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + uv pip list fi # diff --git a/services/efs-guardian/docker/boot.sh b/services/efs-guardian/docker/boot.sh index e0f3be8059ee..69f4d867f771 100755 --- a/services/efs-guardian/docker/boot.sh +++ b/services/efs-guardian/docker/boot.sh @@ -27,7 +27,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + uv pip list fi # diff --git a/services/invitations/docker/boot.sh b/services/invitations/docker/boot.sh index 2a192344db0d..6a67900c2476 100755 --- a/services/invitations/docker/boot.sh +++ b/services/invitations/docker/boot.sh @@ -27,7 +27,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + uv pip list fi # diff --git a/services/payments/docker/boot.sh b/services/payments/docker/boot.sh index b223b0991404..9cd6607425f3 100755 --- a/services/payments/docker/boot.sh +++ b/services/payments/docker/boot.sh @@ -27,7 +27,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + uv pip list fi # diff --git a/services/resource-usage-tracker/docker/boot.sh b/services/resource-usage-tracker/docker/boot.sh index 9e6d99480695..482eb8d5a7ef 100755 --- a/services/resource-usage-tracker/docker/boot.sh +++ b/services/resource-usage-tracker/docker/boot.sh @@ -27,7 +27,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + uv pip list fi # diff --git a/services/storage/docker/boot.sh b/services/storage/docker/boot.sh index 5f47389ce132..c76e98a411ce 100755 --- a/services/storage/docker/boot.sh +++ b/services/storage/docker/boot.sh @@ -22,7 +22,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + uv pip list echo "$INFO" "Setting entrypoint to use watchmedo autorestart..." entrypoint='watchmedo auto-restart --recursive --pattern="*.py;*/src/*" --ignore-patterns="*test*;pytest_simcore/*;setup.py;*ignore*" --ignore-directories --' diff --git a/services/web/server/docker/boot.sh b/services/web/server/docker/boot.sh index 78c12a5eca1d..e4a72d041ada 100755 --- a/services/web/server/docker/boot.sh +++ b/services/web/server/docker/boot.sh @@ -22,7 +22,7 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip --quiet --no-cache-dir sync requirements/dev.txt cd - echo "$INFO" "PIP :" - uv pip list | sed 's/^/ /' + uv pip list APP_CONFIG=server-docker-dev.yaml elif [ "${SC_BUILD_TARGET}" = "production" ]; then From 78a70c2663d76c8adc5c9701dff1a8784972cf6f Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 22 Oct 2024 08:53:59 +0200 Subject: [PATCH 22/23] moved installation of debugpy to boot script --- services/agent/docker/boot.sh | 5 +++++ services/agent/docker/entrypoint.sh | 5 ----- services/api-server/docker/boot.sh | 5 +++++ services/api-server/docker/entrypoint.sh | 5 ----- services/autoscaling/docker/boot.sh | 5 +++++ services/autoscaling/docker/entrypoint.sh | 5 ----- services/catalog/docker/boot.sh | 5 +++++ services/catalog/docker/entrypoint.sh | 5 ----- services/clusters-keeper/docker/boot.sh | 5 +++++ services/dask-sidecar/docker/boot.sh | 5 +++++ services/dask-sidecar/docker/entrypoint.sh | 5 ----- services/datcore-adapter/docker/boot.sh | 5 +++++ services/datcore-adapter/docker/entrypoint.sh | 5 ----- services/director-v2/docker/boot.sh | 5 +++++ services/director-v2/docker/entrypoint.sh | 5 ----- services/dynamic-scheduler/docker/boot.sh | 5 +++++ .../dynamic-scheduler/docker/entrypoint.sh | 5 ----- services/dynamic-sidecar/docker/boot.sh | 5 +++++ services/dynamic-sidecar/docker/entrypoint.sh | 5 ----- services/efs-guardian/docker/boot.sh | 5 +++++ services/invitations/docker/boot.sh | 5 +++++ services/invitations/docker/entrypoint.sh | 5 ----- services/osparc-gateway-server/docker/boot.sh | 19 ++++++++++++------- .../docker/entrypoint.sh | 5 ----- services/payments/docker/boot.sh | 5 +++++ services/payments/docker/entrypoint.sh | 5 ----- .../resource-usage-tracker/docker/boot.sh | 5 +++++ .../docker/entrypoint.sh | 5 ----- services/storage/docker/boot.sh | 5 +++++ services/storage/docker/entrypoint.sh | 5 ----- services/web/server/docker/boot.sh | 5 +++++ services/web/server/docker/entrypoint.sh | 5 ----- 32 files changed, 92 insertions(+), 82 deletions(-) diff --git a/services/agent/docker/boot.sh b/services/agent/docker/boot.sh index 9ec1df7b4bec..259e1f54e710 100755 --- a/services/agent/docker/boot.sh +++ b/services/agent/docker/boot.sh @@ -30,6 +30,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip list fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # # RUNNING application # diff --git a/services/agent/docker/entrypoint.sh b/services/agent/docker/entrypoint.sh index c3565d268b38..e89ad5408a31 100755 --- a/services/agent/docker/entrypoint.sh +++ b/services/agent/docker/entrypoint.sh @@ -63,11 +63,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs debugpy - uv pip install --no-cache-dir debugpy -fi - # Appends docker group if socket is mounted DOCKER_MOUNT=/var/run/docker.sock if stat $DOCKER_MOUNT >/dev/null 2>&1; then diff --git a/services/api-server/docker/boot.sh b/services/api-server/docker/boot.sh index 21b7970adb7e..383228831200 100755 --- a/services/api-server/docker/boot.sh +++ b/services/api-server/docker/boot.sh @@ -25,6 +25,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip list fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # RUNNING application ---------------------------------------- APP_LOG_LEVEL=${API_SERVER_LOGLEVEL:-${LOG_LEVEL:-${LOGLEVEL:-INFO}}} SERVER_LOG_LEVEL=$(echo "${APP_LOG_LEVEL}" | tr '[:upper:]' '[:lower:]') diff --git a/services/api-server/docker/entrypoint.sh b/services/api-server/docker/entrypoint.sh index ce999219291b..b579236b5623 100755 --- a/services/api-server/docker/entrypoint.sh +++ b/services/api-server/docker/entrypoint.sh @@ -64,11 +64,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs ptvsd - uv pip install --no-cache-dir debugpy -fi - echo "$INFO Starting $* ..." echo " $SC_USER_NAME rights : $(id "$SC_USER_NAME")" echo " local dir : $(ls -al)" diff --git a/services/autoscaling/docker/boot.sh b/services/autoscaling/docker/boot.sh index 379c88ebbe35..8fe0488daed2 100755 --- a/services/autoscaling/docker/boot.sh +++ b/services/autoscaling/docker/boot.sh @@ -29,6 +29,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip list fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # # RUNNING application # diff --git a/services/autoscaling/docker/entrypoint.sh b/services/autoscaling/docker/entrypoint.sh index b01130e9ae3e..ad982fd8d5cc 100755 --- a/services/autoscaling/docker/entrypoint.sh +++ b/services/autoscaling/docker/entrypoint.sh @@ -70,11 +70,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs debugpy - uv pip install --no-cache-dir debugpy -fi - # Appends docker group if socket is mounted DOCKER_MOUNT=/var/run/docker.sock if stat $DOCKER_MOUNT >/dev/null 2>&1; then diff --git a/services/catalog/docker/boot.sh b/services/catalog/docker/boot.sh index d6c6958cd221..f7f01aec46ee 100755 --- a/services/catalog/docker/boot.sh +++ b/services/catalog/docker/boot.sh @@ -25,6 +25,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip list fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # RUNNING application ---------------------------------------- APP_LOG_LEVEL=${CATALOG_LOGLEVEL:-${LOG_LEVEL:-${LOGLEVEL:-INFO}}} SERVER_LOG_LEVEL=$(echo "${APP_LOG_LEVEL}" | tr '[:upper:]' '[:lower:]') diff --git a/services/catalog/docker/entrypoint.sh b/services/catalog/docker/entrypoint.sh index 699dc3da34f5..63e9249be312 100755 --- a/services/catalog/docker/entrypoint.sh +++ b/services/catalog/docker/entrypoint.sh @@ -63,11 +63,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs ptvsd - uv pip install --no-cache-dir debugpy -fi - echo "$INFO Starting $* ..." echo " $SC_USER_NAME rights : $(id "$SC_USER_NAME")" echo " local dir : $(ls -al)" diff --git a/services/clusters-keeper/docker/boot.sh b/services/clusters-keeper/docker/boot.sh index 79969f26d6e4..5aa4b0e8e1c2 100755 --- a/services/clusters-keeper/docker/boot.sh +++ b/services/clusters-keeper/docker/boot.sh @@ -30,6 +30,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip list fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # # RUNNING application # diff --git a/services/dask-sidecar/docker/boot.sh b/services/dask-sidecar/docker/boot.sh index b4977f38b0d7..2cfdbf349d76 100755 --- a/services/dask-sidecar/docker/boot.sh +++ b/services/dask-sidecar/docker/boot.sh @@ -31,6 +31,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip list fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # RUNNING application ---------------------------------------- # # - If DASK_START_AS_SCHEDULER is set, then it boots as scheduler otherwise as worker diff --git a/services/dask-sidecar/docker/entrypoint.sh b/services/dask-sidecar/docker/entrypoint.sh index 734a66b7bf71..f69fd1a71d86 100755 --- a/services/dask-sidecar/docker/entrypoint.sh +++ b/services/dask-sidecar/docker/entrypoint.sh @@ -65,11 +65,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs debugpy - uv pip install --no-cache-dir debugpy -fi - if [ ${DASK_START_AS_SCHEDULER+x} ]; then echo "$INFO Starting $* as SCHEDULER ..." diff --git a/services/datcore-adapter/docker/boot.sh b/services/datcore-adapter/docker/boot.sh index 378089678e18..74f8d84a7aa4 100755 --- a/services/datcore-adapter/docker/boot.sh +++ b/services/datcore-adapter/docker/boot.sh @@ -30,6 +30,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip list fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # RUNNING application ---------------------------------------- APP_LOG_LEVEL=${DATCORE_ADAPTER_LOGLEVEL:-${LOG_LEVEL:-${LOGLEVEL:-INFO}}} SERVER_LOG_LEVEL=$(echo "${APP_LOG_LEVEL}" | tr '[:upper:]' '[:lower:]') diff --git a/services/datcore-adapter/docker/entrypoint.sh b/services/datcore-adapter/docker/entrypoint.sh index bdae80016c1c..25153a6b2a2a 100755 --- a/services/datcore-adapter/docker/entrypoint.sh +++ b/services/datcore-adapter/docker/entrypoint.sh @@ -63,11 +63,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs debugpy - uv pip install --no-cache-dir debugpy -fi - echo "$INFO Starting $* ..." echo " $SC_USER_NAME rights : $(id "$SC_USER_NAME")" echo " local dir : $(ls -al)" diff --git a/services/director-v2/docker/boot.sh b/services/director-v2/docker/boot.sh index 809596b62998..a96161d9660e 100755 --- a/services/director-v2/docker/boot.sh +++ b/services/director-v2/docker/boot.sh @@ -30,6 +30,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip list fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # # RUNNING application # diff --git a/services/director-v2/docker/entrypoint.sh b/services/director-v2/docker/entrypoint.sh index f888f1a36f69..42995c6ae780 100755 --- a/services/director-v2/docker/entrypoint.sh +++ b/services/director-v2/docker/entrypoint.sh @@ -70,11 +70,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs debugpy - uv pip install --no-cache-dir debugpy -fi - # Appends docker group if socket is mounted DOCKER_MOUNT=/var/run/docker.sock if stat $DOCKER_MOUNT >/dev/null 2>&1; then diff --git a/services/dynamic-scheduler/docker/boot.sh b/services/dynamic-scheduler/docker/boot.sh index cca71b186d65..0660b8c8cc0b 100755 --- a/services/dynamic-scheduler/docker/boot.sh +++ b/services/dynamic-scheduler/docker/boot.sh @@ -30,6 +30,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip list fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # # RUNNING application # diff --git a/services/dynamic-scheduler/docker/entrypoint.sh b/services/dynamic-scheduler/docker/entrypoint.sh index bdae80016c1c..25153a6b2a2a 100755 --- a/services/dynamic-scheduler/docker/entrypoint.sh +++ b/services/dynamic-scheduler/docker/entrypoint.sh @@ -63,11 +63,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs debugpy - uv pip install --no-cache-dir debugpy -fi - echo "$INFO Starting $* ..." echo " $SC_USER_NAME rights : $(id "$SC_USER_NAME")" echo " local dir : $(ls -al)" diff --git a/services/dynamic-sidecar/docker/boot.sh b/services/dynamic-sidecar/docker/boot.sh index a15772d0ab53..d21e87cb070e 100755 --- a/services/dynamic-sidecar/docker/boot.sh +++ b/services/dynamic-sidecar/docker/boot.sh @@ -31,6 +31,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then pip list | sed 's/^/ /' fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # # RUNNING application # diff --git a/services/dynamic-sidecar/docker/entrypoint.sh b/services/dynamic-sidecar/docker/entrypoint.sh index b1690472184c..9ccf61d8f671 100755 --- a/services/dynamic-sidecar/docker/entrypoint.sh +++ b/services/dynamic-sidecar/docker/entrypoint.sh @@ -74,11 +74,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs debugpy - uv pip install --no-cache-dir debugpy -fi - # Appends docker group if socket is mounted DOCKER_MOUNT=/var/run/docker.sock if stat $DOCKER_MOUNT >/dev/null 2>&1; then diff --git a/services/efs-guardian/docker/boot.sh b/services/efs-guardian/docker/boot.sh index 69f4d867f771..0575c7679fbc 100755 --- a/services/efs-guardian/docker/boot.sh +++ b/services/efs-guardian/docker/boot.sh @@ -30,6 +30,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip list fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # # RUNNING application # diff --git a/services/invitations/docker/boot.sh b/services/invitations/docker/boot.sh index 6a67900c2476..7e7714398713 100755 --- a/services/invitations/docker/boot.sh +++ b/services/invitations/docker/boot.sh @@ -30,6 +30,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip list fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # # RUNNING application # diff --git a/services/invitations/docker/entrypoint.sh b/services/invitations/docker/entrypoint.sh index bdae80016c1c..25153a6b2a2a 100755 --- a/services/invitations/docker/entrypoint.sh +++ b/services/invitations/docker/entrypoint.sh @@ -63,11 +63,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs debugpy - uv pip install --no-cache-dir debugpy -fi - echo "$INFO Starting $* ..." echo " $SC_USER_NAME rights : $(id "$SC_USER_NAME")" echo " local dir : $(ls -al)" diff --git a/services/osparc-gateway-server/docker/boot.sh b/services/osparc-gateway-server/docker/boot.sh index 8f8669cec0be..d2b912eb3baa 100755 --- a/services/osparc-gateway-server/docker/boot.sh +++ b/services/osparc-gateway-server/docker/boot.sh @@ -25,15 +25,20 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then pip list | sed 's/^/ /' fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + if [ "${SC_BOOT_MODE}" = "debug" ]; then exec python -m debugpy --listen 0.0.0.0:"${OSPARC_GATEWAY_SERVER_DEBUGGING_PORT}" -m watchmedo auto-restart \ - --recursive \ - --pattern="*.py;*/src/*" \ - --ignore-patterns="*test*;pytest_simcore/*;setup.py;*ignore*" \ - --ignore-directories -- \ - osparc-gateway-server \ - --config "${GATEWAY_SERVER_CONFIG_FILE_CONTAINER}" \ - --debug + --recursive \ + --pattern="*.py;*/src/*" \ + --ignore-patterns="*test*;pytest_simcore/*;setup.py;*ignore*" \ + --ignore-directories -- \ + osparc-gateway-server \ + --config "${GATEWAY_SERVER_CONFIG_FILE_CONTAINER}" \ + --debug else exec osparc-gateway-server \ --config "${GATEWAY_SERVER_CONFIG_FILE_CONTAINER}" diff --git a/services/osparc-gateway-server/docker/entrypoint.sh b/services/osparc-gateway-server/docker/entrypoint.sh index f4ee91195ec7..cd8eb9a01ef1 100755 --- a/services/osparc-gateway-server/docker/entrypoint.sh +++ b/services/osparc-gateway-server/docker/entrypoint.sh @@ -58,11 +58,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs debugpy - uv pip install --no-cache-dir debugpy -fi - DOCKER_MOUNT=/var/run/docker.sock if stat $DOCKER_MOUNT >/dev/null 2>&1; then echo "$INFO detected docker socket is mounted, adding user to group..." diff --git a/services/payments/docker/boot.sh b/services/payments/docker/boot.sh index 9cd6607425f3..be92e7ac4fc0 100755 --- a/services/payments/docker/boot.sh +++ b/services/payments/docker/boot.sh @@ -30,6 +30,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip list fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # # RUNNING application # diff --git a/services/payments/docker/entrypoint.sh b/services/payments/docker/entrypoint.sh index bdae80016c1c..25153a6b2a2a 100755 --- a/services/payments/docker/entrypoint.sh +++ b/services/payments/docker/entrypoint.sh @@ -63,11 +63,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs debugpy - uv pip install --no-cache-dir debugpy -fi - echo "$INFO Starting $* ..." echo " $SC_USER_NAME rights : $(id "$SC_USER_NAME")" echo " local dir : $(ls -al)" diff --git a/services/resource-usage-tracker/docker/boot.sh b/services/resource-usage-tracker/docker/boot.sh index 482eb8d5a7ef..d6e54f8f3478 100755 --- a/services/resource-usage-tracker/docker/boot.sh +++ b/services/resource-usage-tracker/docker/boot.sh @@ -30,6 +30,11 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then uv pip list fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + # # RUNNING application # diff --git a/services/resource-usage-tracker/docker/entrypoint.sh b/services/resource-usage-tracker/docker/entrypoint.sh index c3565d268b38..e89ad5408a31 100755 --- a/services/resource-usage-tracker/docker/entrypoint.sh +++ b/services/resource-usage-tracker/docker/entrypoint.sh @@ -63,11 +63,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs debugpy - uv pip install --no-cache-dir debugpy -fi - # Appends docker group if socket is mounted DOCKER_MOUNT=/var/run/docker.sock if stat $DOCKER_MOUNT >/dev/null 2>&1; then diff --git a/services/storage/docker/boot.sh b/services/storage/docker/boot.sh index c76e98a411ce..ea9bf8bd8779 100755 --- a/services/storage/docker/boot.sh +++ b/services/storage/docker/boot.sh @@ -31,6 +31,11 @@ elif [ "${SC_BUILD_TARGET}" = "production" ]; then entrypoint="" fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + APP_LOG_LEVEL=${STORAGE_LOGLEVEL:-${LOG_LEVEL:-${LOGLEVEL:-INFO}}} SERVER_LOG_LEVEL=$(echo "${APP_LOG_LEVEL}" | tr '[:upper:]' '[:lower:]') diff --git a/services/storage/docker/entrypoint.sh b/services/storage/docker/entrypoint.sh index 359575ae70e6..11684a3a5911 100755 --- a/services/storage/docker/entrypoint.sh +++ b/services/storage/docker/entrypoint.sh @@ -68,11 +68,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs debugpy - uv pip install --no-cache-dir debugpy -fi - echo "$INFO Starting $* ..." echo " $SC_USER_NAME rights : $(id "$SC_USER_NAME")" echo " local dir : $(ls -al)" diff --git a/services/web/server/docker/boot.sh b/services/web/server/docker/boot.sh index e4a72d041ada..08a812f7bb01 100755 --- a/services/web/server/docker/boot.sh +++ b/services/web/server/docker/boot.sh @@ -29,6 +29,11 @@ elif [ "${SC_BUILD_TARGET}" = "production" ]; then APP_CONFIG=server-docker-prod.yaml fi +if [ "${SC_BOOT_MODE}" = "debug" ]; then + # NOTE: production does NOT pre-installs debugpy + uv pip install --no-cache-dir debugpy +fi + APP_LOG_LEVEL=${WEBSERVER_LOGLEVEL:-${LOG_LEVEL:-${LOGLEVEL:-INFO}}} SERVER_LOG_LEVEL=$(echo "${APP_LOG_LEVEL}" | tr '[:upper:]' '[:lower:]') diff --git a/services/web/server/docker/entrypoint.sh b/services/web/server/docker/entrypoint.sh index 6f4facc747ef..d7e4f13bb7a5 100755 --- a/services/web/server/docker/entrypoint.sh +++ b/services/web/server/docker/entrypoint.sh @@ -71,11 +71,6 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then fi fi -if [ "${SC_BOOT_MODE}" = "debug" ]; then - # NOTE: production does NOT pre-installs debugpy - uv pip install --no-cache-dir debugpy -fi - echo "$INFO Starting $* ..." echo " $SC_USER_NAME rights : $(id "$SC_USER_NAME")" echo " local dir : $(ls -al)" From 7af3cc962e2ec17d32a912610886893f788ddd2b Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 22 Oct 2024 09:30:58 +0200 Subject: [PATCH 23/23] revert changes --- services/director/requirements/_tools.txt | 29 +++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/services/director/requirements/_tools.txt b/services/director/requirements/_tools.txt index 4c0c50f666dd..38ed7220aed8 100644 --- a/services/director/requirements/_tools.txt +++ b/services/director/requirements/_tools.txt @@ -1,3 +1,9 @@ +# +# This file is autogenerated by pip-compile with python 3.6 +# To update, run: +# +# pip-compile --output-file=requirements/_tools.txt --strip-extras requirements/_tools.in +# appdirs==1.4.4 # via black black==20.8b1 @@ -8,14 +14,22 @@ click==8.0.3 # via # black # pip-tools +dataclasses==0.7 + # via + # -c requirements/_base.txt + # -c requirements/_test.txt + # black +importlib-metadata==2.0.0 + # via + # -c requirements/_test.txt + # click + # pep517 mypy-extensions==0.4.3 # via black pathspec==0.9.0 # via black pep517==0.12.0 # via pip-tools -pip==24.2 - # via pip-tools pip-tools==6.4.0 # via -r requirements/_tools.in pyyaml==5.4 @@ -25,8 +39,6 @@ pyyaml==5.4 # watchdog regex==2022.1.18 # via black -setuptools==75.1.0 - # via pip-tools toml==0.10.2 # via # -c requirements/_test.txt @@ -43,3 +55,12 @@ watchdog==2.1.6 # via -r requirements/_tools.in wheel==0.37.1 # via pip-tools +zipp==3.4.0 + # via + # -c requirements/_test.txt + # importlib-metadata + # pep517 + +# The following packages are considered to be unsafe in a requirements file: +# pip +# setuptools