Skip to content

Commit

Permalink
Remove versioningit from docker install to improve build caching/size
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Jan 14, 2024
1 parent 4c24f27 commit 9067f0e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/integration/dockerfiles/Dockerfile.slurm
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ SHELL ["/bin/bash", "--login", "-c"]
# is built at the root of the jobflow repo
RUN mkdir jobflow-remote
COPY src/jobflow_remote jobflow-remote/src/jobflow_remote
# Unfortunately need to copy the .git folder to get the version
COPY .git/ jobflow-remote/.git
COPY pyproject.toml jobflow-remote/

# versioningit refuses to install a package without its full git history
# so here we remove versioningit config from pyproject.toml as we don't need
# the full version number (which allows us to cache many more layers)
RUN sed -i '/\[tool.versioningit.vcs\]/,+3d' jobflow-remote/pyproject.toml

# Annoyingly we want to use this with the Python SDK
# which does not support buildkit yet
# so cannot use --chmod in the copy directly and
Expand All @@ -44,7 +47,7 @@ USER ${USERNAME}

# Install jobflow in a local native virtualenv
WORKDIR /home/${USERNAME}/jobflow-remote
RUN git config --global --add safe.directory /home/${USERNAME}/jobflow-remote
# RUN git config --global --add safe.directory /home/${USERNAME}/jobflow-remote
RUN python3 -m venv /home/${USERNAME}/.venv
RUN /home/${USERNAME}/.venv/bin/pip install -U pip
RUN /home/${USERNAME}/.venv/bin/pip install --verbose -e .
Expand Down

0 comments on commit 9067f0e

Please sign in to comment.