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

Ci experimentation #923

Merged
merged 3 commits into from
Jun 26, 2023
Merged

Ci experimentation #923

merged 3 commits into from
Jun 26, 2023

Conversation

pgrange
Copy link
Contributor

@pgrange pgrange commented Jun 12, 2023

This branch introduces an alternative CI process: It's doing the same job as ci.yaml but trying to take benefit of github action
pre-installed software on Ubunut images and cache mechanism.

In my experiments, it's sometimes able to achieve better performance than our current ci, I think it's related to a difference in cache performance between GitHub action and nix.

At this stage, I want us to have both CI live together to observe, after some time, what happens:

  • I'm expecting this CI2 to perform better when incrementally commit stuff to a branch
  • But it might perform worse when rebasing a branch
  • GitHub cache is limited to 10Gb, it could work for us but how much extra build time do we pay if it's not the case?
  • Also note that this branch drastically reduces the space we use on GitHub cache so we should see less cache misses here

Both CI and CI2 rely on subtle caching mechanisms and it's only by running them both that we can appreciate the real difference, if any.

These are the changes introduced:

  • building the static binary has been extracted in a dedicated workflow, similar to what we do with docker
  • a new ci2.yaml defines a similar workflow as ci.yaml but relying on different tooling
  • a setup_dev_ubuntu GitHub action has been introduced to limit copy/pasting ci code

So let's merge that, run both of them together for two weeks and get metrics out of it.


  • No new TODOs introduced or explained herafter

-> TODO review in two weeks after the merge

Oh, I almost forgot, the first build of this on master will take 1h30 or something and this is expected.

@pgrange pgrange force-pushed the ci_experimentation branch from 0e7ba80 to 0671b40 Compare June 12, 2023 12:20
@github-actions
Copy link

github-actions bot commented Jun 12, 2023

Transactions Costs

Sizes and execution budgets for Hydra protocol transactions. Note that unlisted parameters are currently using arbitrary values and results are not fully deterministic and comparable to previous runs.

Metadata
Generated at 2023-06-26 09:55:59.730715913 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 2212a4ee618434b9b2f366d7c330dbdfb5c7072e793a850fd0de6ddd 4294
νCommit 69e1ccf9ad73dc6d37a5bc8de5aec86f3c4c1710fe5fd334e0e16b18 2124
νHead 8ae095dca4d14a1b8edffb37faa6c84ec60340fbf389a62f027e0b76 9355
μHead 33642a45c7fbb955ce1704ef09229bb211bf9af9980530db28c6aafe* 4148
  • The minting policy hash is only usable for comparison. As the script is parameterized, the actual script is unique per Head.

Cost of Init Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 4739 12.42 4.85 0.49
2 4946 15.14 5.89 0.53
3 5151 19.61 7.65 0.59
5 5566 24.52 9.51 0.66
10 6584 34.12 13.05 0.81
37 12123 97.21 36.81 1.73

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 599 14.89 5.70 0.34
2 787 19.57 7.70 0.40
3 974 24.75 9.88 0.46
5 1349 36.15 14.59 0.61
10 2279 71.73 28.85 1.04
13 2857 98.03 39.15 1.35

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 814 27.89 10.83 0.49
2 114 1135 43.42 16.99 0.67
3 169 1454 61.77 24.33 0.89
4 225 1775 82.30 32.57 1.13

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 635 18.58 8.31 0.39
2 804 19.97 9.56 0.42
3 766 18.75 7.91 0.39
5 1299 24.16 13.33 0.50
10 2124 31.12 19.62 0.64
50 8726 87.17 69.99 1.74

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 667 24.34 10.47 0.45
2 840 26.06 11.84 0.48
3 1005 28.20 13.38 0.52
5 1337 31.63 16.12 0.58
10 2160 39.77 22.80 0.73
45 7926 99.74 70.74 1.81

Cost of Abort Transaction

Some variation because of random mixture of still initial and already committed outputs.

Parties Tx size % max Mem % max CPU Min fee ₳
1 4930 23.28 9.83 0.63
2 5177 36.59 15.53 0.79
3 5498 53.72 22.99 0.99
4 5818 73.48 31.60 1.23
5 6139 95.31 41.18 1.49

Cost of FanOut Transaction

Involves spending head output and burning head tokens. Uses ada-only UTxO for better comparability.

Parties UTxO UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
5 0 0 4765 8.66 3.57 0.46
5 1 57 4796 10.06 4.39 0.47
5 5 283 4943 15.64 7.69 0.55
5 10 567 5121 22.61 11.82 0.64
5 20 1139 5480 36.56 20.07 0.83
5 30 1706 5838 50.52 28.33 1.02
5 40 2275 6202 64.49 36.60 1.21
5 50 2849 6566 78.46 44.87 1.40
5 65 3702 7103 99.42 57.28 1.68

@github-actions
Copy link

github-actions bot commented Jun 12, 2023

Test Results

326 tests   320 ✔️  25m 59s ⏱️
110 suites      6 💤
    6 files        0

Results for commit 7389789.

♻️ This comment has been updated with latest results.

@pgrange pgrange marked this pull request as ready for review June 12, 2023 15:09
@pgrange pgrange mentioned this pull request Jun 12, 2023
4 tasks
Copy link
Member

@ch1bo ch1bo left a comment

Choose a reason for hiding this comment

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

Mostly minor things and I'm happy to try this out!

.github/workflows/actions/setup_dev_ubuntu/action.yaml Outdated Show resolved Hide resolved
.github/workflows/ci2.yaml Outdated Show resolved Hide resolved
.github/workflows/ci2.yaml Outdated Show resolved Hide resolved
.github/workflows/ci2.yaml Outdated Show resolved Hide resolved
.github/workflows/ci2.yaml Outdated Show resolved Hide resolved
@pgrange pgrange force-pushed the ci_experimentation branch 14 times, most recently from 8213ccb to 4491e5a Compare June 13, 2023 09:29
@pgrange pgrange force-pushed the ci_experimentation branch 8 times, most recently from 04c91ed to 6a758c8 Compare June 15, 2023 06:09
@pgrange pgrange force-pushed the ci_experimentation branch from 6a758c8 to 6d325dc Compare June 21, 2023 17:47
@pgrange pgrange force-pushed the ci_experimentation branch 3 times, most recently from 9ca611a to ad5557f Compare June 22, 2023 09:03
@pgrange pgrange requested a review from ch1bo June 22, 2023 09:40
@ch1bo ch1bo self-assigned this Jun 22, 2023
Copy link
Member

@ch1bo ch1bo left a comment

Choose a reason for hiding this comment

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

I think it's fair to call this now ci-cabal.yaml and the other ci-nix.yaml and have it running along.

Caching seems to look good now as well? Great job!

.github/workflows/ci-haddock.sh Show resolved Hide resolved
@ch1bo ch1bo removed their assignment Jun 23, 2023
@pgrange pgrange force-pushed the ci_experimentation branch from ad5557f to c945243 Compare June 26, 2023 07:29
pgrange added 3 commits June 26, 2023 11:41
Building the static executable is orthogonal to ci the same way
building the docker images is so we deal with it the same way
by putting it in it's own dedicated workflow.
This is doing the same job as CI but trying to embrace github action
pre-installed software on Ubunut images and cache mechanism.

At this stage, the idea is to have both CI live together to observe,
after some time, what happens because there are quite subtle cache
interactions in both strategies.

So let's run both, see what happen and if we can learn something from it.
@ch1bo ch1bo force-pushed the ci_experimentation branch from c945243 to 7389789 Compare June 26, 2023 09:41
@pgrange pgrange merged commit 04844e8 into master Jun 26, 2023
@pgrange pgrange deleted the ci_experimentation branch June 26, 2023 10:09
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.

2 participants