Skip to content

ci: use specific variable for build-id - #3088

Closed
Jose Quaresma (quaresmajose) wants to merge 1 commit into
qualcomm-linux:masterfrom
quaresmajose:build-id
Closed

Jose Quaresma (quaresmajose) wants to merge 1 commit into
qualcomm-linux:masterfrom
quaresmajose:build-id

Conversation

@quaresmajose

@quaresmajose Jose Quaresma (quaresmajose) commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

The variable BUILD_ID should be excluded from the dependencies. To do this more easily, the variable QCOM_BUILD_ID is introduced.

The content of BUILD_ID is usually always different each time it's runs or parsed. This happens because the variable contains the value of DATETIME or the ${{ github.run_id }}-${{ github.run_attempt }} github ci action. Therefore, we should rule out running any task again if it is solely due to changes in the BUILD_ID.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Test run workflow

Test jobs for commit b277562

qcom-distro
Pass: 11 | Fail: 1 | Total: 12
qcom-distro_linux-qcom-6.18
Pass: 201 | Fail: 35 | Total: 259
nodistro
Pass: 10 | Fail: 0 | Total: 10

@test-reporting-app

test-reporting-app Bot commented Sep 7, 2026

Copy link
Copy Markdown

Test Results

   68 files   -    51    319 suites   - 396   8h 28m 58s ⏱️ - 7h 38m 14s
  151 tests  -    24    110 ✅ +    2   3 💤 + 2  38 ❌  - 28 
2 069 runs   - 2 488  1 990 ✅  - 2 372  23 💤  - 22  56 ❌  - 94 

For more details on these failures, see this check.

Results for commit b277562. ± Comparison against base commit 7659417.

This pull request removes 24 tests.
10_Logging_Journalctl_Validation ‑ Logging_Journalctl_Validation
11_Partition_PostBoot_Validation ‑ Partition_PostBoot_Validation
12_Boot_Systemd_KPI_Loop ‑ Boot_Systemd_KPI_Loop
5_OpenCV ‑ OpenCV
6_Ethernet ‑ Ethernet
6_irq ‑ irq
7_BT_ON_OFF ‑ BT_ON_OFF
7_Docker_Kernel_Config ‑ Docker_Kernel_Config
8_AudioRecord ‑ AudioRecord
8_EFI_Variable_Validation ‑ EFI_Variable_Validation
…
This pull request skips 3 tests.
6_AudioRecord ‑ AudioRecord
7_Ethernet ‑ Ethernet
8_DSP_AudioPD ‑ DSP_AudioPD

♻️ This comment has been updated with latest results.

@lumag Dmitry Baryshkov (lumag) left a comment

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.

The variable BUILD_ID should be excluded from the dependencies.

Why? Commit messages should explain the reason for the changes.

The content of BUILD_ID is usually always different each time it's
runs or parsed. This happens because the variable contains the value
of DATETIME or the ${{ github.run_id }}-${{ github.run_attempt }}
github ci action. Therefore, we should rule out running any task
again if it is solely due to changes in the BUILD_ID.

The variable BUILD_ID should be excluded from the dependencies.
To do this more easily, the variable QCOM_BUILD_ID is introduced.

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
@quaresmajose

Copy link
Copy Markdown
Contributor Author

The variable BUILD_ID should be excluded from the dependencies.

Why? Commit messages should explain the reason for the changes.

I added it to the commit:

The content of BUILD_ID is usually always different each time it's runs or parsed. This happens because the variable contains the value of DATETIME or the ${{ github.run_id }}-${{ github.run_attempt }} github ci action. Therefore, we should rule out running any task again if it is solely due to changes in the BUILD_ID.

@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit 44b6a3e

  • qcomdistro: multimedia image
    Pass: 9 | Fail: 0 | Total: 9
  • qcomdistro: multimedia image-prop
    Pass: 41 | Fail: 0 | Total: 41

@mwasilew

Copy link
Copy Markdown
Contributor

I have a strange feeling this will brake all LAVA jobs. Let me check more thoroughly.

@quaresmajose

Copy link
Copy Markdown
Contributor Author

I have a strange feeling this will brake all LAVA jobs. Let me check more thoroughly.

I believe this can be verified forcing a new ci rebuild/retest using the [Re-run all jobs] button of a ci job that has already been completed.

@mwasilew

Copy link
Copy Markdown
Contributor

I pushed this change to next https://github.com/qualcomm-linux/meta-qcom/actions/runs/34359170198

@mwasilew

Copy link
Copy Markdown
Contributor

I think this is OK from testing perspective. The jobs are still running but they look OK. Example here:
https://lava.infra.foundries.io/scheduler/job/406800/definition#defline15

@quaresmajose

Copy link
Copy Markdown
Contributor Author

I think this is OK from testing perspective. The jobs are still running but they look OK. Example here: https://lava.infra.foundries.io/scheduler/job/406800/definition#defline15

Thanks for checking it.

Comment thread ci/base.yml
BUILD_ID ?= "local-${DATETIME}"
QCOM_BUILD_ID ?= "local-${DATETIME}"
BUILD_ID ?= "${QCOM_BUILD_ID}"
BUILD_ID[vardepsexclude] ?= "QCOM_BUILD_ID"

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.

I don't get the change, this will result in builds reusing the build_id from the cache, which will produce a mismatch in os-release / uki / etc, and it goes against the main purpose of the change that added this.

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.

And some additional findings from AI:

  • DATETIME exclusion is lost. BUILD_ID[vardepsexclude] ?= "QCOM_BUILD_ID" in local.conf is parsed before the recipe, so oe-core's ?= "DATETIME" becomes a no-op. Anyone setting BUILD_ID = "${DATETIME}-tag" (the upstream-documented pattern) now rebuilds os-release and every image on each invocation. Fix is "QCOM_BUILD_ID DATETIME", or drop the flag entirely.
  • Both comments are now false. ci/base.yml lines 66-70 still say CI overrides BUILD_ID via the fragment, and compile.yml line 86 still promises os-release maps back to the S3 folder. Neither is true after this change.
  • Weak binding regression. BUILD_ID ?= "${QCOM_BUILD_ID}" means any downstream hard BUILD_ID = unconditionally disconnects CI's run id. No in-tree fragment does this today.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The idea behind this change is to enable the reuse of images from the sstate-cache. Something I've been cooking up for a while now in #2699

It may happen that the image in question does not correspond to the ${{ github.run_id }}-${{ github.run_attempt }} of the executed version in CI. But if this is the case, it's because the image met the conditions to be reused.

So for the execution AAAA-2 in CI we can have AAAA-1 inside the rootfs of the image. This means that the image was reused from ${{ github.run_attempt }}=1.

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.

I understand the idea, but while this will save build time and increase our reproducibility in our CI, it might also confuse users flashing our images for development and debugging purposes, as the runid won't necessarily match.

Unfortunately I don't really have a better solution as anything that touches the image will cause it to be created from scratch.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm going to move this change to #2699 and leave it there while I implement the functionality.

@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit b277562

  • qcomdistro: multimedia image-prop
    Pass: 41 | Fail: 0 | Total: 41
  • qcomdistro: multimedia image
    Pass: 9 | Fail: 0 | Total: 9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants