-
Notifications
You must be signed in to change notification settings - Fork 62
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
Limit PR checks to build only the modified images #558
Limit PR checks to build only the modified images #558
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jiridanek, very nice improvement to save resources!
I've left some comments, please check if they make sense.
"on": | ||
"pull_request": | ||
|
||
permissions: | ||
contents: read | ||
packages: read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see we don't interact with GitHub Packages in this repository, so maybe the packages
permission is not necessary here. I know it was there before, but just pointing it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages: read
is necessary to use ghcr.io repository as a cache; it is running podman with
--cache-from ghcr.io/opendatahub-io/notebooks/workbench-images/build-cache
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the trial PR, it does not seem to be pulling from cache, not even the base images which should be completely unchanged! https://github.com/opendatahub-io/notebooks/actions/runs/9498328161/job/26176821937?pr=555
In the recent PR from Diamond it is using the cache just fine; not sure what busted the cache here https://github.com/opendatahub-io/notebooks/actions/runs/9490922279/job/26155372847?pr=557
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not pulling from cache because the FROM registry.access.redhat.com/ubi9/python-39:latest
image has been updated in the meantime! that explains things, mystery solved, never mind me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for the info :)
while CURSOR is not None: | ||
request = compose_gh_api_request(pull_number=pr_number, owner=owner, repo=repo, per_page=per_page, cursor=CURSOR) | ||
response = urllib.request.urlopen(request) | ||
data = json.loads(response.read().decode("utf-8")) | ||
response.close() | ||
edges = data["data"]["repository"]["pullRequest"]["files"]["edges"] | ||
|
||
CURSOR = None | ||
for edge in edges: | ||
files.append(edge["node"]["path"]) | ||
CURSOR = edge["cursor"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be more efficient to get the changed files using git diff
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe? golangci action queries github api for it, see their docs for only-new-issues
, https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#only-new-issues
I stole this from them 🙃
the gh api query means I can fetch only the latest revision when pulling from git; and I don't have to worry about figuring out what's the PR base commit (I'd need to ask GH for that anyways, although that's available in the github
context right away https://docs.github.com/en/actions/learn-github-actions/contexts#github-context)
Review comments history
|
bafcf10
to
0ac42b4
Compare
@atheo89 @harshad16 can you create If I could apply the label, tide would squash everything when it does its own thing. Tide docs, https://www.kubernetes.dev/docs/guide/pull-requests/#squashing, and here's it in action https://github.com/kubernetes-sigs/prow/pulls?q=is%3Apr+is%3Aopen+label%3Atide%2Fmerge-method-squash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nitpick, otherwise LGTM.
0ac42b4
to
6058715
Compare
New changes are detected. LGTM label has been removed. |
Can we implement filtering to avoid building images for certain file types, such as *.md or *.yaml? Probably as future enhancement |
@jiridanek: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: jstourac The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/override ci/prow/runtimes-ubi9-e2e-tests |
@atheo89: Overrode contexts on behalf of atheo89: ci/prow/anaconda-ubi8-e2e-tests, ci/prow/codeserver-notebook-e2e-tests, ci/prow/intel-notebooks-e2e-tests, ci/prow/notebooks-ubi8-e2e-tests, ci/prow/notebooks-ubi9-e2e-tests, ci/prow/rstudio-notebook-e2e-tests, ci/prow/runtimes-ubi8-e2e-tests, ci/prow/runtimes-ubi9-e2e-tests In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
6058715
to
6cf2725
Compare
New changes are detected. LGTM label has been removed. |
(cherry picked from commit 7bfbf32)
Description
Followup to
that filters out the list of images to build during a PR check only to those that have some source files changed.
This will speed up the PR check build.
How Has This Been Tested?
Created a draft PR that changes one file in a single docker image
Checked that it correctly builds all images that depend on this one.
Merge criteria: