Skip to content

Commit

Permalink
♻️🐛Fix build cache issue in devel mode (ITISFoundation#4894)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg authored Oct 20, 2023
1 parent aa00d52 commit ff62322
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion services/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/agent/requirements/_base.txt,target=_base.txt \
--mount=type=cache,mode=0755,target=/root/.cache/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down
2 changes: 1 addition & 1 deletion services/api-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down
2 changes: 1 addition & 1 deletion services/autoscaling/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ WORKDIR /build
# 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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down
2 changes: 1 addition & 1 deletion services/catalog/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down
2 changes: 1 addition & 1 deletion services/clusters-keeper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down
5 changes: 3 additions & 2 deletions services/dask-sidecar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ ENV LANG=C.UTF-8 \
ENV PATH="${VIRTUAL_ENV}/bin:$PATH"

# for ARM architecture this helps a lot VS building packages
ENV PIP_EXTRA_INDEX_URL=https://www.piwheels.org/simple
# NOTE: remove as this might create bad caching behaviour
# ENV PIP_EXTRA_INDEX_URL=https://www.piwheels.org/simple


EXPOSE 8080
Expand Down Expand Up @@ -94,7 +95,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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down
2 changes: 1 addition & 1 deletion services/datcore-adapter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down
2 changes: 1 addition & 1 deletion services/director-v2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down
2 changes: 1 addition & 1 deletion services/invitations/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down
7 changes: 4 additions & 3 deletions services/osparc-gateway-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ ENV LANG=C.UTF-8 \
ENV PATH="${VIRTUAL_ENV}/bin:$PATH"

# for ARM architecture this helps a lot VS building packages
ENV PIP_EXTRA_INDEX_URL=https://www.piwheels.org/simple
# NOTE: remove as this might create bad caching behaviour
# ENV PIP_EXTRA_INDEX_URL=https://www.piwheels.org/simple


EXPOSE 8000
Expand Down Expand Up @@ -85,7 +86,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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down Expand Up @@ -113,7 +114,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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement requirements/prod.txt

Expand Down
2 changes: 1 addition & 1 deletion services/payments/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down
2 changes: 1 addition & 1 deletion services/resource-usage-tracker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down
2 changes: 1 addition & 1 deletion services/storage/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down
2 changes: 1 addition & 1 deletion services/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,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/pip \
--mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private \
pip install \
--requirement _base.txt

Expand Down

0 comments on commit ff62322

Please sign in to comment.