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

Manual image caching #374

Merged
merged 1 commit into from
Mar 28, 2024
Merged

Manual image caching #374

merged 1 commit into from
Mar 28, 2024

Conversation

Taepper
Copy link
Collaborator

@Taepper Taepper commented Mar 27, 2024

faster builds by copying @corneliusroemer image caching for our dependency images, which rarely change

@Taepper Taepper marked this pull request as ready for review March 27, 2024 17:28
@Taepper Taepper force-pushed the manual-image-caching branch 2 times, most recently from dec1236 to 22088c3 Compare March 28, 2024 07:19
@Taepper
Copy link
Collaborator Author

Taepper commented Mar 28, 2024

an example of the working cache:
https://github.com/GenSpectrum/LAPIS-SILO/actions/runs/8463811779

@Taepper Taepper enabled auto-merge (squash) March 28, 2024 07:21
@corneliusroemer
Copy link
Contributor

Nice! Would be great to quantify the speed ups :D

How long did it take before and now when there are cache hits for everything?

I didn't see the arm part here, do you use separate docker files for that?

@corneliusroemer
Copy link
Contributor

How come the linter takes so long? Is there so much work done?

Also, I noticed you often compile with 4 parallel threads. GitHub actions runners only have 2. It might improve performance to reduce to 2 in CI

Copy link
Contributor

@JonasKellerer JonasKellerer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The ci did not run the unit test image. (from the link you posted) Was that aborted by you?

@Taepper Taepper merged commit 7867bc7 into main Mar 28, 2024
8 checks passed
@Taepper Taepper deleted the manual-image-caching branch March 28, 2024 12:25
@corneliusroemer
Copy link
Contributor

corneliusroemer commented Mar 28, 2024

The ci did not run the unit test image. (from the link you posted) Was that aborted by you?

@JonasKellerer it did, or is that something else?

image

https://github.com/GenSpectrum/LAPIS-SILO/actions/runs/8463828054/job/23187878018

the unit test image is called builder and used in the test run AFAICT:

- name: Build unit test image
uses: docker/build-push-action@v5
with:
context: .
target: builder
tags: builder
load: true
cache-from: type=gha,ref=${{ github.ref_name }}-image-cache
cache-to: type=gha,mode=min,ref=${{ github.ref_name }}-image-cache
build-args: |
DEPENDENCY_IMAGE=ghcr.io/genspectrum/lapis-silo-dependencies:${{ env.DIR_HASH }}
- name: Run tests
uses: addnab/docker-run-action@v3
with:
image: builder
run: ./silo_test

@JonasKellerer
Copy link
Contributor

grafik from Alex comment. There the step of the unit image did not run. But maybe thats an older run? But if it did run all is fine :)

@Taepper
Copy link
Collaborator Author

Taepper commented Mar 28, 2024

I cancelled it after I saw that it hit the cache in the necessary job. I then just squash and rebased the commit for the PR. Then it rebuilt both dependency images as expected, as duckdb->0.10.1 dependency change was already on the changed main

@Taepper
Copy link
Collaborator Author

Taepper commented Mar 28, 2024

@corneliusroemer the quantification is not as straight forward, as the cache was hit also before but only sometimes

Mostly the first dependency jobs, which take 20 mins each (although in parallel) should now be saved, if no dependency were changed. In the attached screenshot the upper pipeline would be shortened by 21m2s, and the lower one hit the cache by itself by chance

image

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