Skip to content

ci: Run "macOS 11.0 [gui, no tests] [jammy]" job on GitHub Actions - #28265

Closed
hebasto wants to merge 1 commit into
bitcoin:masterfrom
hebasto:230813-gha-macos
Closed

hebasto wants to merge 1 commit into
bitcoin:masterfrom
hebasto:230813-gha-macos

Conversation

@hebasto

@hebasto hebasto commented Aug 13, 2023 •

Copy link
Copy Markdown
Member

In response to upcoming limiting free usage of Cirrus CI, suggesting to move the "macOS 11.0 [gui, no tests] [jammy]" task from Cirrus CI to GitHub Actions (GHA).

(See slightly related discussion in #28098)

Builds in my personal repo:

A list of the used actions for the "Actions permissions" repository settings:

actions/cache@*,
actions/checkout@*,
docker/build-push-action@*,
docker/setup-buildx-action@*,

Also, the "macOS 11.0 [gui, no tests] [jammy]" task has been removed
from the Cirrus CI.
@DrahtBot

DrahtBot commented Aug 13, 2023 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #28269 (ci: Drop no longer needed macos_sdk_cache by hebasto)
  • #28187 (ci: Run "macOS native x86_64" job on GitHub Actions by hebasto)
  • #28173 (ci: Run Windows native task on GitHub Actions by hebasto)
  • #21652 (ci: Switch more tasks to self-hosted by MarcoFalke)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@maflcko

maflcko commented Aug 14, 2023

Copy link
Copy Markdown
Member

So this is needed for the gui-qml repo to upload assets? Are there any other tasks that need this feature?

@hebasto

hebasto commented Aug 14, 2023 •

Copy link
Copy Markdown
Member Author

So this is needed for the gui-qml repo to upload assets?

Yes, but this is not the only reason for moving to GitHub Actions (GHA).

Other reasons are:

  • GHA are quicker and cheaper (free) than Cirrus CI. Consider:
    image

  • GHA are quicker and cheaper (free) than self-hosted permanent Cirrus CI workers. Consider:
    image

Are there any other tasks that need this feature?

https://github.com/bitcoin-core/gui-qml/blob/main/.cirrus.yml uploads artifacts for the tasks as follow:

  • "'Win64 [unit tests, no gui tests, no boost::process, no functional tests] [jammy]'"
  • "macOS 10.15 [gui, no tests] [focal]"
  • and other 3 tasks not available in the main repo

Comment thread .github/workflows/ci.yml
tags: test_image
load: true
cache-from: type=gha
cache-to: type=gha,mode=min

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the cache limit and the inner working?

@hebasto hebasto Aug 14, 2023 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So every image will be re-built every week regardless of whether it changed?

Also, is the 10 GB enough to store all ccache + depends + image + ... stuff for all tasks?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So every image will be re-built every week regardless of whether it changed?

Sorry, I don't follow. Why will it be re-built every week?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, sorry, I assumed cache entries will be unconditionally deleted after 7 days. New question: So every image will be re-built regardless of whether it changed, given 10GB of non-image cache items (ccache+depends+...) have been created?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

On the other hand, it's possible to delete images, so it wouldn't be too crazy to "abuse" GHCR for passing CI images and still avoid without eating storage without a limit.

Ah, looks like this is something that should probably be done either way, because untagged images are also kept around. So even if only images for the master branch are used, it would be good to delete "stale tags" (that is, untagged images).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, is the 10 GB enough to store all ccache + depends + image + ... stuff for all tasks?

Well, it depends on what "all tasks" encompass.

A single task currently will cycle through 10GB in less than a day, see https://github.com/bitcoin/bitcoin/actions/caches

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess for this repo, it should be sufficient to only have a master cache (written only by master) and all pull requests and other branches simply read-only from master. This should make the storage needs constant (limited) and easier to think about, without much downside.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You, mean also for the Docker build cache? Yeah, that's a damn simple approach. Then 10 GB are enough for sure, and okay, PRs that modify the Dockerfile will rebuild the Docker image on every push time, but seems acceptable. Anyway, if working on the images, it makes sense to test/build them locally first.

But wouldn't you need artifacts again to transfer the image from the Docker build task to the actual CI task, namely in PRs that modify the Dockerfile, to avoid building the image in every single CI task? Or is this acceptable for this repo, because there won't be many tasks?

The only theoretical problem is this:

GitHub will remove any cache entries that have not been accessed in over 7 days.

It's rather unlikely in this repo that there will be no PR for 7 days. ;) It may happen in the secp256k1 repo, then we could simply have a cron job that runs once every week to rebuild the Docker image. (This is anyway not a bad idea if we want to rebuild our compiler snapshots.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or is this acceptable for this repo, because there won't be many tasks?

There shouldn't be any difference for this repo, because every task has its own image.

@DrahtBot

Copy link
Copy Markdown
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

@dergoegge

Copy link
Copy Markdown
Member

Any reason to not run this on a self-hosted worker through cirrus? I thought we only wanted to convert to GHA where nobody is willing to self host e.g. the native macOS jobs.

@maflcko

maflcko commented Aug 17, 2023

Copy link
Copy Markdown
Member

Any reason to not run this on a self-hosted worker through cirrus?

Self-hosted workers have downsides. For example, they need to be set-up for every fork in a different org, before the CI can be run. But GHA also has downsides. For example, tasks can not be re-run by authors, unless they (force-)push.

And the qml repo needs GHA artefacts?

My suggestion for now would be to use Cirrus self-hosted workers. The qml repo can cherry-pick this pull request in the meantime, until the cache issue is fixed one way or another.

@dergoegge

Copy link
Copy Markdown
Member

My suggestion for now would be to use Cirrus self-hosted workers. The qml repo can cherry-pick this pull request in the meantime, until the cache issue is fixed one way or another.

Sounds good to me. I don't think we should have a dependency on the experimental gui rewrite in this repo.

@fanquake

Copy link
Copy Markdown
Member

I agree. The requirements of a separate (experimental) repository are not really our concern when making CI infrastructure decisions.

@hebasto

hebasto commented Aug 17, 2023

Copy link
Copy Markdown
Member Author

I agree that UX of GitHub Actions is not perfect, unfortunately.

Closing this PR.

@hebasto hebasto closed this Aug 17, 2023
@maflcko

maflcko commented Aug 18, 2023

Copy link
Copy Markdown
Member

I guess neither solution is perfect, but longer term it would still be fun to explore if something can be achieved via ghcr (or some other registry), see https://github.com/bitcoin/bitcoin/pull/28265/files#r1295647557

@bitcoin bitcoin locked and limited conversation to collaborators Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants