Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add pip cache #589

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

gabrielpiassetta
Copy link
Contributor

@gabrielpiassetta gabrielpiassetta commented Jul 28, 2023

Add pip cache to Setup python step

@jenstroeger jenstroeger changed the base branch from main to staging August 7, 2023 08:39
@jenstroeger
Copy link
Owner

Just to be sure: as per docs the

cache: 'pip'

seems to cache pip’s internal cache between workflows (and therefore between workflow VMs) of the same run — but that’s not stated explicitly. Is that correct?

Furthermore, note that SLSA Build Level 3 requires to

prevent runs from influencing one another, even within the same project.

The term “run” isn’t clearly defined, but we need to keep in mind that while the public PyPI artifactory is trusted, caches in between are not because modifications/tempering is invisible to us (see also cache poisoning). (And that includes an AWS Artifactory or the like!)

Also, looking at the runtimes of the Check change set workflow I get values (random sampling) ranging from 3m 55s, 4m 25s to 5m 31s, 6m 17s and up to 7m 7s, 8m 8s — with this change clocking in at 7m 45s:

Screenshot 2023-09-02 at 17 24 41

So, do we have a measurable impact resulting from this?

@jenstroeger
Copy link
Owner

@behnazh what do you think of this comment: pre-commit/pre-commit#2847 (comment)

@behnazh
Copy link
Collaborator

behnazh commented Oct 1, 2023

@behnazh what do you think of this comment: pre-commit/pre-commit#2847 (comment)

This solution seems to have similar issues for build isolation. We have designed _build.yaml reusable workflow in a way to be fully isolated, e.g., by limiting the inputs to the workflow and not using any third-party GitHub Actions (except for the trusted Actions from GitHub itself). Enabling caching breaks the isolation security property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants