question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Job Interference using Reusable Workflows with Matrix Strategy

See original GitHub issue

Describe the bug Using reusable workflows with matrix strategies is now supported (thank you!). However, there seems to be a flakey bug where the jobs created by the reusable workflow interact in different ways. Let’s say there is a matrix strategy creating two reusable workflow calls, BUILD_1 and BUILD_2. Then,

  • Sometimes the job JOB_A for BUILD_1 appears in BUILD_2

Both of JOB_A’s had the same full name (so they were both referencing the same matrix strategy input)

https://github.com/project-oak/oak/actions/runs/4347726368/jobs/7604490843 https://github.com/project-oak/oak/actions/runs/4347726368/jobs/7604492489

BUT their inputs to the steps where different and corresponded to the different invocations of the reusable workflow.

This was caused when clicking the UI for re-running the workflow when it failed.

Are these reusable workflow invocations truly isolated and running in different environments? We are particularly concerned because our project requires isolation in each reusable workflow environment in order to produce a build that satisfies isolation properties from other builds.

To Reproduce Steps to reproduce the behavior:

  1. Use a reusable workflow with matrix strategy, where one job requires another. Say, one job uploads an artifact and the second downloads.
jobs:
  build_binary:
    # We use the same job template to generate provenances for multiple binaries.
    strategy:
      fail-fast: false
      matrix:
        buildconfig:
          - buildconfigs/slsav1_oak_functions_enclave_app.toml
          - buildconfigs/slsav1_oak_tensorflow_enclave_app.toml

    permissions:
      actions: read
      id-token: write
      contents: write
      pull-requests: write
    uses: ./.github/workflows/reusable_provenance.yaml
    with:
      build-config-path: ${{ matrix.buildconfig }}

Expected behavior We expect that each BUILD runs in separate environments, and the JOBs do not interact

Runner Version and Platform

Image: ubuntu-20.04 Version: 20230224.2

OS of the machine running the runner? Linux

What’s not working?

A job appears twice in one build, but not in the other: unnamed

Job Log Output

Runner and Worker’s Diagnostic Logs

https://github.com/project-oak/oak/actions/runs/4347726368/jobs/7604490843 https://github.com/project-oak/oak/actions/runs/4347726368/jobs/7604492489

cc @rbehjati @laurentsimon @ianlewis @jhutchings1

Issue Analytics

  • State:open
  • Created 6 months ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
asraacommented, Mar 8, 2023

Update: I think we have debugged the upload issue. The double run issue still remains.

1reaction
asraacommented, Mar 7, 2023

On the one where it is run twice, I noticed something really weird. Both of the jobs had the same full name (so they were both referencing the same matrix strategy input)

https://github.com/project-oak/oak/actions/runs/4347726368/jobs/7604490843 https://github.com/project-oak/oak/actions/runs/4347726368/jobs/7604492489

BUT their steps inputs where different and corresponded to the different invocations of the reusable workflow, which caused both the uploads to occur.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub Actions - Reusable workflows - Matrix Strategies
A GitHub Actions job that uses a matrix strategy allows you to create a single job definition that automatically runs multiple times.
Read more >
Github Action use matrices with reuse-able workflow
GitHub Actions matrix supports now reusable workflows (since 22.08.22): ... workflow use strategy on a job that is a reusable action call.
Read more >
How we made our integration tests delightful by optimizing ...
Reusable workflows are a way to use full-fledged workflows as jobs within an overarching workflow. In our case this means we have one...
Read more >
GitHub Actions: Improvements to reusable workflows
Calling a reusable workflow from a matrix allows you to create richer parameterized builds and deployments.
Read more >
GitHub Actions best practices for Rust projects
If you're trying to consolidate a bunch of duplicate jobs, a good strategy is to start identifying the small pieces of each job...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found