Lightning-AI / pytorch-lightning

Pretrain, finetune ANY AI model of ANY size on multiple GPUs, TPUs with zero code changes.
https://lightning.ai
Apache License 2.0
28.47k stars 3.39k forks source link

CI: Define reusable workflows and composite actions #12545

Closed akihironitta closed 1 year ago

akihironitta commented 2 years ago

Proposed refactor

Some of the steps/workflows are repetitive across workflows/repositories, which makes it very time-consuming to make sure that all of our workflow files are updated in the same way.

Items to be decoupled

Motivation

To improve maintainability.

(I think we should first focus only on this repository, but it will also beneficial for other repositories in the future as these decoupled actions/workflows can be called from other repositories.)

Pitch

  1. Decouple repetitive steps from existing workflows, and pack them into composite actions in the following directory:

    .github/actions/*/config.yml
  2. Decouple repetitive workflows from our repositories and define reusable workflows (reusable workflows are different from composite actions above).

    .github/workflows/_*.yml

Additional context


If you enjoy Lightning, check out our other projects! ⚡

cc @carmocca @akihironitta @borda @justusschock @awaelchli @rohitgr7

Borda commented 2 years ago

you can check PoC from Metrics: https://github.com/PyTorchLightning/metrics/tree/master/.github/actions/caching

Borda commented 1 year ago

I belive that we have done this :otter: great work @akihironitta and @carmocca!