PecanProject / pecan

The Predictive Ecosystem Analyzer (PEcAn) is an integrated ecological bioinformatics toolbox.
www.pecanproject.org
Other
200 stars 231 forks source link

Should the Docker workflow run only when the CI tests are successful #3198

Closed allgandalf closed 10 months ago

allgandalf commented 11 months ago

Description

From what I have observed in GitHub Actions of Pecan repository, the Docker workflow takes the most amount of resources in terms of API usage and run time.

Proposed Solution

I'm not 100% sure but i think that we should run the docker workflow only if the CI workflow is completed and successful

This can save us the github action resources and there by reducing the API limit error to a great extent.

Documentation of this featrure can be found here

The basic changes in the docker workflow file would be somewhat like the example below:

on:
  workflow_run:
    workflows: [CI]
    types: [completed]

jobs:
  on-success:
    runs-on: ubuntu-latest
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    steps:
      - run: echo 'The triggering workflow passed'
  on-failure:
    runs-on: ubuntu-latest
    if: ${{ github.event.workflow_run.conclusion == 'failure' }}
    steps:
      - run: echo 'The triggering workflow failed'

I am not sure if there is any downside to this feature or how much negative impact this can have on our current system, so want some suggestions from the community on this proposal.

@robkooper @infotroph @mdietze

mdietze commented 11 months ago

Just to throw out the pros/cons, the obvious disadvantage of this approach is that it is going to roughly double the clock time on all tests.

allgandalf commented 11 months ago

There is a trade-off between time and optimization, I am still insisting to go with optimization as the tests are failing more frequently due to the API rate limit, but again one of the biggest concern is the additional time required :)

allgandalf commented 10 months ago

This issue is been further discussed in #3210, so closing this one to keep a single medium and source of communication