CI/Scripts: small changes to [dune.sh]
Relates to #8110
What
- Enables dune cache stats for pipelines triggered via api or scheduled pipelines via
CI_PIPELINE_SOURCEinstead ofTZ_SCHEDULE. - Hit rate as a float between 0 and 1 with full precision instead of a percentage with two decimal figures.
- Prints a note when dune cache stats is enabled.
Why
- Using
CI_PIPELINE_SOURCEseems more robust than usingTZ_SCHEDULE. NB: we currently have some pipelines triggered viaapi(cf../ci/run_pipeline/api.sh). - More flexible and precise than a percentage rate. Probably more standard as well: the raw hit ratio is stored and then the user choses to format it as a percentage in, say, a (Datadog) dashboard.
- Easier to trace what is happening (is
dune.shcalled or not, what is the value ofDUNE_CACHE_INFO).
How
Simple bash changes.
Manually testing the MR
Check test pipelines.
-
schedule_extended_test(CI_PIPELINE_SOURCE=schedule): https://gitlab.com/tezos/tezos/-/pipelines/2217137120-
oc.build_x86_64-released: dune.sh called with cache stats activated: https://gitlab.com/tezos/tezos/-/jobs/12450721567#L67
-
-
before_merging(CI_PIPELINE_SOURCE=merge_request_event): https://gitlab.com/tezos/tezos/-/pipelines/2217173832-
oc.build_x86_64-released: dune.sh called with cache stats not-activated: https://gitlab.com/tezos/tezos/-/jobs/12450910041#L67
-
Checklist
- Document the interface of any function added or modified (see the coding guidelines)
- Document any change to the user interface, including configuration parameters (see node configuration)
- Provide automatic testing (see the testing guide).
-
For new features and bug fixes, add an item in the appropriate changelog (
docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the
Reviewersfield below. -
Select as
Assigneethe next person who should take action on that MR