Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
remote_execution: 'true'

steps:
- uses: actions/checkout@v4
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd"

- name: Set up authentication
shell: bash
Expand All @@ -72,23 +72,28 @@ jobs:
- "os=linux"
- "arch=x64"
- "remote_execution=${{ matrix.remote_execution }}"
- "engflow-bento-name=example-gh-x64"
- "engflow-cluster=glass"
- "engflow-container-image=docker://645088952840.dkr.ecr.eu-west-1.amazonaws.com/engflow-ci/debian12-dind-x64@sha256:1389536c34990e6f49cb38575c2b4f9d08cd3a27e7c3e93c77b7af6260fc5f83"
- "engflow-pool=ci_sysbox_x64"
- "engflow-runtime=sysbox-runc"
- "engflow-runner-id=${{ github.repository_id }}_ci-runners-test-matrix_${{ github.run_id }}_${{ github.run_number }}_${{ github.run_attempt }}"
- "engflow-job-name=ci-runners-test-matrix-${{matrix.remote_execution}}_${{matrix.allow_bento_snapshot}}"
- "engflow-job-type=${{github.event_name}}-${{github.ref_name}}"
- "engflow-run-id=${{ github.run_id }}"
# To avoid a race condition, among all the jobs that use the same Bento in the same repo, only
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

it's not a race condition. The intended use is that one job seeds the snapshot, and multiple jobs (including smaller ones like presubmit-checks) use the snapshot.

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.

Reading the code, looks like if multiple jobs specify engflow-bento-allow-save=true, all of them might take snapshots. I understand that's not the intended use, but if you do do that, isn't that a race condition?

It's not hard to accidentally do it with matrix jobs.

# one should specify "engflow-bento-allow-save=true".
- "engflow-bento-allow-save=${{ matrix.allow_bento_snapshot }}"

timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- remote_execution: 'false'
allow_bento_snapshot: 'false'

- remote_execution: 'true'
allow_bento_snapshot: 'true'

steps:
- uses: actions/checkout@v3
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd"

- name: Set up authentication
shell: bash
Expand All @@ -110,16 +115,15 @@ jobs:
- self-hosted
- "os=linux"
- "arch=x64"
- "engflow-bento-name=example-gh-x64"
- "engflow-cluster=glass"
- "engflow-container-image=docker://645088952840.dkr.ecr.eu-west-1.amazonaws.com/engflow-ci/debian12-dind-x64@sha256:1389536c34990e6f49cb38575c2b4f9d08cd3a27e7c3e93c77b7af6260fc5f83"
- "engflow-pool=ci_sysbox_x64"
- "engflow-runtime=sysbox-runc"
- "engflow-runner-id=${{ github.repository_id }}_buck2-test_${{ github.run_id }}_${{ github.run_number }}_${{ github.run_attempt }}"
- "engflow-job-name=ci-runners-test-matrix"
- "engflow-job-type=${{github.event_name}}-${{github.ref_name}}"
- "engflow-run-id=${{ github.run_id }}"
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd"

- name: Set up Buck2 binary
shell: bash
Expand Down