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

CircleCI: seperate caches based on core modules measurements #769

Closed
tlaurion opened this issue Jul 2, 2020 · 7 comments
Closed

CircleCI: seperate caches based on core modules measurements #769

tlaurion opened this issue Jul 2, 2020 · 7 comments
Labels
Bounty/Donations expected Work could/should be funded by interested stakeholder buildsystem CI enhancement help wanted

Comments

@tlaurion
Copy link
Collaborator

tlaurion commented Jul 2, 2020

The idea here (to replicate on #768 GitlabCI):

  • Have ./crossgcc unique compiler cache based on modules/compiler file being measured
  • Have ./build/* unique build cache based on modules/* files being measured

That way:

  • bash scripts modification won't require to rebuild any module
  • When modules/* change, only the build cache will be remade and made unique
  • When ./crossgcc requires to be remade, crossgcc unique cache will be remade and unique

As of right now, the cache is made a single time and never remade, based on:

- save_cache:
          key: heads-{{ .Environment.CIRCLE_USERNAME }}-{{ .Environment.CACHE_VERSION }}

and

 - restore_cache:
          key: heads-{{ .Environment.CIRCLE_USERNAME }}-{{ .Environment.CACHE_VERSION }}

Failed attempts to specialize CircleCI caches happened here

@tlaurion
Copy link
Collaborator Author

Note: not only modules should be measured to create a distinct cache key (generation/extraction in CIs), but also the patches linked to modules, else they will never be applied.

So the best key would probably be:

  • ./crossgcc being cached if ./modules/musl-cross and ./patches/musl-cross* are still the same (longest to build, mostly never changed. First level of cache restored if second level fails to still speedup builds by1+hour)
  • ./modules/* ./patches/* directories content digest (because patches are applied only at module decompression and never revalidated) resulting in /build being cached and restored if measurements are still valid

This simple CI hack would speed up rebuilding most Heads changes, which are mostly scripts.

@tlaurion tlaurion added the Bounty/Donations expected Work could/should be funded by interested stakeholder label Aug 10, 2020
@tlaurion
Copy link
Collaborator Author

tlaurion commented Aug 11, 2020

This ticket priority just got promoted since #795 requires a cache of coreboot 4.11 (with more patches coming) while other platforms requires a cache of coreboot 4.8.1 with different patches being applied.... Will try to wrap my head around https://app.circleci.com/pipelines/github/tlaurion/heads?branch=CircleCI_specialized_caches and add #769 (comment) requirements...

As of right now, cache needs to be cleared up which makes each remote build of more then 2+hours each...

@tlaurion
Copy link
Collaborator Author

Second attempt here:
tlaurion@9ed4690

Failing result here: https://app.circleci.com/pipelines/github/tlaurion/heads/283/workflows/b3f64a9b-25f9-4194-9884-849a1fd9f897/jobs/308

* Error migrating config to version 2: 2 errors occurred:

* Expected step '[map[key:heads_modules_and_patches-{{ checksum "/tmp/all_modules_patches.sha256sums" }} paths:[packages crossgcc build] save_cache:<nil>]]' to be a map but its type is array
* in job 'build': step was not in the right format (unable to find step's name/details)
* In step 32 definition: Step

  - 
has incorrect indentation,it should be formatted like:

  - step:
      option1: value
      option2: value

@tlaurion
Copy link
Collaborator Author

@tlaurion
Copy link
Collaborator Author

Work done on CircleCI will be paid by https://opencollective.com/insurgo and this ticket will be updated with bounty payment details being cross-referenced.

@tlaurion
Copy link
Collaborator Author

tlaurion commented Aug 22, 2020

Commits linked to invoice of 2000$ at opencollective (cannot do this for free anymore...)
980db58 CircleCI: Adding debian new host build requirements: doxygen graphviz udev libudev1 libudev-dev automake libtool
f2f795c CircleCI: bring pair to master with changes for x230-external-flash changes
8a8c70e CircleCI: take back specialized cache to reapply coreboot patches that aren't build in current cache
33db7ff CIs: fixup and add x230-external-flash consequently of past CIs fixes
b44ef5a CIs: adding ncurses devel packages to both Ubuntu(CircleCI) and Fedora(GitlabCI) CIs for better user local reproducibility of host local builds. (required for make menuconfig and make savedefconfig to move reduced configs back to config directory containing minimal changes)
4a34d05 Add x230-external-flash board, working CIs and replacing x230 default building board with x230-external-flash in both CircleCI and GitlabCI configurations so people can test this PR prior of merging upstream.
76d3d20 Minimizing changes from Nitrokey#1 to at least reuse the musl-cross cache on CI. Removed x230-hotp-verification changes to hack it more up to review Nitrokey PR against heads' current master
b14e564 Fix CircleCI build problems (#808)
c6a82a2 CircleCI: mitigate issue #799 (#800)
63b400c CircleCI : specialized caches (#798)
d3d4529 GitlabCI: reset cache, and investigate
3dbf1f5 Merge pull request #744 from tlaurion/CIs_reusable_cache_typo_fix
53071ce CircleCI: fix typos (save_cache and restore_cache not identical)
872ac38 Merge pull request #743 from tlaurion/CIs_reusable_cache_fix
7941dac CIs: Replace cache fingerprints so cache is reusable between builds (fix save_cache)
27fe438 Merge pull request #742 from tlaurion/CIs_reusable_cache
11a0fdc CIs: Replace cache fingerprint with username of the user launching the build to make it reusable between PRs
9311eec Merge pull request #738 from tlaurion/CIs_add_t430
dcbeb26 CIs: move qemu-coreboot to be built last, add t430 and t430-flash boards to CIs
78053b9 Merge pull request #729 from tlaurion/CIs-cache_restriction-artifacts_cleanup
7600ce4 GitlabCI: restrict cache, store cleaned build artifacts for x230* and qemu-coreboot
b88daa7 Add Fedora 30 gitlab-ci CI configuration building x230-hotp-verification
fdbac66 Add gitlab-ci CI configuration which builds for x230-hotp-verification for the moment
2d50e01 Make hotp-verification hashes same across two CIs
040e358 CIs: pass CircleCI to debian:bullseye docker image, provide logs.tar.gz and cpios to facilitate debugging of reproducibility issues

@tlaurion
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bounty/Donations expected Work could/should be funded by interested stakeholder buildsystem CI enhancement help wanted
Projects
None yet
Development

No branches or pull requests

1 participant