Skip to content

Commit

Permalink
Cache pip
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeSneyders committed Jun 27, 2023
1 parent 882193f commit c7a283e
Show file tree
Hide file tree
Showing 16 changed files with 73 additions and 39 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
cache: pip

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@master

- name: Set up Python 3.9
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: 3.9

Expand Down
6 changes: 4 additions & 2 deletions components/caption_images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ RUN apt-get update && \

# Install requirements
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down
8 changes: 5 additions & 3 deletions components/download_images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ RUN apt-get update && \
apt-get install git -y

# Install requirements
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r requirements.txt
COPY requirements.txt ./
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down
8 changes: 5 additions & 3 deletions components/embedding_based_laion_retrieval/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ RUN apt-get update && \
apt-get install git -y

# Install requirements
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r requirements.txt
COPY requirements.txt ./
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down
6 changes: 4 additions & 2 deletions components/filter_comments/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ RUN apt-get update && \

# Install requirements
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down
6 changes: 4 additions & 2 deletions components/filter_line_length/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ RUN apt-get update && \

# Install requirements
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down
8 changes: 5 additions & 3 deletions components/image_cropping/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ RUN apt-get update && \
apt-get install git -y

# Install requirements
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r requirements.txt
COPY requirements.txt ./
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down
8 changes: 5 additions & 3 deletions components/image_embedding/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ RUN apt-get update && \
apt-get install git -y

# Install requirements
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r requirements.txt
COPY requirements.txt ./
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down
8 changes: 5 additions & 3 deletions components/image_resolution_extraction/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ RUN apt-get update && \
apt-get install git -y

# Install requirements
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r requirements.txt
COPY requirements.txt ./
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down
8 changes: 5 additions & 3 deletions components/image_resolution_filtering/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ RUN apt-get update && \
apt-get install git -y

# Install requirements
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r requirements.txt
COPY requirements.txt ./
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down
8 changes: 5 additions & 3 deletions components/load_from_hf_hub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ RUN apt-get update && \
apt-get install git -y

# Install requirements
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r requirements.txt
COPY requirements.txt ./
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down
8 changes: 5 additions & 3 deletions components/pii_redaction/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ RUN apt-get update && \
apt-get install git -y

# Install requirements
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r requirements.txt
COPY requirements.txt ./
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down
8 changes: 5 additions & 3 deletions components/prompt_based_laion_retrieval/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ RUN apt-get update && \
apt-get install git -y

# Install requirements
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r requirements.txt
COPY requirements.txt ./
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down
6 changes: 4 additions & 2 deletions components/segment_images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ RUN apt-get update && \

# Install requirements
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down
8 changes: 5 additions & 3 deletions components/write_to_hf_hub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ RUN apt-get update && \
apt-get install git -y

# Install requirements
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r requirements.txt
COPY requirements.txt ./
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install -r requirements.txt

# Install Fondant
# This is split from other requirements to leverage caching
ARG FONDANT_VERSION=dev
RUN pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}
RUN --mount=type=cache,target=~/.cache/pip \
pip3 install git+https://github.com/ml6team/fondant@${FONDANT_VERSION}

# Set the working directory to the component folder
WORKDIR /component/src
Expand Down

0 comments on commit c7a283e

Please sign in to comment.