Skip to content

ci: remove toolchain adjustments #2484

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

Merged
merged 61 commits into from
Apr 25, 2025
Merged

ci: remove toolchain adjustments #2484

merged 61 commits into from
Apr 25, 2025

Conversation

evilrobot-01
Copy link
Contributor

@evilrobot-01 evilrobot-01 commented Apr 22, 2025

Summary

Closes #2458

  • [n] y/n | Does it introduce breaking changes?
  • [n] y/n | Is it dependent on a specific version of cargo-contract or pallet-revive?

Updates CI workflow to use a new Docker image (use-ink/docker-images#4) with some image optimisations, along with updates to the scripts which were removing toolchains defined in the CI image to free up space.

Requires use-ink/docker-images#4 to be merged and a new CI docker image to be built/published.

Description

The PR introduces two new reusable actions: .github/init for intializing a runner in each job and .github/run-container-command) for executing a batch of commands within a container.

Each job runs in its own runner instance and therefore needs to have space cleared and caching setup. The init action standardises this approach in a somewhat configurable/flexible way. About 45GB is available after using the init action. Removing data does take a little time, so it should therefore only be used on jobs which actually require the space. The improved useink/ci image is 1.32GB compressed/~4.3GB uncompressed, leaving ~40GB free for jobs. All toolchain removals, CARGO_INCREMENTAL and partitioning has been removed as a result. The action also optionally sets up Rust caching, mostly so this is defined once and it is clear that it is per runner/job. Additional caching by matrix value is possible.

The run-container-command action allows commands to be run within a container AFTER space has been cleared, which is important as the same runner disk is used for both the job, the pulled docker image and then the results of the job within the container. Using the container attribute sadly does not allow for space to be cleared prior to the container being launched, necessitating this action. The workspace on the host is mapped into a different path in the container, requiring a few adjustments to the directory paths for effective caching.

Notes:

  • Each job using a container pulls the docker image which takes about 30 secs. Attempts at caching the docker images resulted in about the same amount of time but with added complexity and additional cache storage requirements. It therefore didnt seem worth pursuing at this time.
  • There are some jobs which may benefit from better caching, but that is considered out of scope for this PR.

Checklist before requesting a review

  • I have added an entry to CHANGELOG.md
  • I have commented on my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

@evilrobot-01 evilrobot-01 force-pushed the frank/disk-usage branch 5 times, most recently from 0746bd5 to ceb3747 Compare April 23, 2025 09:38
@davidsemakula davidsemakula self-requested a review April 23, 2025 22:49
@evilrobot-01 evilrobot-01 marked this pull request as ready for review April 24, 2025 20:47
Copy link
Collaborator

@davidsemakula davidsemakula left a comment

Choose a reason for hiding this comment

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

Looks great!
Thanks @evilrobot-01

@davidsemakula davidsemakula merged commit 313cf9f into master Apr 25, 2025
25 of 28 checks passed
@davidsemakula davidsemakula deleted the frank/disk-usage branch April 25, 2025 06:03
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.

Fix recurring "no more disk space" issues in ink! CI
2 participants